Skip to content

Instantly share code, notes, and snippets.

@rondreas
Last active March 23, 2017 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rondreas/eac011648ad8299b9be011c7d0dbf2f9 to your computer and use it in GitHub Desktop.
Save rondreas/eac011648ad8299b9be011c7d0dbf2f9 to your computer and use it in GitHub Desktop.
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