Panels: colored headers and fixed order

Every WTD panel gets a colored icon in its header (config PANEL_COLORS,
the Scene Manager sub-panels share its green) and the sidebar order is
set with bl_order: Tools, Rename, Scene Manager, Shot Manager, Sanity
Check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NDemaerschalkandClaude Opus 5.5 committed 2026-10-28 11:24:12 +01:00
1 parent 3f87904cd1
commit ce30491cb8
3 files changed
+53 -12

No files matched your search

+32 -4
View File
@@ -166,11 +166,21 @@ def _draw_check(layout, context, check, report, disabled):
col.separator(factor=0.5)
def _draw_color_header(self, context):
"""Colored icon in the panel header (config PANEL_COLORS), to tell the tools apart."""
self.layout.label(text="", icon=config.PANEL_COLORS.get(self.color, "NONE"))
# Sidebar order (bl_order), top to bottom: Tools, Rename, Scene Manager, Shot Manager,
# Sanity Check.
class _SanityPanel:
bl_region_type = "UI"
bl_category = "WTD"
bl_label = "Sanity Check"
bl_options = {"DEFAULT_CLOSED"} # panel starts collapsed
bl_order = 4
color = "Sanity Check"
draw_header = _draw_color_header
def draw(self, context):
draw_sanity_checks_panel(self, context)
@@ -180,6 +190,9 @@ class _ToolsPanel:
bl_region_type = "UI"
bl_category = "WTD"
bl_label = "Tools"
bl_order = 0
color = "Tools"
draw_header = _draw_color_header
def draw(self, context) -> None:
layout = self.layout
@@ -197,6 +210,9 @@ class _RenamePanel:
bl_category = "WTD"
bl_label = "Rename"
bl_options = {"DEFAULT_CLOSED"} # panel starts collapsed
bl_order = 1
color = "Rename"
draw_header = _draw_color_header
PREVIEW_COUNT = 10
@@ -294,6 +310,9 @@ class _ShotViewerPanel:
bl_category = "WTD"
bl_label = "Shot Manager"
bl_options = {"DEFAULT_CLOSED"} # panel starts collapsed
bl_order = 3
color = "Shot Manager"
draw_header = _draw_color_header
def draw(self, context) -> None:
layout = self.layout
@@ -361,6 +380,9 @@ class _SceneManagerPanel:
bl_region_type = "UI"
bl_category = "WTD"
bl_label = "Scene Manager"
bl_order = 2
color = "Scene Manager"
draw_header = _draw_color_header
def draw(self, context) -> None:
layout = self.layout
@@ -417,6 +439,8 @@ class _SceneCastingPanel:
bl_region_type = "UI"
bl_category = "WTD"
bl_label = "Casting"
color = "Scene Manager"
draw_header = _draw_color_header
bl_parent_id = "WTD_PT_scene_manager_view3d"
def draw(self, context) -> None:
@@ -509,6 +533,8 @@ class _SceneLoadedPanel:
bl_region_type = "UI"
bl_category = "WTD"
bl_label = "Loaded"
color = "Scene Manager"
draw_header = _draw_color_header
bl_parent_id = "WTD_PT_scene_manager_view3d"
def draw(self, context) -> None:
@@ -640,6 +666,8 @@ class _SceneAssetizePanel:
bl_region_type = "UI"
bl_category = "WTD"
bl_label = "Assetize"
color = "Scene Manager"
draw_header = _draw_color_header
bl_parent_id = "WTD_PT_scene_manager_view3d"
bl_options = {"DEFAULT_CLOSED"}
@@ -710,15 +738,15 @@ class WTD_PT_sanity_sequencer(_SanityPanel, bpy.types.Panel):
classes = (
WTD_UL_shots,
WTD_PT_sanity_view3d,
WTD_PT_tools_view3d,
WTD_PT_shot_viewer_view3d,
WTD_PT_rename_view3d,
WTD_PT_rename_node_editor,
WTD_PT_scene_manager_view3d,
WTD_PT_scene_casting_view3d,
WTD_PT_scene_loaded_view3d,
WTD_PT_scene_assetize_view3d,
WTD_PT_rename_view3d,
WTD_PT_rename_node_editor,
WTD_PT_shot_viewer_view3d,
WTD_PT_sanity_view3d,
WTD_PT_sanity_sequencer,
)