Known regressions in current commit: - No "extra" files - GLOSS map does not look corrected - "override" flag is not respected
5.7 KiB
5.7 KiB
GUI Overhaul Plan: Unified Hierarchical View
Task: Implement a UI overhaul for the Asset Processor Tool GUI to address usability issues and streamline the workflow for viewing and editing processing rules.
Context:
- A hierarchical rule system (
SourceRule,AssetRule,FileRuleinrule_structure.py) is used by the core engine (asset_processor.py). - The current GUI (
gui/main_window.py,gui/rule_hierarchy_model.py,gui/rule_editor_widget.py) uses aQTreeViewfor hierarchy, a separateRuleEditorWidgetfor editing selected items, and aQTableView(PreviewTableModel) for previewing file classifications. - Relevant files analyzed:
gui/main_window.py,gui/rule_editor_widget.py,gui/rule_hierarchy_model.py.
Identified Issues with Current UI:
- Window Resizing: Selecting Source/Asset items causes window expansion because
RuleEditorWidgetdisplays large child lists (assets,files) as simple labels. - GUI Not Updating on Add: Potential regression where adding new inputs doesn't reliably update the preview/hierarchy.
- Incorrect Source Display: Tree view shows "Source: None" instead of the input path (likely
SourceRule.input_pathis None when model receives it). - Preview Table Stale: Changes made in
RuleEditorWidget(e.g., overrides) are not reflected in thePreviewTableModelbecause the_on_rule_updatedslot inmain_window.pydoesn't trigger a refresh.
Agreed-Upon Overhaul Plan:
The goal is to create a more unified and streamlined experience by merging the hierarchy, editing overrides, and preview aspects into a single view, reducing redundancy.
-
UI Structure Redesign:
- Left Panel: Retain the existing Preset Editor panel (
main_window.py'seditor_panel) for managing preset files (.json) and their complex rules (naming patterns, map type mappings, archetype rules, etc.). - Right Panel: Replace the current three-part splitter (Hierarchy Tree, Rule Editor, Preview Table) with a single Unified Hierarchical View.
- Implementation: Use a
QTreeViewwith a customQAbstractItemModeland customQStyledItemDelegates for inline editing. - Hierarchy Display: Show Input Source(s) -> Assets -> Files.
- Visual Cues: Use distinct background colors for rows representing Inputs, Assets, and Files.
- Implementation: Use a
- Left Panel: Retain the existing Preset Editor panel (
-
Unified View Columns & Functionality:
- Column 1: Name/Hierarchy: Displays input path, asset name, or file name with indentation.
- Column 2+: Editable Attributes (Context-Dependent): Implement inline editors using delegates:
- Input Row: Optional editable field for
Supplieroverride. - Asset Row:
QComboBoxdelegate forAsset-Typeoverride (e.g.,GENERIC,DECAL,MODEL). - File Row:
QLineEditdelegate forTarget Asset Nameoverride.QComboBoxdelegate forItem-Typeoverride (e.g.,MAP-COL,MAP-NRM,EXTRA,MODEL_FILE).
- Input Row: Optional editable field for
- Column X: Status (Optional, Post-Processing): Non-editable column showing processing status icon/text (Pending, Success, Warning, Error).
- Column Y: Output Path (Optional, Post-Processing): Non-editable column showing the final output path after successful processing.
-
Data Flow and Initialization:
- When inputs are added and a preset selected,
PredictionHandlerruns. PredictionHandlergenerates theSourceRulehierarchy and predicts initialAsset-Type,Item-Type, andTarget Asset Name.- The Unified View's model is populated with this
SourceRule. - Initial values in inline editors are set based on these predicted values.
- User edits in the Unified View directly modify attributes on the
SourceRule,AssetRule, orFileRuleobjects held by the model.
- When inputs are added and a preset selected,
-
Dropdown Options Source:
- Available options in dropdowns (
Asset-Type,Item-Type) should be sourced from globally defined lists or Enums (e.g., inrule_structure.pyorconfig.py).
- Available options in dropdowns (
-
Addressing Original Issues (How the Plan Fixes Them):
- Window Resizing: Resolved by removing
RuleEditorWidget. - GUI Not Updating on Add: Fix requires ensuring
add_input_pathstriggersPredictionHandlerand updates the new Unified View model correctly. - Incorrect Source Display: Fix requires ensuring
PredictionHandlercorrectly populatesSourceRule.input_path. - Preview Table Stale: Resolved by merging preview/editing; edits are live in the main view.
- Window Resizing: Resolved by removing
Implementation Tasks:
- Modify
gui/main_window.py: Remove the right-side splitter,RuleEditorWidget,PreviewTableModel/View. Instantiate the new Unified View. Adaptadd_input_paths,start_processing,_on_rule_hierarchy_ready, etc., to interact with the new view/model. - Create/Modify Model (
gui/rule_hierarchy_model.pyor new file): Implement aQAbstractItemModelsupporting multiple columns, hierarchical data, and providing data/flags for inline editing. - Create Delegates (
gui/delegates.py?): ImplementQStyledItemDelegatesubclasses forQComboBoxandQLineEditeditors in the tree view. - Modify
gui/prediction_handler.py: Ensure it predicts initial override values (Asset-Type,Item-Type,Target Asset Name) and includes them in the data passed back to the main window (likely within theSourceRulestructure or alongside it). EnsureSourceRule.input_pathis correctly set. - Modify
gui/processing_handler.py: Update it to potentially signal back status/output path updates that can be reflected in the new Unified View model's optional columns. - Define Dropdown Sources: Add necessary Enums or lists to
rule_structure.pyorconfig.py.
This plan provides a clear path forward for implementing the UI overhaul.