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

4 Commits

Author SHA1 Message Date
Julian Eisel b004db82cc Merge remote-tracking branch 'origin/main' into temp-asset-library-tag-catalogs-dirty 2024-02-21 12:54:29 +01:00
Julian Eisel 4cc87ca15b Merge branch 'main' into temp-asset-library-tag-catalogs-dirty 2024-02-19 18:09:45 +01:00
Julian Eisel b61a20acd7 Add function API comment 2024-02-19 17:41:43 +01:00
Julian Eisel 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.
2024-02-19 17:10:03 +01:00