Skip to content

Instantly share code, notes, and snippets.

@RedForty
Created December 24, 2018 03:18
Show Gist options
  • Save RedForty/095937cd43494fdc8a60e83bac59aff2 to your computer and use it in GitHub Desktop.
Save RedForty/095937cd43494fdc8a60e83bac59aff2 to your computer and use it in GitHub Desktop.
A better parent constraint that will put the attributes of the constraint on the parent
# A better parent constraint
sel = cmds.ls(sl=1)
source = sel[0]
target = sel[-1]
constraint = cmds.parentConstraint(source, target, maintainOffset=True)[0]
cmds.addAttr(source, longName='blendParent', attributeType='float3', hidden=0, keyable=1, proxy=target + '.blendParent1')
cmds.addAttr(source, longName='constraint', attributeType='float3', hidden=0, keyable=1, proxy=constraint + '.w0')
cmds.addAttr(target, longName='constraint', attributeType='float3', hidden=0, keyable=1, proxy=constraint + '.w0')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment