instancer node and inputPoints

37 views
Skip to first unread message

pety20...@gmail.com

unread,
Feb 25, 2019, 9:43:13 PM2/25/19
to Python Programming for Autodesk Maya
hi.
what is inputPoints attribute type in instancer nodes??
how i can read or write them???
and how i can have it in my node and connect it to one instancer node?

ha...@haggi.de

unread,
Feb 26, 2019, 3:37:49 AM2/26/19
to python_in...@googlegroups.com
The inputPoints attribute is an compound attribute which contains data
necessary to transform instances. All necessary infos are described
here:
https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/Maya-Tech-Docs/Nodes/instancer-html.html

ha...@haggi.de

unread,
Feb 26, 2019, 3:40:38 AM2/26/19
to python_in...@googlegroups.com
Sorry, I was wrong, it is not an compound attribute but a generic array
which contains other arrays.

pety20...@gmail.com

unread,
Feb 26, 2019, 3:41:21 PM2/26/19
to Python Programming for Autodesk Maya
Thanks, I think I should see an example :)
I did not see any examples:|

haggi krey

unread,
Feb 27, 2019, 6:54:16 AM2/27/19
to Python Programming for Autodesk Maya
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.
Reply all
Reply to author
Forward
0 new messages