Skip to content

Instantly share code, notes, and snippets.

@Roumenov
Created February 5, 2020 10:55
Show Gist options
  • Save Roumenov/fdf7379f68754bb0da54a68bcd63f28c to your computer and use it in GitHub Desktop.
Save Roumenov/fdf7379f68754bb0da54a68bcd63f28c to your computer and use it in GitHub Desktop.
messing around with storing constraint values to rebuild later
target = pm.ls(sl=1)[0]
constraint = set(pm.listConnections(source = True, type = 'constraint')).pop()
print(constraint.Target)
sources = list(set(constraint.listConnections(source = True, type = 'transform')))
sources.remove(target)
source_weight = {}
for item in sources:
if type(item) == pm.nodetypes.ParentConstraint:
print item
sources.remove(item)
else:
print(constraint.getWeight(item))
weight = constraint.getWeight(item)
source_weight[item.name()] = weight
source_weight['facerig_nasolab_offset_thing']
pm.parentConstraint(sources, edit = True, maintainOffset = True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment