StingrayPBS shadingNode attributes not initialized?


#1

Hi, I’m trying to create a StingrayPBS and edit the “use_color_map” attribute right after.


import maya.cmds as cmds



def createShader(shaderType='StingrayPBS', name=''):
    if name == '':
        name = shaderType
    
    print(shaderType)
    print(name)
    shader = cmds.shadingNode(shaderType, asShader=True,  name=name)
    sg = cmds.sets(renderable=True, noSurfaceShader=True, name='%sSG'%(name))
    

createShader(name="test")
print(cmds.attributeQuery( 'use_color_map', node='test', exists=True ))

But for some reason , that always print “False”, and if I execute the code one more time (and it creates a “test1” shadingNode) it returns true.

Is StingrayPBS created on a different thread?

How can I wait for the process to be completed before trying to assign an attribute?

Thanks.