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>2021-07-13 15:34:10 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2021-07-13 15:34:27 +0300
commit855d51830b51f5d2ef1eacbd7c996a1db1febb61 (patch)
tree46da88fd0994950f003869d9ef7f1f84a9ca425c
parent7e441a740d65e46d4dd2eac48dfc283f0b1bbcdb (diff)
Rigify: don't print "No options" from BaseRig.parameters_ui.
To make it easier to call super(), instead of printing in the dummy base method, detect and special case it in the caller code.
-rw-r--r--rigify/base_rig.py2
-rw-r--r--rigify/ui.py12
2 files changed, 11 insertions, 3 deletions
diff --git a/rigify/base_rig.py b/rigify/base_rig.py
index 0cc2bc1d..87c89c17 100644
--- a/rigify/base_rig.py
+++ b/rigify/base_rig.py
@@ -243,7 +243,7 @@ class BaseRig(GenerateCallbackHost, RaiseErrorMixin, BoneUtilityMixin, Mechanism
:param params:
:return:
"""
- layout.label(text="No options")
+ pass
@classmethod
def on_parameter_update(cls, context, pose_bone, params, param_name):
diff --git a/rigify/ui.py b/rigify/ui.py
index 02912934..6b1e6e4c 100644
--- a/rigify/ui.py
+++ b/rigify/ui.py
@@ -619,16 +619,24 @@ class BONE_PT_rigify_buttons(bpy.types.Panel):
else:
if hasattr(rig.Rig, 'parameters_ui'):
rig = rig.Rig
+
try:
- rig.parameters_ui
+ param_cb = rig.parameters_ui
+
+ # Ignore the known empty base method
+ if getattr(param_cb, '__func__', None) == base_rig.BaseRig.parameters_ui.__func__:
+ param_cb = None
except AttributeError:
+ param_cb = None
+
+ if param_cb is None:
col = layout.column()
col.label(text="No options")
else:
col = layout.column()
col.label(text="Options:")
box = layout.box()
- rig.parameters_ui(box, bone.rigify_parameters)
+ param_cb(box, bone.rigify_parameters)
class VIEW3D_PT_tools_rigify_dev(bpy.types.Panel):