Using OpenMaya.MFnArrayAttrsData.checkArrayExist()

71 views
Skip to first unread message

Szabolcs

unread,
Mar 1, 2016, 10:38:15 AM3/1/16
to Python Programming for Autodesk Maya
Hi,

I'd like to query the datatype of an array used by a particle instancer node. There is a call in the API to check whether the specified attribute exists with the given datatype, but I have a hard time setting the actual type.
It requires a reference to OpenMaya.MFnArrayAttrsData.kIntArray and I suppose I have to use some kind of an MScriptUtil nightmare but I can't get it to work with createFromInt() or asIntPtr()

I call OpenMaya.MFnArrayAttrsData.checkArrayExist()

And the error message is:
# Error: TypeError: file S:\Maya_2015_DI\build\Release\runTime\Python\Lib\site-packages\maya\OpenMaya.py line 4759: in method 'MFnArrayAttrsData_checkArrayExist', argument 3 of type 'MFnArrayAttrsData::Type &' #

Cheers,
Szabolcs

Janos Hunyadi

unread,
Mar 2, 2016, 6:14:55 PM3/2/16
to Python Programming for Autodesk Maya

Szabolcs

unread,
Mar 7, 2016, 6:55:29 AM3/7/16
to Python Programming for Autodesk Maya
Thanks Janos,

Sadly I did not find the proper solution in that thread, but I've managed to make a workaround for this specific case. I assume that the SOuP copier node uses an int array to store the object indices, instead of a float array that the Maya particles use internally. Curious when this script will break next time, though... :)

Cheers,
Szabolcs
Reply all
Reply to author
Forward
0 new messages