an arnold plugin for massive software rendering


inside massive
  • active renderpass must be set to prman
  • sim ribs option must be set to DynamicLoad
  • shaders and shader conventions
On each provided Ai* dummy shader, there is one parameter_filename slot for each RGB parameter to plug texture images.

There is a magic opaquePolymesh shader parameter that will pass the value to all polymeshes' opaque parameter to which the shader is assigned. All you need to do is set the parameter inside the cdl as noted below.
Another magic parameter called catClarkLoops, this time inside the displacement line, sets the exact catclark loops for each of the polymesh nodes to which the shader is assigned. Massive's subdiv button shouldn't be used, use this workaround instead.
Also, if there's a Kt_filename present or Kt's value is grater than 0, the opaque bit will be set to 0 on all polymeshes using that shader. 

cdl example
material head
id 2
ambient 0.5 0 0 hsv
diffuse 0.5 0 Value hsv
specular 0.5 0 1 hsv
specular_roughness 0.02
colour_map ../maps/colour/head_color_'headmap'.tif
shader 1 "renderpass_PRMan" "Aistandard" "Ks" [0.15] "Kd" [0.8] "Ka" [0.5] "specular_roughness" [1] "Kd_color_filename" ["../maps/shader_maps/prman/colour/head_color_'headmap'.tex"]
displacement 1 "renderpass_PRMan" "AiDisplacement" "disp_padding" [1] "disp_height" [1] "disp_zero_value" [0.5] "disp_autobump" [1] "disp_map" ["../maps/shader_maps/prman/disp/head_disp_'headmap'.tex"]
displ_bounds 1 "renderpass_PRMan" 0.2

material cap
id 3
ambient 0.5 0 0 hsv
diffuse 0.5 0 Value hsv
specular 0.5 0 1 hsv
specular_roughness 0.02
colour_map ../maps/colour/cap_color_'capmap'.tif
shader 1 "renderpass_PRMan" "Aistandard" "Ks" [0.15] "Kd" [0.8] "Ka" [0.5] "specular_roughness" [1] "Kd_color_filename" ["../maps/shader_maps/prman/colour/cap_color_'capmap'.tex"]
displacement 1 "renderpass_PRMan" "Aibump2d" "bump_height" [0.25] "bump_map" ["../maps/shader_maps/prman/disp/cap_disp_'capmap'.tex"] "catClarkLoops" [3]

displ_bounds 1 "renderpass_PRMan" 0.2
inside arnold
to use it, just declare a procedural like this
   AtNode *arnoldMassive = AiNode("procedural");
   AiNodeSetStr(arnoldMassive, "name", "your_name_goes_here");
   AiNodeSetStr(arnoldMassive, "dso", "");
   AiNodeSetBool(arnoldMassive, "load_at_init", true);
   AiNodeDeclare(arnoldMassive, "arnoldMassive_ribFile", "constant STRING");
   AiNodeSetStr(arnoldMassive, "arnoldMassive_ribFile", "/path/to/prman/ribs/ribfile.rib");

// arnoldMassive_ribFile: note that these are NOT ribArchive files, 
// but the ones called inside massive's

   AiNodeDeclare(arnoldMassive, "arnoldMassive_ribFolder", "constant STRING");
   AiNodeSetStr(arnoldMassive, "arnoldMassive_ribFolder", "/path/to/prman/ribArchiveFiles");
// arnoldMassive_ribFolder is an optional (altough recommended) parameter
// to specify the path to the folder containg ribArchive files

   AiNodeDeclare(arnoldMassive, "arnoldMassive_shaderOverride", "constant STRING");
   AiNodeSetStr(arnoldMassive, "arnoldMassive_shaderOverride", newshader);

// shaderOverride will override each geometry shader with 
// the one specified here

Since massive's DSO is not thread safe, a copy-and-load procedure is performed in order to support arnold's procedural multithreading support. Although this is done without need for any interaction by the user, you might want to set MASSIVEDSOTMPDIR variable (on gnu/linux) or TMPDIR variable on windows to make the massive DSO duplicate files go on that specific folder. Otherwise, the plugin will try to store them on your machine's temp folder.

gnu/linux - windows coexistence
In case of needing to switch between gnu/linux and windows, you can use the following parameters inside the RibReader Node

You can of course use this simply to change paths using only the PATH ones 

hiding agents
If you need to get rid of some specific agents, just add a string variable called arnoldMassive_agentIgnoreand set its value to the agent numbers ( separated by "," ) to be ignored