Hi ChaosGroup Forum
I'm trying to write a script that adds a vrayobjectproperties node to a selection and renames it, and I am stuck.
I have some code that I just stole out of the script editor that creates the node with the right geo in it, and everything. So this far it works fine.
The problem arises when I want to name this property node something. Its default name is vrayobjectproperties node.
I could in theory cheat and write:
cmds.rename('vrayobjectproperties','Example_Proper ties')
- or something similar.
but depending on which scene in run the script in, the node I create are named different from default.
like if I run it in a scene were a objectproperties node has been created before, the node that the script creates is called vrayobjectproperties1 - and then the rename function breaks.
this is my code so far.
if cmds.ls( "Example_GRP") != '':
cmds.select('Example_GEO')
mm.eval('vray objectProperties add_single;')
mm.eval('vrayCreateVRaySettingsNode;')
I would love some help.
Thank you in advance .
I'm trying to write a script that adds a vrayobjectproperties node to a selection and renames it, and I am stuck.
I have some code that I just stole out of the script editor that creates the node with the right geo in it, and everything. So this far it works fine.
The problem arises when I want to name this property node something. Its default name is vrayobjectproperties node.
I could in theory cheat and write:
cmds.rename('vrayobjectproperties','Example_Proper ties')
- or something similar.
but depending on which scene in run the script in, the node I create are named different from default.
like if I run it in a scene were a objectproperties node has been created before, the node that the script creates is called vrayobjectproperties1 - and then the rename function breaks.
this is my code so far.
if cmds.ls( "Example_GRP") != '':
cmds.select('Example_GEO')
mm.eval('vray objectProperties add_single;')
mm.eval('vrayCreateVRaySettingsNode;')
I would love some help.
Thank you in advance .
Comment