# renderable spline option

**URL:** <https://forums.chaos.com/t/renderable-spline-option/45859>\
**Category:** Public\
**Created:** [July 29, 2013, 9:46am UTC](https://forums.chaos.com/t/renderable-spline-option/45859 "2013-07-29T09:46:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![naik](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@naik](https://forums.chaos.com/u/naik)\
**Post date:** [July 29, 2013, 9:46am UTC](https://forums.chaos.com/t/renderable-spline-option/45859/1 "2013-07-29T09:46:29Z")

</div>

hey guys,

i have recently discovered that there is an option to set a spline to renderable  
via selecting the shapenode and adding an vray attribute “renderable”  
It just works perfectly, but here comes my problem.

I would like to set this attribute to maybe 200 splines and this way  
it is not functioning. It would be cool to have a solution  
like the vray object properties, which you an add to multiple objects and  
controlling them with just one object property “node” ( color , width etc.. )

Is there any workaround for my problem?

regads

---

<div class="post-metadata">

**Author:** ![pechart](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@pechart](https://forums.chaos.com/u/pechart)\
**Post date:** [July 29, 2013, 11:48am UTC](https://forums.chaos.com/t/renderable-spline-option/45859/2 "2013-07-29T11:48:08Z")

</div>

You can already find exactly this option under Create-\>V-Ray-\>Create Renderable Curve. (At least in the nightlies.)

---

<div class="post-metadata">

**Author:** ![t.petrov](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@t.petrov](https://forums.chaos.com/u/t.petrov)\
**Post date:** [July 29, 2013, 11:51am UTC](https://forums.chaos.com/t/renderable-spline-option/45859/3 "2013-07-29T11:51:49Z")

</div>

Yes,

Haven’t you tried to use Create → V-Ray → V-Ray renderable curve → Apply single VRayRenderableCurve to selection?  
I’m not sure what is the first version that this feature is available. But I don’t think it have been added recently.  
What version are you using?

---

<div class="post-metadata">

**Author:** ![naik](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@naik](https://forums.chaos.com/u/naik)\
**Post date:** [July 29, 2013, 12:21pm UTC](https://forums.chaos.com/t/renderable-spline-option/45859/4 "2013-07-29T12:21:45Z")

</div>

that sounds cool.

right now i’m using version 2.20.01 as far as i can see…

regards

---

<div class="post-metadata">

**Author:** ![t.petrov](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@t.petrov](https://forums.chaos.com/u/t.petrov)\
**Post date:** [July 29, 2013, 1:01pm UTC](https://forums.chaos.com/t/renderable-spline-option/45859/5 "2013-07-29T13:01:52Z")

</div>

naik: Do you have the option or not?

---

<div class="post-metadata">

**Author:** ![naik](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@naik](https://forums.chaos.com/u/naik)\
**Post date:** [July 29, 2013, 1:05pm UTC](https://forums.chaos.com/t/renderable-spline-option/45859/6 "2013-07-29T13:05:51Z")

</div>

no, there is no option for this.

 ![vray.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/f/2/f29e9153685385e0cbc236034c8c202d34425ded.jpeg)

---

<div class="post-metadata">

**Author:** ![t.petrov](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@t.petrov](https://forums.chaos.com/u/t.petrov)\
**Post date:** [July 29, 2013, 1:16pm UTC](https://forums.chaos.com/t/renderable-spline-option/45859/7 "2013-07-29T13:16:19Z")

</div>

If you need this feature urgently then you can write to our support at vraymaya @ [chaosgroup.com](http://chaosgroup.com) and they can give you access to the night builds.  
The other option is to write a script which setup the options per shape.

---

<div class="post-metadata">

**Author:** ![naik](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@naik](https://forums.chaos.com/u/naik)\
**Post date:** [July 29, 2013, 1:33pm UTC](https://forums.chaos.com/t/renderable-spline-option/45859/8 "2013-07-29T13:33:47Z")

</div>

Thanks for your fast reply…  
i have just tried to build a script for this purpose, but honestly, my script skills are  
ridiculous. I thought that there are some scripts for that purpose on the net but i couldn’t find anything yet.  
If i can’t find anything i will write to the support and hopefully i can use the nightly build.

Here is a script which i tried to modifiy, but i still get syntax errors ☹  
BIG CREDITS to DJX ( David Johnson )  
global proc renderspline() {

string $shapes[] = eval(“listRelatives -s `ls -sl`”);

}

for($s in $shapes) {

vray addAttributesFromGroup $s vray\_nurbscurve\_renderable 0; -checkBox 1;

evalDeferred(“setAttr “+ $s +”.vrayNurbsCurveRenderable 1”);   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evalDeferred(“setAttr “+ $s +”.vrayNurbsCurveMaterial 1”);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evalDeferred(“setAttr “+ $s +”.vrayNurbsCurveTesselation 1”);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evalDeferred(“setAttr “+ $s +”.vrayNurbsCurveStartWidth 1”);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evalDeferred(“setAttr “+ $s +”.vrayNurbsCurveLockEndWidth 1”);   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evalDeferred(“setAttr “+ $s +”.vrayNurbsCurveEndWidth 1”);   
&nbsp;&nbsp;&nbsp;&nbsp;}  
}

best regards

---

<div class="post-metadata">

**Author:** ![t.petrov](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@t.petrov](https://forums.chaos.com/u/t.petrov)\
**Post date:** [July 29, 2013, 2:12pm UTC](https://forums.chaos.com/t/renderable-spline-option/45859/9 "2013-07-29T14:12:34Z")

</div>

Try this one instead:

```auto

string $shapes[] = eval("listRelatives -s `ls -sl`");
string $s;
for($s in $shapes)

for($s in $shapes) {
    if (nodeType($s)!="nurbsCurve")
        continue;
    print("adding renderable curves to "+$s+"\n");
    vray addAttributesFromGroup $s vray_nurbscurve_renderable 1;
    evalDeferred("setAttr "+$s+".vrayNurbsCurveRenderable 1");
    evalDeferred("defaultNavigation -ce -source VRayMtl1 -destination "+$s+".vrayNurbsCurveMaterial");
    evalDeferred("setAttr "+$s+".vrayNurbsCurveTesselation 0.1");
    evalDeferred("setAttr "+$s+".vrayNurbsCurveStartWidth 1");
    evalDeferred("setAttr "+$s+".vrayNurbsCurveLockEndWidth 1");
    evalDeferred("setAttr "+$s+".vrayNurbsCurveEndWidth 1");
}

```

If you want to connect another material you can replace VRayMtl1 with something else.  
If you don’t want to change some attribute you can comment the line using two forward slashes ( ‘//’ ).

Good luck 🙂

---

<div class="post-metadata">

**Author:** ![naik](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@naik](https://forums.chaos.com/u/naik)\
**Post date:** [July 29, 2013, 2:30pm UTC](https://forums.chaos.com/t/renderable-spline-option/45859/10 "2013-07-29T14:30:04Z")

</div>

You are a genius petrov. Thanks a bunch for your support.  
It works perfectly…

I really appreciate it.

best regards

---

<div class="post-metadata">

**Author:** ![sharktacos](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sharktacos](https://forums.chaos.com/u/sharktacos)\
**Post date:** [August 15, 2013, 10:14pm UTC](https://forums.chaos.com/t/renderable-spline-option/45859/11 "2013-08-15T22:14:46Z")

</div>

I have the stable version of the nightlies installed, and this menu option is not there either. So it must be in the nightlies only.

I tried the above script, and while it works fine on a single curve, the more curves you have, the more warnings it spits out. The warnings seem to increase _exponentially_ in fact, based on the number of curves you are running it on. As I write this, it has been chugging away at 1000 curves for about two hours now with no end in sight. I need to make 10,000 curves renderable.

I am getting the warning  
`// Warning: line 1: 'vrayMtl1.outColor' is already connected to 'curvesShape1.vrayNurbsCurveMaterial'.`  
over and over for every curve, repeatedly.

I’m thinking the problem is perhaps with all the evalDeferred calls. Is there a faster way to do this besides just letting it run for days?

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [August 16, 2013, 6:07am UTC](https://forums.chaos.com/t/renderable-spline-option/45859/12 "2013-08-16T06:07:45Z")

</div>

It might be because of the evalDeferred() thing; perhaps a normal eval() will work fine…

Best regards,  
Vlado
