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:
authorAlexander Gavrilov <angavrilov@gmail.com>2020-12-08 14:47:21 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2020-12-08 18:04:09 +0300
commit2687cca6c373d8e0e47c39c5382d643ea02b8745 (patch)
tree0e1f6220c468a65252a2b86af7a322ebedfe174b /rigify/rigs/basic/raw_copy.py
parentb0361dcaac3034cde90a5c146e3ef3f07d226da9 (diff)
Rigify: move constraints to control and deform bones in super_copy.
Use DEF: or CTRL: prefix on constraint names to move them during relink.
Diffstat (limited to 'rigify/rigs/basic/raw_copy.py')
-rw-r--r--rigify/rigs/basic/raw_copy.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/rigify/rigs/basic/raw_copy.py b/rigify/rigs/basic/raw_copy.py
index 44c10a6c..407241cb 100644
--- a/rigify/rigs/basic/raw_copy.py
+++ b/rigify/rigs/basic/raw_copy.py
@@ -62,6 +62,17 @@ class RelinkConstraintsMixin:
self.relink_constraint(con, [''])
+ def relink_move_constraints(self, from_bone, to_bone, *, prefix=''):
+ if self.params.relink_constraints:
+ src = self.get_bone(from_bone).constraints
+ dest = self.get_bone(to_bone).constraints
+
+ for con in list(src):
+ if con.name.startswith(prefix):
+ dest.copy(con)
+ src.remove(con)
+
+
def relink_bone_parent(self, bone_name):
if self.params.relink_constraints:
self.generator.disable_auto_parent(bone_name)