[Maya-Python] input and output attrs as children under the same compound array?

26 views
Skip to first unread message

Emre Yilmaz

unread,
May 20, 2012, 2:37:31 AM5/20/12
to python_in...@googlegroups.com
Is there any gotcha with putting input and output attributes as children under the same compound array?

Details:
I have a node with a compound array attribute.  For each item I'm handling, I get input data and compute an output.  I've usually structured these cases like this:

Input data:
  itemsInputCompound[0].inputFloat
  itemsInputCompound[1].inputFloat
  itemsInputCompound[2].inputFloat
  ...
Output data:
  itemsOutputCompound[0].outputFloat
  itemsOutputCompound[1].outputFloat
  itemsOutputCompound[2].outputFloat
  ...

But, I was wondering, is there any reason not to structure it like this-- collecting both input and output under the same compound attribute-- just to avoid having to keep input indices and output indices in sync?

Input and output data:
  itemsCompound[0].inputFloat
  itemsCompound[0].outputFloat
  itemsCompound[1].inputFloat
  itemsCompound[1].outputFloat
  itemsCompound[2].inputFloat
  itemsCompound[2].outputFloat
  ...

I just tried it in a test node and it appears to work, as long as attributeAffects and the "check which plug is being requested in the compute" test are appropriate.  So I think it's at least legal.  But I wanted to check, is there some dark side of doing this, that I'm not seeing?


Reply all
Reply to author
Forward
0 new messages