Created
February 5, 2020 10:55
-
-
Save Roumenov/fdf7379f68754bb0da54a68bcd63f28c to your computer and use it in GitHub Desktop.
messing around with storing constraint values to rebuild later
This file contains hidden or 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
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