[Bf-extensions-cvs] [abeef11a] master: Copy Attributes: Use new constraints.copy() which works better with Armature constraints

Demeter Dzadik noreply at git.blender.org
Tue Aug 11 15:57:08 CEST 2020


Commit: abeef11a77ab5b05f4ce2c71b65c341bdcb7303d
Author: Demeter Dzadik
Date:   Tue Aug 11 13:04:26 2020 +0200
Branches: master
https://developer.blender.org/rBAabeef11a77ab5b05f4ce2c71b65c341bdcb7303d

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

===================================================================

M	space_view3d_copy_attributes.py

===================================================================

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'}



More information about the Bf-extensions-cvs mailing list