From 0c815967d2555b5646f632a5c5c0c49c10a5fcce Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 22 Aug 2025 14:40:18 -0600 Subject: [PATCH] red box --- ...blender-extension-for-asset-replacement.md | 131 ++++++++++++++++++ ui.py | 14 +- 2 files changed, 142 insertions(+), 3 deletions(-) diff --git a/.specstory/history/2025-08-20_22-43Z-creating-a-blender-extension-for-asset-replacement.md b/.specstory/history/2025-08-20_22-43Z-creating-a-blender-extension-for-asset-replacement.md index a6e2718..7196a5b 100644 --- a/.specstory/history/2025-08-20_22-43Z-creating-a-blender-extension-for-asset-replacement.md +++ b/.specstory/history/2025-08-20_22-43Z-creating-a-blender-extension-for-asset-replacement.md @@ -12010,3 +12010,134 @@ Now the third column in the main library list will be much cleaner and easier to --- +_**User**_ + +if they're missing, let's highlight them red. + +--- + +_**Assistant**_ + +Great idea! Let me add red highlighting for missing libraries in the blend info section. I'll use Blender's `alert` property to make the status text red when libraries are missing: + + +--- + +
Edit file: ui.py + +undefined + +**Chunk 1** +Lines added: 8, lines removed: 3 + +```diff +@@ -241,9 +241,14 @@ + + if selected_lib.is_missing: +- info_box.label(text="Status: MISSING", icon='ERROR') ++ row = info_box.row() ++ row.alert = True # Make the row red ++ row.label(text="Status: MISSING", icon='ERROR') + elif selected_lib.has_indirect_missing: +- info_box.label(text=f"Status: INDIRECT MISSING ({selected_lib.indirect_missing_count} dependencies)", icon='ERROR') ++ row = info_box.row() ++ row.alert = True # Make the row red ++ row.label(text=f"Status: INDIRECT MISSING ({selected_lib.indirect_missing_count} dependencies)", icon='ERROR') + else: +- info_box.label(text="Status: OK", icon='FILE_BLEND') ++ row = info_box.row() ++ row.label(text="Status: OK", icon='FILE_BLEND') + + # Show full path and Open Blend button +``` + +
+ +--- + +Perfect! Now the status information will be visually highlighted: + +## **What Changed:** + +1. **Missing Libraries**: Status row will be highlighted in red (`row.alert = True`) +2. **Indirect Missing Libraries**: Status row will also be highlighted in red +3. **OK Libraries**: Status row remains normal (no highlighting) + +## **Visual Result:** + +- **MISSING status**: Red background highlighting to draw attention +- **INDIRECT MISSING status**: Red background highlighting for dependencies issues +- **OK status**: Normal appearance for healthy libraries + +This makes it much easier for users to quickly identify problematic libraries at a glance. The red highlighting will make missing or problematic libraries stand out prominently in the blend info section, improving the user experience when troubleshooting linked library issues. + +--- + +_**User**_ + +let's make the entire box red in those cases. + +--- + +_**Assistant**_ + +Great idea! Let me make the entire info box red when libraries are missing or have indirect missing dependencies. This will make the problematic libraries much more visually prominent: + + +--- + +
Edit file: ui.py + +undefined + +**Chunk 1** +Lines added: 5, lines removed: 2 + +```diff +@@ -238,13 +238,16 @@ + selected_lib = props.linked_libraries[props.linked_libraries_index] + info_box = box.box() ++ ++ # Make entire box red if library is missing or has indirect missing ++ if selected_lib.is_missing or selected_lib.has_indirect_missing: ++ info_box.alert = True ++ + info_box.label(text=f"Selected: {selected_lib.name}") + + if selected_lib.is_missing: + row = info_box.row() +- row.alert = True # Make the row red + row.label(text="Status: MISSING", icon='ERROR') + elif selected_lib.has_indirect_missing: + row = info_box.row() +- row.alert = True # Make the row red + row.label(text=f"Status: INDIRECT MISSING ({selected_lib.indirect_missing_count} dependencies)", icon='ERROR') + else: +``` + +
+ +--- + +Perfect! Now the entire info box will be highlighted in red when there are issues: + +## **What Changed:** + +1. **Entire Box Highlighting**: The whole info box gets `alert = True` when: + - Library is missing (`selected_lib.is_missing`) + - Library has indirect missing dependencies (`selected_lib.has_indirect_missing`) + +2. **Removed Individual Row Highlighting**: No need for `row.alert = True` since the entire box is now highlighted + +3. **Cleaner Visual Hierarchy**: The entire problematic library section stands out prominently + +## **Visual Result:** + +- **Missing Libraries**: Entire info box with red background +- **Indirect Missing Libraries**: Entire info box with red background +- **OK Libraries**: Normal info box appearance + +This makes it much easier for users to quickly spot problematic libraries at a glance. The entire box being red will draw immediate attention to any libraries that need attention, whether they're missing files or have dependency issues. + +--- + diff --git a/ui.py b/ui.py index 862d9b8..bd99815 100644 --- a/ui.py +++ b/ui.py @@ -237,14 +237,22 @@ class DLM_PT_main_panel(Panel): if props.linked_libraries and 0 <= props.linked_libraries_index < len(props.linked_libraries): selected_lib = props.linked_libraries[props.linked_libraries_index] info_box = box.box() + + # Make entire box red if library is missing or has indirect missing + if selected_lib.is_missing or selected_lib.has_indirect_missing: + info_box.alert = True + info_box.label(text=f"Selected: {selected_lib.name}") if selected_lib.is_missing: - info_box.label(text="Status: MISSING", icon='ERROR') + row = info_box.row() + row.label(text="Status: MISSING", icon='ERROR') elif selected_lib.has_indirect_missing: - info_box.label(text=f"Status: INDIRECT MISSING ({selected_lib.indirect_missing_count} dependencies)", icon='ERROR') + row = info_box.row() + row.label(text=f"Status: INDIRECT MISSING ({selected_lib.indirect_missing_count} dependencies)", icon='ERROR') else: - info_box.label(text="Status: OK", icon='FILE_BLEND') + row = info_box.row() + row.label(text="Status: OK", icon='FILE_BLEND') # Show full path and Open Blend button row = info_box.row()