Actually i'am new to api and am trying to get the translation values(x,y,z) but the problem is i cant get when i specify only "translate" instead of "translateX", "translateY", "translateZ" in every separate line. is there any way to get what i actually want?
here's the code:
import maya.OpenMaya as om
selected = om.MSelectionList()
om.MGlobal.getActiveSelectionList(selected)
obj = om.MObject()
selected.getDependNode(0,obj)
print(om.MFnDependencyNode(obj).findPlug("translateX").asFloat())
print(om.MFnDependencyNode(obj).findPlug("translateY").asFloat())
print(om.MFnDependencyNode(obj).findPlug("translateZ").asFloat())
thank you...