From abeef11a77ab5b05f4ce2c71b65c341bdcb7303d Mon Sep 17 00:00:00 2001 From: Demeter Dzadik Date: Tue, 11 Aug 2020 13:04:26 +0200 Subject: 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 --- space_view3d_copy_attributes.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py index 30393a75..da741737 100644 --- a/space_view3d_copy_attributes.py +++ b/space_view3d_copy_attributes.py @@ -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'} -- cgit v1.2.3