keyojimbo

Make World Space Locator

Aug 26th, 2025 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. selected = cmds.ls(sl = True)
  2. ctrl = selected[0]
  3. loc_name = str(selected[0])+ "_loc" + str(int(cmds.currentTime (query=True)))
  4.  
  5. locator = cmds.spaceLocator(n = loc_name)
  6.  
  7. trans = cmds.xform(ctrl, q = True, t = True, ws = True)
  8. trans = (trans[0], trans[1], trans[2])
  9. rot = cmds.xform(ctrl, q = True, ro = True, ws = True)
  10. rot = (rot[0], rot[1], rot[2])
  11.  
  12. cmds.xform(locator, ro = rot, t = trans, ws = True)
  13.  
  14. cmds.select(ctrl)
Advertisement
Add Comment
Please, Sign In to add comment