0

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.

bblack
  • 33
  • 2
  • 5
  • I should also add this. If I list the attributes of a Stingray material with Maya open I get 94 attributes returned to me, and among them I get this: [... u'TEX_normal_mapZ', u'use_color_map', u'TEX_color_map', .... ] Running the same query through logging (inside the Standalone script) it returns 36 attributes with the above excerpt not included. – bblack Dec 13 '20 at 22:49
  • How do you start maya standalone, do you use mayapy or mayabatch or maya with commandline script option? – haggi krey Dec 14 '20 at 10:28
  • I’m starting it as a subprocess using mayapy – bblack Dec 14 '20 at 12:51
  • I recommend to avoid using pymel in standalone. There are many reports that it's buggy in standalone. Why not use cmds like `cmds.setAttr(material_name + '.use_color_map', True)`? – ababak Dec 18 '20 at 10:31

0 Answers0