Procedural Primitives
|
Introduction
This tutorial provides an explanation of how a Blobby, generated by a procedural primitive
written in C, can be rendered so that its individual "blobs" are located at the vertices of a
polymesh. The reader should review the following tutorials,
How is a Blobby Specified?In RIB a Blobby consisting of 3 blobs would be specified as follows, Blobby 3 [1001 0 1001 16 1001 32 0 3 0 1 2] [1 0 0 0 0 1 0 0 0 0 1 0 -0.5 0.2 0.0 1 1 0 0 0 0 1 0 0 0 0 1 0 0.9 0.5 0.0 1 1 0 0 0 0 1 0 0 0 0 1 0 0.5 -0.5 0.0 1] [""] In the 'C' language a Blobby is specified as. RiBlobby ( RtInt num_blobs, RtInt total_num_codes, RtInt codes[], RtInt num_matrix_values, RtFloat matrix_values[], RtInt num_strings, RtString strings[], NULL); The diagram shown below, figure 2, illustrates the relationship between the sample values of the RIB version of a Blobby and their use with RiBlobby function. |
|
The Procedural Primitive Code
Open the PlaceBlobbyProc.cpp file and build the DSO using the keyboard shortcut Alt + e or Control + e.
The Python Code
Copy or move the pp_place_blobby.py script to either your Using the Scripts in Maya
Either use the Maya scene provided in the MayaPlaceBlobby.zip or follow these instructions.
In Maya's outliner choose, Display->Shapes.
Parent the RenderManProgram node to the torus.
In the outliner select the RenderManProgramShape shape node.
In the Attribute Editor for the
|
Create a float attribute named "
Connecting the Interface
As shown in figure 6 use the browse button for the DSO Name: and locate the PlaceBlobbyProc.dll or PlaceBlobbyProc.so
file.
|
import rfm2.api.strings as apistr; import pp_place_blobby; pp_place_blobby.setDataStr(apistr.expand_string("<shape>"))
Note the code must be pasted as a |
When the scene is rendered the line of code in the Because the vertices of the target object are evaluated before each frame is rendered the positions of the spheres are always "bound" to the shape of the polymesh. |
© 2002- Malcolm Kesson. All rights reserved.