mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Project library UI - fix missing elements added to parent libraries
Previously if there was library A and it had sublibrary B and then some element were directly assigned to library A, UI still wouldn't show this element and would show only elements assigned to the B, the last library in the hierarchy
This commit is contained in:
@@ -304,13 +304,14 @@ class ChangeLibraryElement(bpy.types.Operator):
|
||||
if self.breadcrumb_type == "LIBRARY":
|
||||
hierarchy = tool.Project.get_project_hierarchy(library_file)
|
||||
assert active_project_library is not None
|
||||
if active_project_library == "NO_LIBRARY" or not hierarchy[active_project_library]:
|
||||
for appendable_type in sorted(tool.Project.get_appendable_asset_types()):
|
||||
elements = library_file.by_type(appendable_type)
|
||||
if elements := filter_elements(elements):
|
||||
self.props.add_library_asset_class(appendable_type, len(elements))
|
||||
else:
|
||||
if active_project_library != "NO_LIBRARY" and hierarchy[active_project_library]:
|
||||
tool.Project.load_project_libraries_to_ui(active_project_library, hierarchy)
|
||||
|
||||
for appendable_type in sorted(tool.Project.get_appendable_asset_types()):
|
||||
elements = library_file.by_type(appendable_type)
|
||||
if elements := filter_elements(elements):
|
||||
self.props.add_library_asset_class(appendable_type, len(elements))
|
||||
|
||||
else: # breadcrumb_type CLASS.
|
||||
elements = self.library_file.by_type(self.element_name)
|
||||
elements = list(filter_elements(elements))
|
||||
|
||||
Reference in New Issue
Block a user