Quick reference for self
filesize [metadata input/filesize] compression [metadata exr/compressionName]
wip and stuff
Quick reference for self
filesize [metadata input/filesize] compression [metadata exr/compressionName]
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)): mybxdfs.append(x) if isinstance(x , ( pym.nodetypes.PxrMarschnerHair)): myhairs.append(x) if isinstance(x , (pym.nodetypes.PxrMatteID)): mymatteid.append(x) if len(mymatteid) == 1: for b in mybxdfs: mymatteid[0].resultAOV.connect(b.utilityPattern[0], force=True) for h in myhairs: mymatteid[0].resultAOV.connect(h.inputAOV, force=True) elif len(mymatteid) != 1: print 'too many PxrMatteID nodes selected, just try one'
Enjoy
In the Batch Render options. Two useful settings.
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 WorldBegin Sphere 100 -100 100 360 AttributeBegin # 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] AttributeEnd WorldEnd
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
shader Primvar[[ int rfm_nodeid = 110, string rfm_classification = "rendernode/RenderMan/pattern", string help = "Primvar" ]] ( string PrimvarName = "", output color OutColour = 0, output float OutFloat = 0 ) { color Cs; getattribute("primvar", PrimvarName, Cs); OutColour = Cs; OutFloat = Cs[0]; }
Then compile it from the commandline using the the following command..
oslc Primvar.osl
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.
Short example for creating atmospheric lighting effects in Renderman. Nuke makes an appearance at the end to do some relighting.
Also available in Youtube.
I’ve put up a thing about using Megascans with Renderman. A lot of the info in there is transferrable to other aspects of look-development.
Videos are also available on Youtube.
This got started from a question on the Renderman forums about the difference between ST and UV. Renderman uses UV and ST to differiate between “implicit” and “explicit” texture coordinates. Implicit is automatically defined by the geometric shape and explicit is manually defined by the user.
With polygons and subdivision geometry, Renderman uses ST coordinates for texture mapping (it converts Maya UVs to Renderman STs behind the scenes). But it also automatically assigns UV coordinates to each face on the geometry, you might ask why would you need this?
For fun and profit!
Useful if you ever want to better visualize data images.
Basic idea is to put the data in the red channel, normalize it between zero and one, then make sure the green and blue channel are both set to one and convert the colourspace from HSV to Linear.
Blackpoint and Whitepoint are set to the minimum and maximum samples from the render. Gain is set to 0.666667 so that the range is mapped from Red to Blue, rather than Red through to Red.