Primitive Variables are a really cool way to get variation in Renderman Shading Networks. As it requires adding Attributes to your Shape Nodes within Maya to control the variation it can be quite time consuming to set it up. So I was trying an attempt to build an interface that helps a bit with the set up.The GUI let’s you choose a name, the PrimVar type and min/max values of which it will randomly pick floating point numbers within that range. It is also possible to just use integers with the according checkbox. The GUI is far from being pretty or well organized, but it does the job. :)
As I am a bit short on time however I just had the time to properly make use of Float PrimVars as that’s what I need for a current project I’m doing. As with all my scripts they are not written very well, but should be kind of readable. So feel free to modify it as needed. I hope I will find the time soon to make the other types work properly.
So for example using 3 PrimVars with just one shader on all objects results in loads of variation… Which is always a good thing :)
Additionally as you can see there is also an “Object ID” part in the GUI. It let’s you add integer PrimVars with increasing values for each object. At the same time it will add an AOV with the same name like the primvar (of course this custom AOV has to be set up in Slim beforehand).
An alternative approach to making Object ID’s would be having distinct floating point values for each object. So the value that get’s assigned by the script corresponds to the value that is being rendered within the Object ID AOV. For example object 3, that has the Object ID primvar value of 3 assigned has a value of 3,3,3,3 for RGBA. The good part is that it is very easy to set up, but one may run into aliasing issues when dealing with very thin geometry for example. To make use of this technique I also prepared a Nuke Gizmo that handles these kind of Object ID’s and has a slider to separate them.
Also here’s a quick demo:
Simple PrimVar Helper Script from Julius Ihle on Vimeo.
So hopefully I will find some time to complete the script, but for now if anyone’s interested feel free to grab it from HERE.
Comments
is it possible to recover the finished scene of the video?
Thank you in advance.
What exactly do you mean? The video was just to show a practical example use of the script. :)
I’m trying to educate myself on renderman and I’d like to see how your shader is designed in SLIM that interested me.
So I would only get the finished scene you use for video.
Thank you in advance.
I do not understand the implementation level IDpass to make it work in nuke with your gizmo.
thank you for your help.
Ah I see, sorry for my misunderstanding! Feel free to play around with the scene (updated for RMS18):
https://dl.dropboxusercontent.com/u/61656717/primvar_test_v004.mb
For learning I’d recommend looking through the Renderman Docs and the Uni pages. Here’s a nice example on making that explains an example concept of creating ID’s in RMS:
http://renderman.pixar.com/view/outputting-index-passes
If there’s anything left un-answered just let me know :)
Hey ! Very nice job with this scrip. It’s working for me, but …. I don’t know how to use that in Nuke !
Is it possible to have your guizmo or more détails ?
Thanks for the kind words. The nuke gizmo is hidden in the text, I maybe have to highlight it a bit better :) Here’s a direct link: http://53035544.de.strato-hosting.eu/data/ObjectID.gizmo
Have fun!