mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
Option to always cache geometry
Settings location - https://files.catbox.moe/5cjtc1.png
This commit is contained in:
@@ -1222,6 +1222,7 @@ class IfcImportSettings:
|
|||||||
context=None, input_file: Optional[str] = None, logger: Optional[logging.Logger] = None
|
context=None, input_file: Optional[str] = None, logger: Optional[logging.Logger] = None
|
||||||
) -> IfcImportSettings:
|
) -> IfcImportSettings:
|
||||||
scene_diff = tool.Blender.get_diff_props()
|
scene_diff = tool.Blender.get_diff_props()
|
||||||
|
prefs = tool.Blender.get_addon_preferences()
|
||||||
props = tool.Project.get_project_props()
|
props = tool.Project.get_project_props()
|
||||||
settings = IfcImportSettings()
|
settings = IfcImportSettings()
|
||||||
settings.input_file = input_file
|
settings.input_file = input_file
|
||||||
@@ -1234,7 +1235,7 @@ class IfcImportSettings:
|
|||||||
settings.should_merge_materials_by_colour = props.should_merge_materials_by_colour
|
settings.should_merge_materials_by_colour = props.should_merge_materials_by_colour
|
||||||
settings.should_load_geometry = props.should_load_geometry
|
settings.should_load_geometry = props.should_load_geometry
|
||||||
settings.should_clean_mesh = props.should_clean_mesh
|
settings.should_clean_mesh = props.should_clean_mesh
|
||||||
settings.should_cache = props.should_cache
|
settings.should_cache = prefs.should_always_cache or props.should_cache
|
||||||
settings.deflection_tolerance = props.deflection_tolerance
|
settings.deflection_tolerance = props.deflection_tolerance
|
||||||
settings.angular_tolerance = props.angular_tolerance
|
settings.angular_tolerance = props.angular_tolerance
|
||||||
settings.void_limit = props.void_limit
|
settings.void_limit = props.void_limit
|
||||||
|
|||||||
@@ -309,7 +309,14 @@ class BIMProjectProperties(PropertyGroup):
|
|||||||
),
|
),
|
||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
should_cache: BoolProperty(name="Cache", default=False)
|
should_cache: BoolProperty( # pyright: ignore[reportRedeclaration]
|
||||||
|
name="Cache",
|
||||||
|
description=(
|
||||||
|
"Cache loaded geometry to .h5 file in your cache directory (see in preferences) "
|
||||||
|
"for faster imports and geometry reloads."
|
||||||
|
),
|
||||||
|
default=False,
|
||||||
|
)
|
||||||
deflection_tolerance: FloatProperty(name="Deflection Tolerance", default=0.001)
|
deflection_tolerance: FloatProperty(name="Deflection Tolerance", default=0.001)
|
||||||
angular_tolerance: FloatProperty(name="Angular Tolerance", default=0.5)
|
angular_tolerance: FloatProperty(name="Angular Tolerance", default=0.5)
|
||||||
void_limit: IntProperty(
|
void_limit: IntProperty(
|
||||||
|
|||||||
@@ -447,6 +447,10 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
name="Disable Undo When Saving (Faster saves, no undo for you!)", default=False
|
name="Disable Undo When Saving (Faster saves, no undo for you!)", default=False
|
||||||
)
|
)
|
||||||
should_stream: BoolProperty(name="Stream Data From IFC-SPF (Only for advanced users)", default=False)
|
should_stream: BoolProperty(name="Stream Data From IFC-SPF (Only for advanced users)", default=False)
|
||||||
|
should_always_cache: BoolProperty( # pyright: ignore[reportRedeclaration]
|
||||||
|
name="Always Cache Geometry",
|
||||||
|
description="Whether to always cache geometry regardless of 'Cache' setting during Advanced Project Load.",
|
||||||
|
)
|
||||||
occurrence_name_style: bpy.props.EnumProperty(
|
occurrence_name_style: bpy.props.EnumProperty(
|
||||||
items=[("CLASS", "By Class", ""), ("TYPE", "By Type", ""), ("CUSTOM", "Custom", "")],
|
items=[("CLASS", "By Class", ""), ("TYPE", "By Type", ""), ("CUSTOM", "Custom", "")],
|
||||||
name="Occurrence Name Style",
|
name="Occurrence Name Style",
|
||||||
@@ -512,6 +516,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
bsdd_load_test_dictionaries: bool
|
bsdd_load_test_dictionaries: bool
|
||||||
should_disable_undo_on_save: bool
|
should_disable_undo_on_save: bool
|
||||||
should_stream: bool
|
should_stream: bool
|
||||||
|
should_always_cache: bool
|
||||||
occurrence_name_style: Literal["CLASS", "TYPE", "CUSTOM"]
|
occurrence_name_style: Literal["CLASS", "TYPE", "CUSTOM"]
|
||||||
occurrence_name_function: str
|
occurrence_name_function: str
|
||||||
data_dir: str
|
data_dir: str
|
||||||
@@ -605,6 +610,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
layout.prop(self, "opening_focus_opacity")
|
layout.prop(self, "opening_focus_opacity")
|
||||||
layout.prop(self, "should_disable_undo_on_save")
|
layout.prop(self, "should_disable_undo_on_save")
|
||||||
layout.prop(self, "should_stream")
|
layout.prop(self, "should_stream")
|
||||||
|
layout.prop(self, "should_always_cache")
|
||||||
layout.label(text="bSDD:")
|
layout.label(text="bSDD:")
|
||||||
layout.prop(self, "bsdd_load_preview_dictionaries")
|
layout.prop(self, "bsdd_load_preview_dictionaries")
|
||||||
layout.prop(self, "bsdd_load_inactive_dictionaries")
|
layout.prop(self, "bsdd_load_inactive_dictionaries")
|
||||||
|
|||||||
Reference in New Issue
Block a user