mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
Geometry for arbitrary objects is now synced for mirrored objects
This commit is contained in:
committed by
Ryan Schultz
parent
e6ad9c63c5
commit
bd5102b4bb
@@ -549,13 +549,6 @@ class UpdateRepresentation(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
objs = [bpy.data.objects[obj_name]] if obj_name else context.selected_objects
|
objs = [bpy.data.objects[obj_name]] if obj_name else context.selected_objects
|
||||||
self.file = tool.Ifc.get()
|
self.file = tool.Ifc.get()
|
||||||
|
|
||||||
# Tessellated face sets (IfcTriangulatedFaceSet/IfcPolygonalFaceSet) were
|
|
||||||
# introduced in IFC4 and do not exist in IFC2X3. Catch this early so we
|
|
||||||
# don't silently fall back to a faceted brep after stripping materials.
|
|
||||||
if self.ifc_representation_class == "IfcTessellatedFaceSet" and self.file.schema == "IFC2X3":
|
|
||||||
self.report({"ERROR"}, "Tessellated face sets are not supported in IFC2X3.")
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
for obj in objs:
|
for obj in objs:
|
||||||
# TODO: write unit tests to see how this bulk operation handles
|
# TODO: write unit tests to see how this bulk operation handles
|
||||||
# contradictory ifc_representation_class values and when
|
# contradictory ifc_representation_class values and when
|
||||||
@@ -893,16 +886,6 @@ class OverrideDelete(bpy.types.Operator):
|
|||||||
# Track aggregates before deleting their parts
|
# Track aggregates before deleting their parts
|
||||||
aggregates_to_check = self.track_aggregates(objects_to_remove)
|
aggregates_to_check = self.track_aggregates(objects_to_remove)
|
||||||
|
|
||||||
# Snapshot the set of IFC entity ids being deleted in this batch so the
|
|
||||||
# connection-rel cascade inside `delete_ifc_object` can suppress
|
|
||||||
# partner-side regenerate when the partner is also about to vanish.
|
|
||||||
batch_being_deleted_ids: set[int] = set()
|
|
||||||
for obj in objects_to_remove:
|
|
||||||
if not tool.Blender.is_valid_data_block(obj):
|
|
||||||
continue
|
|
||||||
if (entity := tool.Ifc.get_entity(obj)) is not None:
|
|
||||||
batch_being_deleted_ids.add(entity.id())
|
|
||||||
|
|
||||||
clear_active_object = True
|
clear_active_object = True
|
||||||
|
|
||||||
for i, obj in enumerate(objects_to_remove, 1):
|
for i, obj in enumerate(objects_to_remove, 1):
|
||||||
@@ -944,7 +927,7 @@ class OverrideDelete(bpy.types.Operator):
|
|||||||
if tool.Drawing.is_auto_annotation(element):
|
if tool.Drawing.is_auto_annotation(element):
|
||||||
self.report({"INFO"}, "References cannot be deleted. Exclude the referenced element instead.")
|
self.report({"INFO"}, "References cannot be deleted. Exclude the referenced element instead.")
|
||||||
continue
|
continue
|
||||||
tool.Geometry.delete_ifc_object(obj, batch_being_deleted_ids=batch_being_deleted_ids)
|
tool.Geometry.delete_ifc_object(obj)
|
||||||
elif tool.Geometry.is_representation_item(obj):
|
elif tool.Geometry.is_representation_item(obj):
|
||||||
tool.Geometry.delete_ifc_item(obj)
|
tool.Geometry.delete_ifc_item(obj)
|
||||||
else:
|
else:
|
||||||
@@ -1043,10 +1026,7 @@ class OverrideDelete(bpy.types.Operator):
|
|||||||
pset = ifcopenshell.util.element.get_pset(element, "BBIM_Array")
|
pset = ifcopenshell.util.element.get_pset(element, "BBIM_Array")
|
||||||
if not pset:
|
if not pset:
|
||||||
continue
|
continue
|
||||||
try:
|
array_parents.add(ifc_file.by_guid(pset["Parent"]))
|
||||||
array_parents.add(ifc_file.by_guid(pset["Parent"]))
|
|
||||||
except RuntimeError:
|
|
||||||
continue
|
|
||||||
|
|
||||||
for array_parent in array_parents:
|
for array_parent in array_parents:
|
||||||
array_parent_obj = tool.Ifc.get_object(array_parent)
|
array_parent_obj = tool.Ifc.get_object(array_parent)
|
||||||
@@ -3209,7 +3189,7 @@ class EnableEditingRepresentationItems(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
product_reps = element.RepresentationMaps
|
product_reps = element.RepresentationMaps
|
||||||
item_aspect = {}
|
item_aspect = {}
|
||||||
for product_rep in product_reps:
|
for product_rep in product_reps:
|
||||||
for aspect in getattr(product_rep, "HasShapeAspects", ()):
|
for aspect in product_rep.HasShapeAspects:
|
||||||
for aspect_rep in aspect.ShapeRepresentations:
|
for aspect_rep in aspect.ShapeRepresentations:
|
||||||
if aspect_rep.ContextOfItems != representation.ContextOfItems:
|
if aspect_rep.ContextOfItems != representation.ContextOfItems:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user