Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / How to get length of attribute array?
  RSS 2.0 ATOM  

How to get length of attribute array?
Rate this thread
 
62982
 
Permlink of this thread  
avatar
  • blackears
  • Posted: 20 December 2011 08:04 AM
  • Total Posts: 13
  • Joined: 29 October 2011 04:29 PM

I’m trying to programmatically create a shader that uses a layeredTexture for it’s color input.  The layered texture has an inputs attribute which is an array that accepts other textures as inputs.  I’m trying to figure out how to append multiple input textures to this attribute.

If I create a new layered texture node and execute:

attributeQuery -numberOfChildren -node layeredTexture1 inputs

it returns 4, even though it has zero inputs.  What’s the right way to query the size of this attribute array?

Also, why won’t this work?

connectAttr -f file1.outColor layeredTexture1[0].inputs.color


Replies: 0