Hey guys,
I want to write a Python script to add objects to a certain SSS Set Name but the Python command doesn't show up in the editor and I can't find any documentation for the command. Does anyone know how to do it?
Cheers,
David.
Solved! Go to Solution.
Solved by Stephen.Blair. Go to Solution.
@Anonymous
cmds.select( 'spinning_ball', r=True )
cmds.rename( 'sphere1' )
replace 'spinning_ball' with the name of your node and 'sphere1' with what you want to name it.
No am not trying to rename something. I am trying to set an attribute. Specifically a certain Arnold attribute. Unfortunately the Script Editor only echos attributes with a MEL command. However it does seem to echo some Arnold commands too. This is called a Set Name but when assigning a set name to an object it doesn't actually create a set new set in the outliner so I am at a loss as to how to script this.
Cheers,
David.
SSS Set Name is a string. It doesn't create a set in Maya.
The attribute names is aiSssSetname
Hi everybody,
I'm having the same problem ... I'm trying to set the "SSS Set Name" attribute ... and with this script I'm able to get its value:
import maya cmds as cmds
sel = cmds.ls (sl=True)
cmds.getAttr (sel[0] + ".aiSssSetname")
but I'm not able to SET its value with this script:
cmds.setAttr (sel[0] + ".aiSssSetname", "share_SSS")
It gives me this error:
setAttr: 'pSphereShape1.aiSssSetname' is not a simple numeric attribute. Its values must be set with a -type flag.
Do somebody knows which is that flag ???
Thanks
@Anonymous wrote:
Hi everybody,
I'm having the same problem ... I'm trying to set the "SSS Set Name" attribute ... and with this script I'm able to get its value:
import maya cmds as cmds
sel = cmds.ls (sl=True)
cmds.getAttr (sel[0] + ".aiSssSetname")
but I'm not able to SET its value with this script:
cmds.setAttr (sel[0] + ".aiSssSetname", "share_SSS")
It gives me this error:
setAttr: 'pSphereShape1.aiSssSetname' is not a simple numeric attribute. Its values must be set with a -type flag.
Do somebody knows which is that flag ???
Thanks
Check the setAttr documentation.
Ok finally I got it !!! ... Thank you Stephen
to SET that attribute:
import maya.cmds as cmds
sel = cmds.ls (sl=True)
for each in sel:
cmds.setAttr (each + "aiSssSetname", "share_SSS", type="string")
where "share_SSS" is the new value
🙂
Sorry , I forgot one dot ...:
import maya.cmds as cmds
sel = cmds.ls (sl=True)
for each in sel:
cmds.setAttr (each + ".aiSssSetname", "share_SSS", type="string")
where "share_SSS" is the new value
🙂
TYVM, this was driving me nuts, since the SSS set name doesn't show up in the attribute spread sheet.
Can't find what you're looking for? Ask the community or share your knowledge.