Hey guys,

That's probably a silly question but I've been wondering this for a while
and always figured something else, but now i'm kinda stucked. Using Maya
2018 / Windows

How do get/set small arrays within the Python API ?
For example, MfnTransform has the following function prototype:
(double scale[3]) const

And when calling it from the Python API returns the same prototype:

in method 'MFnTransform_getScale', argument 2 of type 'double [3]' //

According to SWIG documentation
<http://www.swig.org/Doc1.3/Python.html#Python_nn62> (which Autodesk used
for its Python bindings), one should use tuples to do it (but it has to be
implemented on the API side)

Here is what I tried:

import maya.OpenMaya as om

selList = om.MSelectionList()
oNode = om.MObject()
selList.getDependNode(0, oNode)
joint = om.MFnTransform(oNode)
scale = (0, 0, 0)

But I always get the following error:

# TypeError: in method 'MFnTransform_getScale', argument 2 of type 'double
[3]' //

Tried with [], [0, 0, 0], om.MFloatArray(), None... but was never able to
query that property correctly. What's the supposed way of making this work
? Or does it just nit work at all and I'm obliged to use PyMel for those ?

Any insights appreciated

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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to