Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDemeter Dzadik <Mets>2020-08-11 14:04:26 +0300
committerDemeter Dzadik <demeterdzadik@gmail.com>2020-08-11 15:06:50 +0300
commitabeef11a77ab5b05f4ce2c71b65c341bdcb7303d (patch)
treedba160984d706c46c62138b274e53e6085ebdca0
parent14bbd42ff2abb7c480b373a88817095bf8c2ad4c (diff)
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
-rw-r--r--space_view3d_copy_attributes.py6
1 files changed, 1 insertions, 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'}