mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix missing project custom psets reload when changing IFC filepath #7037
This commit is contained in:
@@ -64,7 +64,11 @@ class TransactionStep(TypedDict):
|
||||
|
||||
class IfcStore:
|
||||
path: str = ""
|
||||
"""Should be set only using ``tool.Ifc.set_path``."""
|
||||
|
||||
file: Optional[ifcopenshell.file] = None
|
||||
"""Should be set only using ``tool.Ifc.set``."""
|
||||
|
||||
schema: Optional[ifcopenshell.ifcopenshell_wrapper.schema_definition] = None
|
||||
cache: Optional[ifcopenshell.ifcopenshell_wrapper.HdfSerializer] = None
|
||||
cache_path: Optional[str] = None
|
||||
|
||||
@@ -1105,7 +1105,6 @@ class LoadProjectElements(bpy.types.Operator):
|
||||
props = tool.Project.get_project_props()
|
||||
props.is_loading = False
|
||||
|
||||
tool.Project.load_pset_templates()
|
||||
tool.Project.load_default_thumbnails()
|
||||
tool.Project.set_default_context()
|
||||
tool.Project.set_default_modeling_dimensions()
|
||||
|
||||
@@ -59,6 +59,7 @@ class IfcSchema:
|
||||
return
|
||||
for path in tool.Blender.get_data_dir_paths("pset", "*.ifc"):
|
||||
self.psetqto.templates.append(ifcopenshell.open(path))
|
||||
tool.Project.load_project_pset_templates()
|
||||
|
||||
|
||||
# TODO: do we really need to load it on module import?
|
||||
|
||||
@@ -284,7 +284,7 @@ class IfcGit:
|
||||
settings.should_setup_viewport_camera = False
|
||||
ifc_importer = import_ifc.IfcImporter(settings)
|
||||
ifc_importer.execute()
|
||||
tool.Project.load_pset_templates()
|
||||
tool.Project.load_project_pset_templates()
|
||||
tool.Project.load_default_thumbnails()
|
||||
tool.Project.set_default_context()
|
||||
tool.Project.set_default_modeling_dimensions()
|
||||
|
||||
@@ -73,7 +73,7 @@ class Project(bonsai.core.tool.Project):
|
||||
bpy.ops.bim.load_type_thumbnails()
|
||||
|
||||
@classmethod
|
||||
def load_pset_templates(cls) -> None:
|
||||
def load_project_pset_templates(cls) -> None:
|
||||
props = tool.Blender.get_addon_preferences()
|
||||
pset_dir = tool.Ifc.resolve_uri(props.pset_dir)
|
||||
if os.path.isdir(pset_dir):
|
||||
|
||||
Reference in New Issue
Block a user