Skip to content

Instantly share code, notes, and snippets.

@justsh
Created August 31, 2024 07:55
Show Gist options
  • Select an option

  • Save justsh/bae7d098c221d20b173ed2a033213047 to your computer and use it in GitHub Desktop.

Select an option

Save justsh/bae7d098c221d20b173ed2a033213047 to your computer and use it in GitHub Desktop.
Move an object's pivots to the world position of a second object
from __future__ import print_function
import pymel.core as pm
driver, driven = pm.selected()
# NOTE: PyNode.Attribute.rotatePivot.set() may be equivalent
pm.move(driven.rotatePivot, *driver.getTranslation(worldSpace=True))
pm.move(driven.scalePivot, *driver.getTranslation(worldSpace=True))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment