Guest User

Untitled

a guest
Jul 16th, 2021
46
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import maya.OpenMaya as OpenMaya
  2.  
  3. locA = cmds.spaceLocator()[0]
  4. locB = cmds.spaceLocator()[0]
  5. cmds.setAttr("{}.scaleY".format(locB), -1)
  6.  
  7. locBMatList = cmds.xform(locB, m=True, ws=True, q=True)
  8. mScrA = OpenMaya.MScriptUtil()
  9. locBMMat =  OpenMaya.MMatrix()
  10. mScrA.createMatrixFromList(locBMatList, locBMMat)
  11.  
  12. mScrB = OpenMaya.MScriptUtil()
  13. dblPtr = mScrB.asDoublePtr()
  14. mTrsMat = OpenMaya.MTransformationMatrix(locBMMat)
  15. mTrsMat.getScale(dblPtr, OpenMaya.MSpace.kWorld)
  16.  
  17.  
  18. mslist = OpenMaya.MSelectionList()
  19. mslist.add("locator1")
  20. mDagPath = OpenMaya.MDagPath()
  21. mslist.getDagPath(0, mDagPath)
  22. loc1MFnTrs = OpenMaya.MFnTransform(mDagPath)
  23. loc1MFnTrs.setScale(dblPtr)
  24. del(dblPtr)
RAW Paste Data