How to Render Paint Effects With RenderMan

Earlyworm CG Puts Renderman Together With Paint Effects Using a Simple Free Script.

Maya has no shortage of methods to create things like grass. You have your choice of xGen, MASH, painting instances, and even the old standby, paint effects. Being that Paint Effects is older technology (although still quite useful) a lot of render engines don’t support it right out of the Pfx Brush. You have the option to convert strokes to polygons, but if you want to keep the procedural capabilities of pfx, and use something like Renderman, there is another way, as shown by Earlyworm CG, with the help of a little scripting.

“Renderman 22 is pretty fast at rendering curves, and paint effects are the forgotten gem in Maya’s toolbox,” Earlyworm writes. Renderman has access to a bunch of data when it comes to Paint Effects strokes. The most useful one is Cs (color). Renderman also has access to data, type, name, and description, too. All of these you can use with Renderman’s PxPrimvar or PxrVariable. Check out this simple script Earlyworm CG made that helps to assign Renderman materials to Paint Effects strokes in Maya. To use is simple, select paint strokes and then the PxrSurface you wish to use and run the code.

import pymel.core as pym

mypaintfx = pym.ls (sl=True, fl=True, dag=True, ni=False, type="stroke")
mypxrsurface = pym.ls (sl=True, fl=True, dag=False, ni=False, type="PxrSurface")

myconnection = pym.listConnections('%s.outColor' % str (mypxrsurface[0]))

for x in mypaintfx:
    pym.connectAttr( '%s.message' % str(myconnection[0]), '%s.rman__torattr___customShadingGroup' % x, force=True )