Procedural Primitives
|
Introduction
This tutorial provides an explanation of how spheres can be rendered at the vertices of a
polymesh by the use of a procedural primitive written in C/C++. The reader should review
the tutorials,
The Procedural Primitive Code
Open the PlaceSpheresProc.cpp file and build the DSO using the keyboard shortcut Alt + e or Control + e.
The Python Code
Copy or move the pp_place_spheres.py script to either your Using the Scripts in Maya
Either use the Maya scene provided in the PlaceSpheres.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 PlaceSpheresProc.dll or PlaceSpheresProc.so
file.
|
import rfm2.api.strings as apistr; import pp_place_spheres; pp_place_spheres.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.