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 = (cmds.ls(sl=1,sn=True))[0]
print ( get_world_transform( selected_object ) )
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme