Maya Standalone, PyMel and attribute accessibility

349 Views Asked by At

This problem in happening while using Maya Standalone in conjunction with PyMel. I am trying to load FBX files into Maya scenes, and assign Stingray PBS materials to them with connected file textures. I'm able to assign the Stingray materials, but the problems begin when I try to set or connect textures to attributes of these materials. Here is an example of an error I'm getting:

Command:
material_name = 'Asset_pbr'
pm.setAttr('{}.use_color_map'.format(material_name), True)

Result:
Maya Attribute does not exist (or is not unique):: u'Asset_pbr.use_color_map'

If I run the same passage of the script with the file open in Maya, it will work- most of the time it will work automatically, but in some instances before it works I will see this printed into the script editor first:

pymel.core : Updating pymel with pre-loaded plugins: svgFileTranslator, invertShape, mayaHIK ...

My guess is that while running Maya in Standalone, PyMel is not fully loaded, and for that reason I'm unable to gain access to the Stingray material attributes that should be there. What I'm looking for is a way where I can force PyMel to load everything it needs when the Standalone process begins in order to access and modify attributes for connecting textures to Stingray materials. Thanks in advance for any insights you can provide- I've been stumped for days.

0

There are 0 best solutions below