RfM
|
IntroductionThis page presents four scripts that enable the trajectories of particles to be baked as RenderMan curves - figure 1.
An interface shown in figure 2 offers a convenient way of controlling the attributes of the RiCurves that are written to disk.
|
Step 1Download and unzip the scripts.zip file. Copy the following three scripts to your maya/projects/RfM_mel directory. Refer to the tutorial "RfM: Customizing" for information about this directory. maya/projects/RfM_mel/ |_ particleCurves.rman |_ particleCurvesUI.mel |_ particleCurvesRI.mel Copy the general purpose python script to your maya/scripts directory. Ignore the script if you already have it. maya/scripts/ |_ maya_proj_utils.py Copy the specialized RenderMan python script to your maya/projects/RfM_python directory. maya/projects/RfM_python/ |_ particle_curves.py |
Step 3 - Generate the Rib Archives
In the Render Settings "Common" tab set a frame range, say, 1 to 50. This step does
not require any images to be rendered. Instead, the following command, executed in
the script editor (mel tab),
|
PROJECT_DIR/RIB_Archive/SCENE_NAME/PARTICLE_NAME/ |_ PARTICLE_NAME.0001.rib |_ PARTICLE_NAME.0002.rib |_ ditto |
About the Rib ArchivesA typical rib archive written by the particle_curves.py script is shown below. #bbox: -2.7820 3.5284 -3.4351 -1.4740 4.3510 -1.7830 AttributeBegin Attribute "dice" "hair" [1] Basis "catmull-rom" 1 "catmull-rom" 1 Attribute "user" "float probability" [0.8444] Curves "cubic" [6] "nonperiodic" "P" [ -2.782 4.229 -2.376 -2.782 4.229 -2.376 -2.555 3.981 -2.758 -2.329 3.735 -3.130 -2.143 3.528 -3.435 -2.143 3.528 -3.435] "width" [ 0.0200 0.0200 0.0200 0.0200 ] AttributeEnd The bounding box information, written as a comment, is used by the RenderMan archive node to draw a wire frame box in the Maya viewport. The python script adds a custom user attribute that assigns a random number in the range 0 to 1. This value can be used for specialized shading. The tutorial "RixPatterns: Stocastic Culling" demonstrates one possible use of the "probability" value that is assigned to each curve. |
© 2002- Malcolm Kesson. All rights reserved.