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 13:31:07 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2020-12-08 13:31:07 +0300
commitb0361dcaac3034cde90a5c146e3ef3f07d226da9 (patch)
tree9dff4b37f71374882a2c8dbc1347018ce293e7d1 /rigify/rigs/basic/pivot.py
parent9bc98387d9edf988695e294bedaa152043a35de7 (diff)
Rigify: support choosing widgets out of a list in super_copy and pivot.
Register the most generic widgets in the list and add a few more. Use it to assign a nicer looking shoulder widget in human metarigs.
Diffstat (limited to 'rigify/rigs/basic/pivot.py')
-rw-r--r--rigify/rigs/basic/pivot.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/rigify/rigs/basic/pivot.py b/rigify/rigs/basic/pivot.py
index e5d31659..2a44e7e4 100644
--- a/rigify/rigs/basic/pivot.py
+++ b/rigify/rigs/basic/pivot.py
@@ -24,7 +24,8 @@ from ...base_rig import BaseRig
from ...utils.naming import make_derived_name
from ...utils.bones import set_bone_widget_transform
-from ...utils.widgets_basic import create_cube_widget, create_pivot_widget
+from ...utils.widgets import layout_widget_dropdown, create_registered_widget
+from ...utils.widgets_basic import create_pivot_widget
from ...utils.switch_parent import SwitchParentBuilder
@@ -135,7 +136,7 @@ class Rig(BaseRig):
if self.make_control:
set_bone_widget_transform(self.obj, self.bones.ctrl.master, self.bones.org)
- create_cube_widget(self.obj, self.bones.ctrl.master, radius=0.5)
+ create_registered_widget(self.obj, self.bones.ctrl.master, self.params.pivot_master_widget_type or 'cube')
@classmethod
@@ -146,6 +147,12 @@ class Rig(BaseRig):
description = "Create a control bone for the copy"
)
+ params.pivot_master_widget_type = bpy.props.StringProperty(
+ name = "Widget Type",
+ default = 'cube',
+ description = "Choose the type of the widget to create"
+ )
+
params.make_parent_switch = bpy.props.BoolProperty(
name = "Switchable Parent",
default = False,
@@ -183,6 +190,8 @@ class Rig(BaseRig):
r.prop(params, "make_extra_control", text="Master Control")
if params.make_extra_control:
+ layout_widget_dropdown(layout, params, "pivot_master_widget_type")
+
layout.prop(params, "make_parent_switch")
layout.prop(params, "register_parent")