atap3d
01-16-2009, 10:24 AM
Hi
I'm trying to write maya node
I have a very simple code
MStatus myMayaTest::initialize()
{
............
MFnTypedAttribute strAttr;
str = strAttr.create("str", "s", MFnData::kString, &stat);
strAttr.setStorable(true);
MFnNumericAttribute numAttr;
dig = numAttr.create("dig", "d", MFnNumericData::kDouble, 1.0, &stat);
numAttr.setStorable(true);
MFnCompoundAttribute cmpAttr;
grp = cmpAttr.create("grp", "g", &stat);
cmpAttr.setArray(true);
cmpAttr.addChild(str);
cmpAttr.addChild(dig);
addAttribute(grp);
............
}
after a successful compilation and creation node in Maya 2009, the attribute-editor looks like this
http://img440.imageshack.us/img440/2006/firstob5.jpg
after clicking "Add New Item" button Maya reported error
http://img174.imageshack.us/img174/4972/thridwv5.jpg
http://img174.imageshack.us/img174/2219/secondil3.jpg
I try to comment string cmpAttr.setArray(true); and compile source.
MStatus myMayaTest::initialize()
{
............
//cmpAttr.setArray(true);
............
}
my node looks like this
http://img66.imageshack.us/img66/8875/78107935tx4.jpg
it is impossible to enter anything in "dig"
I checked it in Leopard and Windows
after a successful compilation and creation node in Maya 2008, the attribute-editor looks like this
http://img58.imageshack.us/img58/9797/63063568tv8.jpg
the "Add New Item" button successfully pressed, but the new attributes is gray. it is impossible to enter anything. And what is the "map" button?
Please help me to make a correct Array of CompoundAttribute with an opportunity to enter the parameters
I'm trying to write maya node
I have a very simple code
MStatus myMayaTest::initialize()
{
............
MFnTypedAttribute strAttr;
str = strAttr.create("str", "s", MFnData::kString, &stat);
strAttr.setStorable(true);
MFnNumericAttribute numAttr;
dig = numAttr.create("dig", "d", MFnNumericData::kDouble, 1.0, &stat);
numAttr.setStorable(true);
MFnCompoundAttribute cmpAttr;
grp = cmpAttr.create("grp", "g", &stat);
cmpAttr.setArray(true);
cmpAttr.addChild(str);
cmpAttr.addChild(dig);
addAttribute(grp);
............
}
after a successful compilation and creation node in Maya 2009, the attribute-editor looks like this
http://img440.imageshack.us/img440/2006/firstob5.jpg
after clicking "Add New Item" button Maya reported error
http://img174.imageshack.us/img174/4972/thridwv5.jpg
http://img174.imageshack.us/img174/2219/secondil3.jpg
I try to comment string cmpAttr.setArray(true); and compile source.
MStatus myMayaTest::initialize()
{
............
//cmpAttr.setArray(true);
............
}
my node looks like this
http://img66.imageshack.us/img66/8875/78107935tx4.jpg
it is impossible to enter anything in "dig"
I checked it in Leopard and Windows
after a successful compilation and creation node in Maya 2008, the attribute-editor looks like this
http://img58.imageshack.us/img58/9797/63063568tv8.jpg
the "Add New Item" button successfully pressed, but the new attributes is gray. it is impossible to enter anything. And what is the "map" button?
Please help me to make a correct Array of CompoundAttribute with an opportunity to enter the parameters
