Skip to content
Snippets Groups Projects
Commit abeef11a authored by Demeter Dzadik's avatar Demeter Dzadik Committed by Demeter Dzadik
Browse files

Copy Attributes: Use new constraints.copy() which works better with Armature constraints

Currently when copying Armature constraints with the Copy Attributes addon, it does not copy the targets. rB64a584b38a73d4745e introduced a new constraints.copy() function to the Python API which handles this correctly and elegantly with just one line of code.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D8422
parent 14bbd42f
No related branches found
No related tags found
No related merge requests found
...@@ -272,11 +272,7 @@ class CopySelectedPoseConstraints(Operator): ...@@ -272,11 +272,7 @@ class CopySelectedPoseConstraints(Operator):
for bone in selected: for bone in selected:
for index, flag in enumerate(self.selection): for index, flag in enumerate(self.selection):
if flag: if flag:
old_constraint = active.constraints[index] bone.constraints.copy(active.constraints[index])
new_constraint = bone.constraints.new(
active.constraints[index].type
)
generic_copy(old_constraint, new_constraint)
return {'FINISHED'} return {'FINISHED'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment