Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python Arnold SSS Set Name Command

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Anonymous
3984 Views, 8 Replies

Python Arnold SSS Set Name Command

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.

Tags (2)
8 REPLIES 8
Message 2 of 9
faline.custodio.da.silva
in reply to: Anonymous

@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

Message 3 of 9
Anonymous

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.

Message 4 of 9
Stephen.Blair
in reply to: Anonymous

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
Message 5 of 9
Anonymous
in reply to: Stephen.Blair

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 

Tags (1)
Message 6 of 9
Stephen.Blair
in reply to: Anonymous


@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
Message 7 of 9
Anonymous
in reply to: Stephen.Blair

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

 

🙂

Message 8 of 9
Anonymous
in reply to: Anonymous

 

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
in reply to: Anonymous

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.

Post to forums  

Autodesk Design & Make Report