SUPERTABs is designed to be a non-destructive UI wrapper for Blender's N-Panel. Its primary innovation is the ability to dynamically "hijack" existing panels from other add-ons and re-contextualize them within its own Tab/Sub-group system.
The core of SUPERTABs' panel discovery and management system lies in its ability to introspect Blender's internal class registry and manipulate panel attributes at runtime.
SUPERTABs doesn't hard-code a list of supported add-ons. Instead, it scans all registered panels using recursion:
python
def_get_all_subclasses_recursively(cls):
all_subclasses= []
for subclassincls.__subclasses__():
all_subclasses.append(subclass)
all_subclasses.extend(_get_all_subclasses_recursively(subclass))
return all_subclasses
# Discover all Panel subclasses
candidates= _get_all_subclasses_recursively(bpy.types.Panel)
This ensures that even newly installed add-ons are automatically detected.
Once panels are discovered, they are mapped to SUPERTABs' items (Addons or Tabs) based on several criteria:
panel_cls.__module__. If an add-on's module name is found in the panel's module path, it's a match.bl_category attribute. If a panel belongs to an N-Panel category (e.g., "Item", "Tool", or a custom one like "HardOps"), it can be grouped under that name.bl_parent_id. SUPERTABs finds "top-level" panels and then recursively finds all their children so it can move them as a single unit.To bring a panel into the SUPERTABs ecosystem, the system performs a temporary "patch":
Unregister: The original class is temporarily unregistered from Blender.
Attribute Modification:
bl_category: Changed to the SUPERTABs Group name.bl_parent_id: Often set to None to move sub-panels to the top level of the SUPERTABs tab, or managed specifically to maintain hierarchy.Polling Patch: The most critical step. The poll method is wrapped:
python
defnew_poll_method(cls,context):
# 1. Run original poll logic
if original_pollandnot original_poll(context):
returnFalse
# 2. Add SUPERTABs logic: Only show if this item is active/pinned
return is_active_in_supertabs(item_string)
Register: The modified class is re-registered.