2.3 KiB
2.3 KiB
Plan to Resolve ISSUE-011: Blender nodegroup script creates empty assets for skipped items
Issue: The Blender nodegroup creation script (blenderscripts/create_nodegroups.py) creates empty asset entries in the target .blend file for assets belonging to categories that the script is designed to skip, even though it correctly identifies them as skippable.
Root Cause: The script creates the parent node group, marks it as an asset, and applies tags before checking if the asset category is one that should be skipped for full nodegroup generation.
Plan:
-
Analyze
blenderscripts/create_nodegroups.py(Completed): Confirmed that parent group creation and asset marking occur before the asset category skip check. -
Modify
blenderscripts/create_nodegroups.py:- Relocate the code block responsible for creating/updating the parent node group, marking it as an asset, and applying tags (currently lines 605-645) to after the conditional check
if asset_category not in CATEGORIES_FOR_NODEGROUP_GENERATION:(line 646). - This ensures that if an asset's category is in the list of categories to be skipped, the
continuestatement will be hit before any actions are taken to create the parent asset entry in the Blender file.
- Relocate the code block responsible for creating/updating the parent node group, marking it as an asset, and applying tags (currently lines 605-645) to after the conditional check
-
Testing:
- Use test assets that represent both categories that should and should not result in full nodegroup generation based on the
CATEGORIES_FOR_NODEGROUP_GENERATIONlist. - Run the asset processor with these test assets, ensuring the Blender script is executed.
- Inspect the resulting
.blendfile to confirm:- No
PBRSET_node groups are created for assets belonging to skipped categories. PBRSET_node groups are correctly created and populated for assets belonging to categories inCATEGORIES_FOR_NODEGROUP_GENERATION.
- No
- Use test assets that represent both categories that should and should not result in full nodegroup generation based on the
-
Update Ticket Status:
- Once the fix is implemented and verified, update the
Statusfield inTickets/ISSUE-011-blender-nodegroup-empty-assets.mdtoResolved.
- Once the fix is implemented and verified, update the
Logic Flow:
graph TD
A[create_nodegroups.py] --> B{Load Asset Metadata};
B --> C{Determine Asset Category};
C --> D{Is Category Skipped?};
D -- Yes --> E[Exit Processing for Asset];
D -- No --> F{Create/Update Parent Group};
F --> G{Mark as Asset & Add Tags};
G --> H{Proceed with Child Group Creation etc.};