From 855d51830b51f5d2ef1eacbd7c996a1db1febb61 Mon Sep 17 00:00:00 2001
From: Alexander Gavrilov <angavrilov@gmail.com>
Date: Tue, 13 Jul 2021 15:34:10 +0300
Subject: [PATCH] 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.
---
 rigify/base_rig.py |  2 +-
 rigify/ui.py       | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/rigify/base_rig.py b/rigify/base_rig.py
index 0cc2bc1dd..87c89c179 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 02912934f..6b1e6e4c8 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):
-- 
GitLab