Last active
August 23, 2021 20:59
-
-
Save bohdon/df856b36969d242175b75f1a4d781f08 to your computer and use it in GitHub Desktop.
Maya snippet to snap controls to joints, update CONTROL_JOINT_MAP with your own mappings
This file contains 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
import pymel.core as pm | |
def snap_ctls_to_joints(ctl_joint_map): | |
for ctl_name, joint_name in CONTROL_JOINT_MAP.items(): | |
ctl = pm.PyNode(ctl_name) | |
joint = pm.PyNode(joint_name) | |
ctl.setMatrix(joint.wm.get(), worldSpace=True) | |
CONTROL_JOINT_MAP = { | |
"clavicle_ctl":"clavicle", | |
"upperarm_ctl":"upperarm", | |
"lowerarm_ctl":"lowerarm", | |
"hand_ctl":"hand", | |
} | |
snap_ctls_to_joints(CONTROL_JOINT_MAP) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment