Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
width62%

The VRayUserColor texture can be used to read User-Defined object properties from the currently shaded node and convert them to a color value. This allows you to use the same shading network on several different objects in the scene, but to control various aspects of the material through User-Defined properties. This texture also has the ability to read mesh color sets, UV sets, and extra channel information from VRayProxy File Formats objects, as well as additional data channels from other plugins like Yeti.

The Example on the right uses a VRayUserColor node to control the diffuse value on a single V-Ray Material. The four different pieces of the shader ball have a VRayUserAttribute that dictates different values.

 

UI Expand
titleUI Path: ||Hypershade|| > Create panel > VRay section > Utilities > VRay User Color

Image RemovedImage Added

Column
width5%

 

Column
width33%

...

Example: Animated Custom Color Attribute

 

Section
Column
width55%

A VRayUserColor texture can control VRayMtl color parameters by a user attribute in an animation. A user attribute is assigned to an object with the help of scripting.

For this example, use MEL scripting to create a custom attribute of type float3, called myColor with a vrayUserColor_ prefix. The type float 3 means that this attribute holds 3 float values.

Code Block
addAttr -ln "vrayUserColor_myColor" -at float3 -keyable true -uac pSphere1;

Add three float attributes: one for each R, G and B color component. Make them children of the float3 attribute.

Code Block
addAttr -ln "vrayUserColor_myColorR" -at "float" -keyable true -p vrayUserColor_myColor pSphere1;
addAttr -ln "vrayUserColor_myColorG" -at "float" -keyable true -p vrayUserColor_myColor pSphere1;
addAttr -ln "vrayUserColor_myColorB" -at "float" -keyable true -p vrayUserColor_myColor pSphere1;
UI Text Box
typetip

This setup can be used on multiple objects sharing the same shader by simply modifying and re-using the script for other objects.

Column
width5%
 
Column
width40%

...