Last active
September 15, 2018 05:58
-
-
Save justinmeiners/4326dc253a56115c22d6c31521610f80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created By: Justin Meiners (2012) | |
# This was really useful at one point. I doubt it still is. | |
from pymel.all import * | |
import pymel | |
selection_list = pymel.core.ls(type="transform", selection=True) | |
for node in selection_list: | |
node.centerPivots() | |
point = node.getRotatePivot(space="world") | |
point_inverse = [-point[0], -point[1], -point[2]] | |
node.translateBy(point_inverse, space="world") | |
pymel.core.makeIdentity(node, apply=True, translate=True) | |
node.setTranslation(point, space="world") | |
node.zeroTransformPivots() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment