I only have some cpp hints:
Create an attribute
MFnTypedAttribute tAttr;
outInstanceData = tAttr.create( "outInstanceData", "oid",
MFnData::kDynArrayAttrs);
In compute create the data object:
if( plug == outInstanceData)
{
MFnArrayAttrsData instancePointDataFn;
MObject instancePointDataObj =
instancePointDataFn.create();
fillInstancerArrays(instancePointDataFn); // this is a user
defined method
MDataHandle instanceDataHandle =
datablock.outputValue(outInstanceData);
instanceDataHandle.setMObject(instancePointDataObj);
}
Fill the arrays:
First create the array:
MVectorArray outPosArray = arrayData.vectorArray("position");
outPosArray.setLength(yourPositionArraySize);
for( size_t i = 0; i < yourArraySize; i++)
{
outPosArray[i] = MVector(x,y,z);
}
Following this pattern you can add any additional arrays like intArray,
double and so on.
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/8ce6d92a-71c2-49bd-b7ef-713ef4889c2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.