mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 02:47:48 +00:00
Allow user toggle if aggregates are created. Useful for artists.
This commit is contained in:
@@ -151,7 +151,8 @@ class IfcImporter():
|
||||
self.calculate_unit_scale()
|
||||
self.create_project()
|
||||
self.create_spatial_hierarchy()
|
||||
self.create_aggregates()
|
||||
if self.ifc_import_settings.should_import_aggregates:
|
||||
self.create_aggregates()
|
||||
if self.ifc_import_settings.should_import_opening_elements:
|
||||
self.create_openings_collection()
|
||||
self.purge_diff()
|
||||
@@ -570,8 +571,10 @@ class IfcImporter():
|
||||
global_id = element.Decomposes[0].RelatingObject.GlobalId
|
||||
if global_id in self.spatial_structure_elements:
|
||||
collection = self.spatial_structure_elements[global_id]['blender']
|
||||
else:
|
||||
elif self.ifc_import_settings.should_import_aggregates:
|
||||
collection = bpy.data.collections.get(f'IfcRelAggregates/{element.Decomposes[0].id()}')
|
||||
else:
|
||||
return self.place_object_in_spatial_tree(element.Decomposes[0].RelatingObject, obj)
|
||||
if collection:
|
||||
collection.objects.link(obj)
|
||||
elif hasattr(element, 'HasFillings') \
|
||||
@@ -717,4 +720,5 @@ class IfcImportSettings:
|
||||
self.should_use_legacy = False
|
||||
self.should_merge_by_class = False
|
||||
self.should_merge_by_material = False
|
||||
self.should_import_aggregates = True
|
||||
self.diff_file = None
|
||||
|
||||
@@ -101,6 +101,7 @@ class ImportIFC(bpy.types.Operator, ImportHelper):
|
||||
ifc_import_settings.should_treat_styled_item_as_material = bpy.context.scene.BIMProperties.import_should_treat_styled_item_as_material
|
||||
ifc_import_settings.should_use_cpu_multiprocessing = bpy.context.scene.BIMProperties.import_should_use_cpu_multiprocessing
|
||||
ifc_import_settings.should_use_legacy = bpy.context.scene.BIMProperties.import_should_use_legacy
|
||||
ifc_import_settings.should_import_aggregates = bpy.context.scene.BIMProperties.import_should_import_aggregates
|
||||
ifc_import_settings.should_merge_by_class = bpy.context.scene.BIMProperties.import_should_merge_by_class
|
||||
ifc_import_settings.should_merge_by_material = bpy.context.scene.BIMProperties.import_should_merge_by_material
|
||||
ifc_importer = import_ifc.IfcImporter(ifc_import_settings)
|
||||
|
||||
@@ -382,6 +382,7 @@ class BIMProperties(PropertyGroup):
|
||||
import_should_treat_styled_item_as_material: BoolProperty(name="Import Treating Styled Item as Material", default=False)
|
||||
import_should_use_legacy: BoolProperty(name="Import with Legacy Importer", default=False)
|
||||
import_should_use_cpu_multiprocessing: BoolProperty(name="Import with CPU Multiprocessing", default=False)
|
||||
import_should_import_aggregates: BoolProperty(name="Import Aggregates", default=True)
|
||||
import_should_merge_by_class: BoolProperty(name="Import and Merge by Class", default=False)
|
||||
import_should_merge_by_material: BoolProperty(name="Import and Merge by Material", default=False)
|
||||
qa_reject_element_reason: StringProperty(name="Element Rejection Reason")
|
||||
|
||||
@@ -645,6 +645,8 @@ class BIM_PT_mvd(Panel):
|
||||
|
||||
layout.label(text='Simplifications:')
|
||||
|
||||
row = layout.row()
|
||||
row.prop(bim_properties, 'import_should_import_aggregates')
|
||||
row = layout.row()
|
||||
row.prop(bim_properties, 'import_should_merge_by_class')
|
||||
row = layout.row()
|
||||
|
||||
Reference in New Issue
Block a user