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
This commit is contained in:
Demeter Dzadik 2020-08-11 13:04:26 +02:00 committed by Demeter Dzadik
parent 14bbd42ff2
commit abeef11a77
Notes: blender-bot 2023-02-14 18:45:40 +01:00
Referenced by issue #82863, Copy attributes doesn't properly copy armature constraint
1 changed files with 1 additions and 5 deletions

View File

@ -272,11 +272,7 @@ class CopySelectedPoseConstraints(Operator):
for bone in selected:
for index, flag in enumerate(self.selection):
if flag:
old_constraint = active.constraints[index]
new_constraint = bone.constraints.new(
active.constraints[index].type
)
generic_copy(old_constraint, new_constraint)
bone.constraints.copy(active.constraints[index])
return {'FINISHED'}