Skip to content

vray objectProperties

Roy Nieterau edited this page Dec 7, 2013 · 12 revisions

Allows to create and remove object properties to nodes.

vray("objectProperties", subCommand, type, *args)

This command is used a lot by the create>Vray menu in Maya's main menu bar.

It's used in the Object Properties, Mesh Lights, V-Ray Fur, V-Ray Displacement, V-Ray Renderable Curve submenus.

The command always operates on the current selected nodes.

The command does NOT return the created/deleted nodes and you can not specify a direct name. A way to work around this is to get the connected sets before running the command and then after the command to get the new/removed sets. You can then use this information to do your operation on the new nodes.

###Flags

######subcommand

The subCommand flag supports the following string values:

  1. add_single: Apply single object properties node to selection

  2. add_multiple: Apply multiple object properties nodes to selection

  3. remove: Remove object properties from selection

  4. remove_sub: Remove object properties from selection and sub-hierarchy

  5. assign_existing: Assigns an existing object properties to selection. (uses *args for the node's name)

######type

The type flag is optional, without it it will create simple object properties. Though you can also specify the following types:

  1. None (as in: leave it out) (default: Object properties)

  2. VRayLightMesh

  3. VRayFur

  4. VRayDisplacement

  5. VRayRenderableCurve

  6. VRayBakeOptions

######*args

Some subcommands can have optional data arguments, thus extra *args.

Known list:

  • assign_existing uses the first argument in *args as the name of the node that should be assigned.

mc.vray("objectProperties", "assign_existing", "VRayObjectProperties", "myObjectPropertiesName")

Example

To apply a single object properties to your current selection:

mc.vray("objectProperties", "add_single")

To apply multiple VRayDisplacement object properties to your current selection (one per node in selection):

mc.vray("objectProperties", "add_multi", "VRayDisplacement")

Errors

If you use add_single or add_multiple with an invalid type you will get the following error:

# Error: line 1: The source attribute '.outConnect' cannot be found. #

On the other hand using remove or remove_sub on an invalid/unknown type will not raise any error.

Clone this wiki locally