Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import maya.OpenMaya as OpenMaya
- locA = cmds.spaceLocator()[0]
- locB = cmds.spaceLocator()[0]
- cmds.setAttr("{}.scaleY".format(locB), -1)
- locBMatList = cmds.xform(locB, m=True, ws=True, q=True)
- mScrA = OpenMaya.MScriptUtil()
- locBMMat = OpenMaya.MMatrix()
- mScrA.createMatrixFromList(locBMatList, locBMMat)
- mScrB = OpenMaya.MScriptUtil()
- dblPtr = mScrB.asDoublePtr()
- mTrsMat = OpenMaya.MTransformationMatrix(locBMMat)
- mTrsMat.getScale(dblPtr, OpenMaya.MSpace.kWorld)
- mslist = OpenMaya.MSelectionList()
- mslist.add("locator1")
- mDagPath = OpenMaya.MDagPath()
- mslist.getDagPath(0, mDagPath)
- loc1MFnTrs = OpenMaya.MFnTransform(mDagPath)
- loc1MFnTrs.setScale(dblPtr)
- del(dblPtr)
Advertisement
Add Comment
Please, Sign In to add comment