From ce30491cb8508333c48d0173d527dfe744d4bd41 Mon Sep 17 00:00:00 2001 From: Nero WTD Date: Wed, 28 Oct 2026 11:24:12 +0100 Subject: [PATCH] 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 --- README.md | 19 +++++++++++-------- config.py | 10 ++++++++++ ui/panel.py | 36 ++++++++++++++++++++++++++++++++---- 3 files changed, 53 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index af512f7..46f3388 100644 --- a/README.md +++ b/README.md @@ -56,15 +56,17 @@ blender --command extension build --source-dir path/to/wtd-libreflow-addon ## Where to find the tools -Open the sidebar of the 3D Viewport (**N**) and click the **WTD** tab. +Open the sidebar of the 3D Viewport (**N**) and click the **WTD** tab. The panels come in this order, each with a colored icon in its header: -| Panel | Editors | -|---|---| -| **Sanity Check** | 3D Viewport, Video Sequencer | -| **Tools** (Get Oid) | 3D Viewport | -| **Rename** | 3D Viewport, Shader Editor | -| **Shot Manager** | 3D Viewport | -| **Scene Manager** (Casting, Loaded, Assetize) | 3D Viewport | +| Panel | Color | Editors | +|---|---|---| +| **Tools** (Get Oid) | blue | 3D Viewport | +| **Rename** | yellow | 3D Viewport, Shader Editor | +| **Scene Manager** (Casting, Loaded, Assetize) | green | 3D Viewport | +| **Shot Manager** | violet | 3D Viewport | +| **Sanity Check** | orange | 3D Viewport, Video Sequencer | + +Panels you drag to another place stay there: a file keeps its own panel order. The colors are `PANEL_COLORS` in the [Configuration](#configuration). --- @@ -472,6 +474,7 @@ Name formats use Python's `str.format`: `"sq{:04d}"` turns `10` into `sq0010`. ` | Sanity Check: assets | `REQUIRED_COLLECTIONS`, `MAX_FACE_SIDES`, `CONCAVE_TOLERANCE`, `NON_MANIFOLD_ALLOW_BOUNDARY`, `UV_NEGATIVE_TOLERANCE`, `ALLOWED_MODIFIERS`, `ALLOWED_MODIFIERS_LINEART`, `APPLY_TRANSFORM`, `APPLY_TRANSFORM_TYPES`, `TRANSFORM_TOLERANCE`, `FORBIDDEN_ASSET_OBJECT_TYPES` | | Sanity Check: characters | `CHAR_REFERENCE_PATH`, `CHAR_BODY_NAME`, `CHAR_PART_KEYWORDS`, `CHAR_BODY_VERTEX_GROUPS` | | Sanity Check: layout | `SET_COLLECTION_PATTERN` | +| Panels | `PANEL_COLORS` | | Sanity Check: panel | `CATEGORY_ORDER`, `MAX_ISSUES_DRAWN` | | Rename | `RENAME_SEPARATOR`, `RENAME_PADDING`, `RENAME_SIDES`, `RENAME_TYPE_SUFFIXES` (plus `OBJECT_PREFIXES` / `DATABLOCK_PREFIXES` for *By Type* prefixes) | | Shot Manager | `SHOT_VIEWER_RIG_GROUPS`, `SHOT_VIEWER_ASSET_TYPE_GROUPS`, `SHOT_NAME_FORMAT`, `SHOT_NUMBER_STEP`, `SHOT_FRAME_START`, `SHOT_DEFAULT_DURATION`, `SEQUENCE_NAME_FORMAT`, `SHOT_CAMERA_NAME_FORMAT`, `SHOT_CAMERA_RIG_NAME_FORMAT`, `SHOT_CAMERA_RIG_MODES` | diff --git a/config.py b/config.py index 2304155..0c0ae0c 100644 --- a/config.py +++ b/config.py @@ -317,6 +317,16 @@ SCENE_MANAGER_ASSETIZE_TASK = "modeling" # --------------------------------------------------------------------------- # # UI # --------------------------------------------------------------------------- # +# Colored icon in the header of each panel, to tell the tools apart (the Scene Manager +# sub-panels use its color). COLLECTION_COLOR_01 to _08: red, orange, yellow, green, +# blue, violet, pink, brown. Red is left out: it marks errors in the panels. +PANEL_COLORS = { + "Tools": "COLLECTION_COLOR_05", + "Rename": "COLLECTION_COLOR_03", + "Scene Manager": "COLLECTION_COLOR_04", + "Shot Manager": "COLLECTION_COLOR_06", + "Sanity Check": "COLLECTION_COLOR_02", +} CATEGORY_ORDER = [ "Scene", "File", diff --git a/ui/panel.py b/ui/panel.py index bf13603..0abe4a8 100644 --- a/ui/panel.py +++ b/ui/panel.py @@ -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, )