[Bf-extensions-cvs] [855d5183] master: Rigify: don't print "No options" from BaseRig.parameters_ui.
Alexander Gavrilov
noreply at git.blender.org
Tue Jul 13 15:10:58 CEST 2021
Commit: 855d51830b51f5d2ef1eacbd7c996a1db1febb61
Author: Alexander Gavrilov
Date: Tue Jul 13 15:34:10 2021 +0300
Branches: master
https://developer.blender.org/rBA855d51830b51f5d2ef1eacbd7c996a1db1febb61
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.
===================================================================
M rigify/base_rig.py
M rigify/ui.py
===================================================================
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):
More information about the Bf-extensions-cvs
mailing list