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-09-04 18:09:50 +0300
committerDemeter Dzadik <demeter@blender.studio>2020-09-04 18:10:00 +0300
commit414448fd3834524121d1114904033c4520936085 (patch)
tree39bbb07201d7f1e43cd771982f5d079132d56357 /rigify/utils/layers.py
parent6efbb96f77024330138ab2f97e5a93d447afde23 (diff)
Rigify: Code Cleanup: Use 'LAYER' BoolVectorProperty subtype
Instead of implementing the 2 rows of layer boolean toggles, we can just use the 'LAYER' subtype on the BoolVectorProperty. No functional changes. Reviewed By: sybren Differential Revision: https://developer.blender.org/D8801
Diffstat (limited to 'rigify/utils/layers.py')
-rw-r--r--rigify/utils/layers.py39
1 files changed, 3 insertions, 36 deletions
diff --git a/rigify/utils/layers.py b/rigify/utils/layers.py
index 0cbd41f8..7d85cd4d 100644
--- a/rigify/utils/layers.py
+++ b/rigify/utils/layers.py
@@ -116,6 +116,7 @@ class ControlLayersOption:
prop_layers = bpy.props.BoolVectorProperty(
size=32,
description=self.description,
+ subtype='LAYER',
default=tuple([i == 1 for i in range(0, 32)])
)
@@ -130,42 +131,8 @@ class ControlLayersOption:
if not active:
return
- r = box.row()
- col = r.column(align=True)
- row = col.row(align=True)
-
- bone_layers = bpy.context.active_pose_bone.bone.layers[:]
-
- for i in range(8): # Layers 0-7
- icon = "NONE"
- if bone_layers[i]:
- icon = "LAYER_ACTIVE"
- row.prop(params, self.layers_option, index=i, toggle=True, text="", icon=icon)
-
- row = col.row(align=True)
-
- for i in range(16, 24): # Layers 16-23
- icon = "NONE"
- if bone_layers[i]:
- icon = "LAYER_ACTIVE"
- row.prop(params, self.layers_option, index=i, toggle=True, text="", icon=icon)
-
- col = r.column(align=True)
- row = col.row(align=True)
-
- for i in range(8, 16): # Layers 8-15
- icon = "NONE"
- if bone_layers[i]:
- icon = "LAYER_ACTIVE"
- row.prop(params, self.layers_option, index=i, toggle=True, text="", icon=icon)
-
- row = col.row(align=True)
-
- for i in range(24, 32): # Layers 24-31
- icon = "NONE"
- if bone_layers[i]:
- icon = "LAYER_ACTIVE"
- row.prop(params, self.layers_option, index=i, toggle=True, text="", icon=icon)
+ row = box.row(align=True)
+ row.prop(params, self.layers_option, text="")
ControlLayersOption.FK = ControlLayersOption('fk', description="Layers for the FK controls to be on")