PDA

View Full Version : compound attributes


onesk8man
09-14-2006, 02:16 PM
Hi there,

I've a little problem creating an attribute. I'm just looking to create the same kind of input attribute of the plus/minus/average node (for instance) , that you can create a new attribute inputs just connecting something (float,double,int,etc)

plusMinusAverage.input1D[0]
plusMinusAverage.input1D[1]
plusMinusAverage.input1D[2]

If you ask the type of the attribute with `getAttr -type`, the answer is "TdataCompound". So, I'm trying with a compound attributes, but the attribute is not created until all the children are defined, so, it's different to the plus/min attribute!?

Someone knows how to create that?

Thanks!

_stev_
09-16-2006, 08:45 AM
The flag you're looking for is -m. Stands for multi.
addAttr -m -at double -ln "arrayOfStuff" null1;

now you can:

connectAttr locator1.tx null1.arrayOfStuff[0]
connectAttr locator1.ty null1.arrayOfStuff[1]
connectAttr locator1.tz null1.arrayOfStuff[2]


Stev

CGTalk Moderation
09-16-2006, 08:45 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.