Fix possible infinite recursion in asset catalog tree building #118463

Merged
Julian Eisel merged 4 commits from JulianEisel/blender:temp-asset-library-tag-catalogs-dirty into main 2024-02-21 13:02:48 +01:00
Member

PR #118382 exposed an issue where creating a catalog with non-existing
parents would trigger an endless recursion. When creating the missing
parents, the tree would be rebuilt, which would again try to create the
missing parents, for which the tree would be rebuild, etc. It just
happend to work fine for creating single catalogs with existing parents.

Rather than rebuilding the tree immediately, tag the asset library as
having "dirty" catalog data, and let code requiring the up-to-date
catalog tree (node tool menus) ensure the tree is updated if needed.

The asset library loading API should be made clearer and generally
better defined/designed, currently it's all a bit messy & confusing.

PR #118382 exposed an issue where creating a catalog with non-existing parents would trigger an endless recursion. When creating the missing parents, the tree would be rebuilt, which would again try to create the missing parents, for which the tree would be rebuild, etc. It just happend to work fine for creating single catalogs with existing parents. Rather than rebuilding the tree immediately, tag the asset library as having "dirty" catalog data, and let code requiring the up-to-date catalog tree (node tool menus) ensure the tree is updated if needed. The asset library loading API should be made clearer and generally better defined/designed, currently it's all a bit messy & confusing.
Julian Eisel added the
Interest
Asset Browser
label 2024-02-19 17:35:56 +01:00
Julian Eisel added 1 commit 2024-02-19 17:36:09 +01:00
077ffcf549 Fix possible infinite recursion in asset catalog tree building
PR #118382 exposed an issue where creating a catalog with non-existing
parents would trigger an endless recursion. When creating the missing
parents, the tree would be rebuilt, which would again try to create the
missing parents, for which the tree would be rebuild, etc. It just
happend to work fine for creating single catalogs with existing parents.

Rather than rebuilding the tree immediately, tag the asset library as
having "dirty" catalog data, and let code requiring the up-to-date
catalog tree (node tool menus) ensure the tree is updated if needed.

The asset library loading API should be made clearer and generally
better defined/designed, currently it's all a bit messy & confusing.

In my testing this exposed a thread race, a separate PR/commit will be
made for that.
Julian Eisel added this to the Brush Assets & Asset Shelf project 2024-02-19 17:36:30 +01:00
Julian Eisel requested review from Hans Goudey 2024-02-19 17:36:37 +01:00
Julian Eisel added 1 commit 2024-02-19 17:42:03 +01:00
Julian Eisel added 1 commit 2024-02-19 18:09:57 +01:00
Hans Goudey approved these changes 2024-02-19 18:12:18 +01:00
Hans Goudey left a comment
Member

Nice, this is much better, thanks.

Nice, this is much better, thanks.
Julian Eisel added 1 commit 2024-02-21 13:02:08 +01:00
Julian Eisel merged commit 56fa8c59af into main 2024-02-21 13:02:48 +01:00
Julian Eisel deleted branch temp-asset-library-tag-catalogs-dirty 2024-02-21 13:02:51 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#118463
No description provided.