Skip to content

Instantly share code, notes, and snippets.



Last active Oct 4, 2020
What would you like to do?
Python for Maya - Get object world space transform matrix
from maya.api.OpenMaya import MVector, MMatrix, MPoint
import maya.cmds as cmds
def get_world_transform (obj):
return MMatrix ( cmds.xform( obj, q=True, matrix=True, ws=True ) )
selected_object = (,sn=True))[0]
print ( get_world_transform( selected_object ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment