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?

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to