Square Enix © Goodbye Kansas

 

This page describes the various Extra V-Ray Attributes available in V-Ray for Maya and provides links to documentation for these features.

 

Overview


V-Ray for Maya provides a number of extra attributes for controlling various aspects of the scene and rendering process. These attributes enhance existing V-Ray scene elements by providing additional controls.

 

 

Scene Objects


 

 

Lights and Cameras


Materials and Shading


 

Misc.


 

 

Custom Attributes From Text Files


The extra prefix attributes are a set of three text (.txt) files containing key-value definitions, which can be used to add dynamic attributes to Maya, V-Ray or 3rd party nodes. The default set of files, which are shipped with the installation are located inside the scripts folder of the V-Ray for Maya installation. It is possible to supply a custom set of attribute files. V-Ray will use the paths, specified by the VRAY_FOR_MAYA_SHADERS environment variable to search for such custom files. The default attribute files can be used as an example but should not be modified.

The dynamic attributes appear in the Attributes menu of the Attribute Editor and can be added using this menu or by calling the available command: "vray addAttributesFromGroup".

The custom attribute files should have the following names:

# <prefix>_attributes.txt

Contains all dynamic attribute definitions. Each definition includes the attribute's label, its type, its group, its default value, its range of values, as well as other keys. One or more attributes belong to a group, which can then be assigned to a node. The <prefix> must be the same as all attributes' and groups' prefixes.

# <prefix>_attributeGroups.txt

Contains all attribute group definitions. Each definition includes its label and a list of existing attributes from <prefix>_attributes.txt. An attribute key format is "attribute_n", where n must be a consecutive number, starting from 0. The attribute groups can then be assigned to a node. The <prefix> must be the same as all attributes' and groups' prefixes.

# <prefix>_attributeNodes.txt

Contains node definitions, which link existing nodes to attribute groups. Each node definition is a list of existing groups from <prefix>_attributeGroups.txt. A group key format is "group_n", where n must be a consecutive number, starting from 0.

The word "vray" should not be used as a prefix, as it is a reserved word.

 

Keys defining attributes in <prefix>_attributes.txt


# label

The label of the attribute, which is shown in the UI, next to the attribute control.

# state

It can be either "optional" or "required". Attributes with specific states can be fetched with "vray getRequiredAttrs" and "vray getOptionalAttrs" commands.

# group

The name of the group as defined in <prefix>_attributeGroups.txt, to which the attribute belongs.

# subtype

The subtype of the attribute. Every decl type supports specific subtypes. For details see # decl.

- button: A button control.
- switch: A checkbox control.
- selector: An option menu control.
- slider: A slider control.
- materialConnection: A control for connecting materials.
- textureConnection: A control for connecting textures.
- file: A file text control with a browse button.
- buttonWide_cmd: A button, which executes a mel function. The function name should be assigned to the "default" key.
- text_label: A text label.
- separator: A separator with a text, specified by the "label" key.
- ctexture: Adds a shader connection button.
- cvector: Makes the attribute children x, y, z, instead of r, g, b.

# decl

The type of the attribute. It can have one of the following values:

- float - A floating point number. Supports button, switch, selector, textureConnection and slider subtypes. Defaults to slider.

- int - An integer number. Supports button, switch, selector, textureConnection and slider subtypes. Defaults to slider.

- bool - A boolean. Supports button, switch, selector, textureConnection and slider subtypes. Defaults to slider.

- distance - A floating point number. Supports button, switch, selector, textureConnection and slider subtypes. Defaults to slider.

- color - A color. Supports ctexture and cvector subtypes.

- float[3] - A triple float. Supports cvector, materialConnection and textureConnection sybtypes.

- string - A string. Supports selector, file, buttonWide_cmd, text_label and separator subtypes.

# range_min

The minimum value an attribute can have.

# range_max

The maximum value an attribute can have.

# rangesoft_min

A soft minimum limiting only the control UI.

# rangesoft_max

A soft maximum limiting only the control UI.

# range_step

The minimum value with which an attribute value can be changed.

# range_(n)

Used with selector subtypes, where n is a consecutive number starting from 0 to define a list of fixed possible values. The even n values (range_0, range_2, etc.) describe the item labels, while the odd ones describe the item values.

# default

The default value of the attribute.

# hidemap

When set to 1, the map button of the attribute control will not be shown.

 

Examples


Example of an attribute definition in an example someprefix_attributes.txt file:

Attribute someprefixCameraDistance {
  label = Distance
  state = optional
  group = someprefix_camera
  decl = float
  subtype = slider
  range_min = 0.0
  range_max = 1000.0
  rangesoft_min = 1.0
  rangesoft_max = 100.0
  range_step = 0.01
  default = 1.0
  hidemap = 1
}

 

Example of an attribute group definition in an example someprefix_attributeGroups.txt file:

AttributeGroup someprefix_camera {
  label = Camera
  attribute_0 = someprefixCameraDistance
}

 

Example of a definition, which links a node to a list of groups in an example someprefix_attributeNodes.txt file:

Node VRayMtl {
  group_0 = someprefix_camera
}