Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
constrain all _fk joints to respective _bn assuming root_bn exists.
import maya.cmds as cmds
# select all joints _bn
cmds.select('root_bn', hierarchy=True)
# For each _fk constrain to _bn
for bn in cmds.ls(selection=True):
try:
cmds.orientConstraint( bn.replace('_bn', '_fk'), bn )
cmds.pointConstraint( bn.replace('_bn', '_fk'), bn )
except Exception as e:
print e.args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment