The following information relates to the following video.
Renderman has access to the following data on a Paint Effects stroke. The most useful one is Cs (colour).
data – how the data attaches to the geometry, varying and vertex both attach to vertices, uniform attaches to each face and constant attaches to the whole mesh
type – what type of data is it – color, float, point, vector, normal
name – name of the primvar
description – a brief description of what the data contains
[data] [type] [name] (description)
vertex normal N (surface normal)
varying float width (width of curve)
vertex float t (length along curve)
varying color Cs (color on curve
vertex point P (position along curve)
New video up on generating masks (mattes) in Renderman for Maya.
Here’s a quick script to connect up a single PxrMatteID node to many PxrMaterial nodes.
import pymel.core as pym
mynodes = pym.ls (sl=True, fl=True, dag=False, ni=True)
mybxdfs = 
myhairs = 
mymatteid = 
for x in mynodes:
if isinstance(x , (pym.nodetypes.PxrSurface, pym.nodetypes.PxrLayerSurface)):
if isinstance(x , ( pym.nodetypes.PxrMarschnerHair)):
if isinstance(x , (pym.nodetypes.PxrMatteID)):
if len(mymatteid) == 1:
for b in mybxdfs:
for h in myhairs:
elif len(mymatteid) != 1:
print 'too many PxrMatteID nodes selected, just try one'
Checkpoint Interval. First number is how often to save the file when rendering. Second is when to finish rendering. Here I’ve set it to save a copy every 30 minutes and don’t render any longer than 24 hours.
Renderer Arguments. This additional argument prints out the current memory and percentage of render complete. Handy to know where you are.
A video about setting up and using Renderman on the commandline.
The rib example for the OSL section below comes from a question by rheiland on the Pixar forum https://renderman.pixar.com/forum/showthread.php?s=&threadid=35595 Thank you, it’s a really simple and helpful example.
Copy and paste the first bit of code into a file called balls.rib
Display "foo" "it" "rgba"
Format 400 400 1
Projection "perspective" "fov" 25
Translate 0.0 0.0 2.75
Rotate -120 1 0 0
Sphere 100 -100 100 360
# this will use Pixar provided patterns
Pattern "PxrPrimvar" "MyPxrPrimvar" "string varname" ["Cs"] "string type" ["color"] "string coordsys" [""]
Bxdf "PxrDisney" "bxdf" "reference color baseColor" ["MyPxrPrimvar:resultRGB"]
# uncomment the next two lines to use a custom OSL pattern
#Pattern "Primvar" "CustomPrimvar" "string PrimvarName" ["Cs"]
#Bxdf "PxrDisney" "bxdf" "reference color baseColor" ["CustomPrimvar:OutColour"]
# This creates 4 fours, each of different sizes and colours.
Points "P" [-0.5 0 0.0 -0.3 0 0 0.3 0 0 0.5 0 0 ]
"width" [0.10 0.12 0.14 0.16]
"varying color Cs" [1 0 0 0 1 0 0 0 1 1 1 0]
Switch to commandline and use this following command.
prman -d it -t:-2 balls.rib
You should get the following image.
To use the OSL. Copy/paste the following text into a file called Primvar.osl
Then compile it from the commandline using the the following command..
Copy the resulting Primvar.oso file into the same directory as your rib file, adjust the comments in there are try again. You should get the same image, you’ve just done it using your own OSL code which you can modify to do other things.