MEL / C++ API
Hi!
I'm doin' a plug-in for meshes in Maya in C++, and i´ve got a question:
In Maya modelling i can add a new attribute to one object with MEL commands:
select pPlaneShape1;
addAttr - ln " paintAttr" - dataType " doubleArray" ;
I can add a paintable attribute to "paintAttr" with this instruction:
makePaintable " mesh" " paintAttr" ;
In this way i can give different values to " painAttr", using the paintable brush of Maya, in the mesh.
My problem is to access these values through the API C++. I tried some functions but I did not obtain the desired result.
With the functions of MFnMesh i tried:
MFnMesh fnMesh (dagPath);
MObjectArray atrraf;
MObject o;
MString test = MString (" paintAttr");
o = fnMesh.attribute (test);
fnMesh.getAffectedAttributes ( o, atrraf);
But I did not get nothing in the variable atrraf… I can´t obtain the values that I applied in the model.
I tried also with the classes MPlug:
MFnDependencyNode nodeFn ();
MPlug mass = nodeFn.findPlug (" paintAttr");
double m;
mass.getValue (m);
But I come across with a problem, the function getValue only returns double values, and it does not return doubleArrays.
Do you have a suggestion? Can anybody help me?
Thanks,
Malu
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement