[Maya-Python] Small Arrays and OpenMaya API

2020-03-25 Thread Nicolas Chaverou
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: MStatus <

[Maya-Python] Re: Small Arrays and OpenMaya API

2020-03-25 Thread Nicolas Chaverou
Ok, inspecting the API with the good old dir command, I figured a MScriptUtil_setFloat3ArrayItem entry Which led me here: https://download.autodesk.com/us/maya/2011help/API/class_m_script_util.html Problem solved. Here's the fixed code for reference: import maya.OpenMaya as om selList = om.MSelec

Re: [Maya-Python] Re: Small Arrays and OpenMaya API

2020-03-25 Thread Marcus Ottosson
This is why god created API 2.0… from maya.api import OpenMaya as om sl = om.MSelectionList() sl.add('joint1') node = sl.getDependNode(0) joint = om.MFnTransform(node) print(joint.scale()) And why I created cmdx ... import cmdx joint = cmdx.encode("joint1") joi