Project Library UI - fix library asset count not considering assets from sublibraries

As a result if all elements were assigned to sublibrary, it was showing that library itself has 0 assets and wasn't allowing to expand to see the sublibraries.
This commit is contained in:
Andrej730
2025-02-20 11:13:15 +05:00
parent 04a20b5c80
commit 79abbad796
+4
View File
@@ -372,6 +372,10 @@ class Project(bonsai.core.tool.Project):
props = cls.get_project_props()
for project_library in libraries:
library_elements = tool.Project.get_project_library_elements(project_library)
subhierarchy = libraries[project_library]
for sublibrary in subhierarchy:
sublibrary_elements = tool.Project.get_project_library_elements(sublibrary)
library_elements.update(sublibrary_elements)
props.add_library_project_library(
project_library.Name or "Unnamed", len(library_elements), project_library.id()
)