Cortex and RMS 20.2

41 views
Skip to first unread message

Hradec

unread,
Apr 20, 2016, 3:56:19 AM4/20/16
to cortexdev
So... I'm trying to use cortex procedurals with RMS 20.2. After a simple patch in cortex (prman 20.2 doesnt have RiProceduralV, so I just patch it to use RiProcedural for now), I got IECoreRI building fine! 

The problem is in maya. I cortex  procedural node in maya, but when I render using renderman, the procedural is not being exported to the rib. 

I get no error's or anything. I can see the attributeBeing/End section for the node, but no Procedural call in it. 

Have any of you guys ever tried running cortex in maya with RMS?

here is a rib archive of the procedural:

##RenderMan RIB
#Created by RenderMan for Maya 20.2 (@1521997 Aug 25 2015)
#Wed Apr 20 12:52:20 AM PDT 2016
#bbox: -13.51105881 -2.535037577 -13.51110744 13.51109219 10.30395931 13.45505619
version 3.04
ScopedCoordinateSystem "world_ref"
AttributeBegin
Attribute "identifier" "string name" ["generic"]
Attribute "identifier" "float id" [3]
ConcatTransform [ 1 0 0 0  0 1 0 0  0 0 1 0  0 3.24274 0 1 ]
AttributeBegin
AttributeBegin
Attribute "identifier" "string name" ["genericShape"]
Attribute "identifier" "float id" [8]
Sides 2
ShadingInterpolation "smooth"
Attribute "user" "int receivesShadows" [1]
Attribute "visibility" "int camera" [1] "int specular" [0] "int diffuse" [0] "int transmission" [1]
Attribute "shade" "string transmissionhitmode" ["shader"]
Attribute "grouping" "string membership" ["+shadow"]
##RLF Inject SurfaceShading -attribute sets@,initialShadingGroup,
AttributeEnd
AttributeEnd
AttributeEnd

Hradec

unread,
Apr 20, 2016, 5:21:23 AM4/20/16
to cortexdev
Ok... I've dug a bit more and I notice that there's no code in Cortex to tell RMS to export an ieProceduralHolder node.

The way RMS works is by executing whatever mel code is defined in an .rman__torattr___preShapeScript string attribute found in the node.

So, I need to define a generic mel function that serializes the node parameters  as a string to be passed  as args to the RMS mel command, like this:

   RiProcedural "DynamicLoad" "iePython.so" $bbMin[0] $bbMax[0] $bbMin[1] $bbMax[1] $bbMin[2] $bbMax[2] $ags

were $args is the serialized parameters string. 

Could you guys point me how to generate the args string in cortex? (I known cortex has the code to do that, but I can't remember how!)

Also, I need 2 more things:

   1. where should I drop this mel code to be sourced by maya when cortex is loaded?
   2. Where can I hook up some initialization code for ieProceduralHolder to automatically create the .rman__torattr___preShapeScript that calls the export mel code?

sorry guys... its being a while since I code for cortex and I can't remember where things should go!!

cheers...
-H

john haddon

unread,
Apr 20, 2016, 11:41:24 AM4/20/16
to cortexdev
Hi Hradec, welcome back!

Support for RMS would be a great contribution - let's see what we can figure out.

Could you guys point me how to generate the args string in cortex? (I known cortex has the code to do that, but I can't remember how!)

It might be a bit confusing to follow, because the 3delight exporters are more complex than the RMS ones and it's all in C++, but for reference here's the equivalent code for 3dfm :


What might be more directly illuminating though is this line from the RenderManRender node in Gaffer :


   1. where should I drop this mel code to be sourced by maya when cortex is loaded?

You can put it in a new file called "mel/IECoreMaya/ieRMS.mel", and then make sure that is sourced by "mel/IECoreMaya/IECoreMaya.mel".
 
   2. Where can I hook up some initialization code for ieProceduralHolder to automatically create the .rman__torattr___preShapeScript that calls the export mel code?
 
How about just putting it in the ProceduralHolder constructor, in "src/IECoreMaya/ProceduralHolder.cpp"? Since it's just a string attribute, it doesn't sound like it will introduce a dependency on RMS, or otherwise get in anyone's way.

sorry guys... its being a while since I code for cortex and I can't remember where things should go!!

No need for apologies - it's great that you're looking at this stuff. We haven't built against PRMan for a long time, and my impression is that 3delight and PRMan have been steadily diverging, so do let us know if you hit any problems with IECoreRI.

Cheers…
John 
Reply all
Reply to author
Forward
0 new messages