Went through the tutorial on creating color variation through PrimVars
. Just a few tweaks to the original script so it works with 3Delight.




To summarise
1 Create a 2D Ramp Texture and name in this example “Leaf_ColorRamp”, put colors in to taste. Right Click and Break connection on UV Coords.





2. Select all the pieces of geometry and run mel script.
// select geometry pieces and run
// set up the primitive variables on the “leafs” by
// going through and adding the the attributes

The mel script creates a random unique color pulled in from the rampshader for each piece of geometry.






3. Create a RSL node in hypershade and connect o_outcolor to outcolor of surface shader. Download example.
rsl shading parameters
shader_input color SurfaceColor
output color o_outColor

shading code
o_outColor = SurfaceColor;

4. If Maya complains that Warning: line 1: Cannot add the following items to the set since the set has restrictions on membership

then select geo and run following.Obvs change ‘surfaceShader1SG_old’ to whateva the shading group is.

Leave a Reply

Your email address will not be published. Required fields are marked *