Hi guys.. so I am trying to make a compound attribute for a custom locator node. The node has a lot of draw options that I want to put in their own compound attribute so that when you are editing the nodes other attrs, you dont have to sift thru the 20 some odd draw options. here is a code snippet..
testDisplayOptions = numFn.create( "testDipOpt", "tdo", MFnNumericData::kBoolean );
numFn.setKeyable( true );
numFn.setDefault( 1 );
numFn.setHidden(false);
tdisplayOptions = numFn.create( "testDipOptt", "tdto", MFnNumericData::kBoolean );
numFn.setKeyable( true );
numFn.setDefault( 1 );
numFn.setHidden(false);
MFnCompoundAttribute cmpAttr;
displayOptions = cmpAttr.create("displayOptionsO", "doo", &stat);
cmpAttr.setArray(false);
stat = cmpAttr.addChild(testDisplayOptions);
if (!stat) { stat.perror("cmpAttr.addChild testDisplayOptions"); return stat;}
stat = cmpAttr.addChild(tdisplayOptions);
if (!stat) { stat.perror("cmpAttr.addChild tdisplayOptions"); return stat;}
cmpAttr.setReadable(true);
cmpAttr.setHidden(false);
cmpAttr.setUsesArrayDataBuilder(false);
addAttribute(displayOptions);
The node compiles fine, it initializes fine in maya and everything seems to be there. The problem is when I go to click on the little arrow in the attr editor to display all the attrs in the extra attributes section, I get this error..
// Error: ...AEnewBooleanGroup { "facialRiggingLocator1.testDipOpt", "facialRiggingLocator1.testDipOptt" } { "Test Dip Opt", "Test Dip Optt" //
// Error: Line 1.131: Syntax error //
// Error: TPSdatabase::createAddControlUI: could not create control for attribute displayOptionsO //
If I comment out either one of the addChild lines like the ones below..
stat = cmpAttr.addChild(tdisplayOptions);
if (!stat) { stat.perror("cmpAttr.addChild tdisplayOptions"); return stat;}
the plugin displays just fine in the attr editor.. sut obviously only has one attribute listed under the "displayOptions" compound attribute.
This is maya 2009 64bit