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-07 22:56:50 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2020-12-07 23:21:35 +0300
commit9bc98387d9edf988695e294bedaa152043a35de7 (patch)
treeb03c0d581e4a18c395181c41f26993f2c44fcf05 /rigify/generate.py
parentf8d6489fb6e4b8f3c1029d3468ebbe6781f599dd (diff)
Rigify: include widgets in generated metarig code.
Since rigs like super_copy already support using widgets assigned directly to metarig bones, implement adding them with the metarig.
Diffstat (limited to 'rigify/generate.py')
-rw-r--r--rigify/generate.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/rigify/generate.py b/rigify/generate.py
index 475c57fe..f1586873 100644
--- a/rigify/generate.py
+++ b/rigify/generate.py
@@ -270,18 +270,25 @@ class Generator(base_generate.BaseGenerator):
# others make non-deforming.
for bone in bones:
name = bone.name
+ layers = None
bone.use_deform = name.startswith(DEF_PREFIX)
# Move all the original bones to their layer.
if name.startswith(ORG_PREFIX):
- bone.layers = ORG_LAYER
+ layers = ORG_LAYER
# Move all the bones with names starting with "MCH-" to their layer.
elif name.startswith(MCH_PREFIX):
- bone.layers = MCH_LAYER
+ layers = MCH_LAYER
# Move all the bones with names starting with "DEF-" to their layer.
elif name.startswith(DEF_PREFIX):
- bone.layers = DEF_LAYER
+ layers = DEF_LAYER
+
+ if layers is not None:
+ bone.layers = layers
+
+ # Remove custom shapes from non-control bones
+ bone.custom_shape = None
bone.bbone_x = bone.bbone_z = bone.length * 0.05