Di Wang
Di Wang

Reputation: 481

Maya Python command for adding Vray Attribute

I tried to automate the process to add a Vray Attribute (Object ID) to an Object in Maya.

I captured the commands in the Script Editor:

vray addAttributesFromGroup |Object vray_objectID 1;
vrayAddAttr |Object vraySeparator_vray_objectID; 
vrayAddAttr |Object vrayObjectID;

I am very confused, and don't know which command to use, and how to translate that into Python command.

Thanks for any suggestions.

enter image description here

Upvotes: 0

Views: 2286

Answers (1)

Achayan
Achayan

Reputation: 5885

You can simply use normal command to do this I think. for example

import maya.cmds as cmds

nodesToAdd = cmds.ls(sl=1, dag=True, shapes=True, long=True)
for node in nodesToAdd:
    cmds.vray("addAttributesFromGroup", node, "vray_objectID", 1)

Upvotes: 2

Related Questions