Python Arnold SSS Set Name Command

Python Arnold SSS Set Name Command

Anonymous
Not applicable
6,002 Views
8 Replies
Message 1 of 9

Python Arnold SSS Set Name Command

Anonymous
Not applicable

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.

0 Likes
Accepted solutions (1)
6,003 Views
8 Replies
Replies (8)
Message 2 of 9

faline.custodio.da.silva
Alumni
Alumni

@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.

 


Faline Custodio Da Silva

0 Likes
Message 3 of 9

Anonymous
Not applicable

SSS Set Name.JPG

 

 

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.

0 Likes
Message 4 of 9

Stephen.Blair
Community Manager
Community Manager
Accepted solution

SSS Set Name is a string. It doesn't create a set in Maya.

See https://support.solidangle.com/display/AFCUG/Sub-Surface+Scattering#Sub-SurfaceScattering-SSSBetween...

 

 

The attribute names is aiSssSetname



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 5 of 9

Anonymous
Not applicable

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 

0 Likes
Message 6 of 9

Stephen.Blair
Community Manager
Community Manager

@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.



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 7 of 9

Anonymous
Not applicable

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

 

🙂

0 Likes
Message 8 of 9

Anonymous
Not applicable

 

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

 

🙂

Message 9 of 9

Lindsey_Robbins
Advocate
Advocate

TYVM, this was driving me nuts, since the SSS set name doesn't show up in the attribute spread sheet. 

0 Likes