marcin
unread,Jan 11, 2012, 5:53:45 PM1/11/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to maya_he3d
Hi!
I've problem with setting compound attribute in Maya API. I have a
node with following attributes:
MFnCompoundAttribute cAttr;
MFnTypedAttribute tAttr;
aMainChildArrayAttr = tAttr.create( "mainChildArrayAttr", "skp",
MFnPointArrayData::kPointArray);
tAttr.setStorable(true);
tAttr.setWritable(true);
tAttr.setReadable(true);
aMainChildAttr= cAttr.create("mainChildAttr", "mca");
cAttr.addChild(aMainChildArrayAttr);
cAttr.setArray(true);
cAttr.setReadable(true);
cAttr.setWritable(true);
aMainAttr = cAttr.create("mainAttr", "mnt");
cAttr.addChild(aMainChildAttr);
cAttr.setArray(true);
cAttr.setReadable(true);
cAttr.setWritable(true);
I've compound array attribute mainAttr (array) that have compound
attribute mainChildAttr (array). MainChildAttr is a compound attribute
for mainChildArrayAttr. I need MPxCommand that allow me to set those
attributes.
In Mel I can set this attributes using following command:
setAttr myNode.mainAttr[0].mainChildAttr[0].mainChildArrayAttr -type
pointArray 1 1 2 3 1
In MPxCommand I can set attributes using only MPlug, but I don't know
how can I set nested compound attributes using MPlug setValue method.
I can't use arrayBuilder because it's available only when creating
MPxNode. How I should set this attribute using API ? I think I can use
executeCommand with proper mel command in it, but maybe there's better
method to do this ?
Thanks in advance,
Marcin