mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Do not directly access IfcStore.edited_objs
This commit is contained in:
@@ -324,7 +324,7 @@ class UpdateRepresentation(bpy.types.Operator, Operator):
|
|||||||
if not obj.data:
|
if not obj.data:
|
||||||
continue
|
continue
|
||||||
self.update_obj_mesh_representation(context, obj)
|
self.update_obj_mesh_representation(context, obj)
|
||||||
IfcStore.edited_objs.discard(obj)
|
tool.Ifc.finish_edit(obj)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
def update_obj_mesh_representation(self, context, obj):
|
def update_obj_mesh_representation(self, context, obj):
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ def update_railing_modifier_ifc_data(context):
|
|||||||
tool.Model.replace_object_ifc_representation(body, obj, model_representation)
|
tool.Model.replace_object_ifc_representation(body, obj, model_representation)
|
||||||
|
|
||||||
# hacky way to ensure tha ifc representation won't get tessellated at project save
|
# hacky way to ensure tha ifc representation won't get tessellated at project save
|
||||||
IfcStore.edited_objs.discard(obj)
|
tool.Ifc.finish_edit(obj)
|
||||||
|
|
||||||
elif props.railing_type == "FRAMELESS_PANEL":
|
elif props.railing_type == "FRAMELESS_PANEL":
|
||||||
tool.Ifc.edit(obj)
|
tool.Ifc.edit(obj)
|
||||||
|
|||||||
@@ -238,8 +238,7 @@ class UnlinkObject(bpy.types.Operator):
|
|||||||
for obj in objects:
|
for obj in objects:
|
||||||
was_active_object = obj == context.active_object
|
was_active_object = obj == context.active_object
|
||||||
|
|
||||||
if obj in IfcStore.edited_objs:
|
tool.Ifc.finish_edit(obj)
|
||||||
IfcStore.edited_objs.remove(obj)
|
|
||||||
|
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
if element and self.should_delete:
|
if element and self.should_delete:
|
||||||
|
|||||||
@@ -165,14 +165,16 @@ class Ifc(blenderbim.core.tool.Ifc):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def edit(cls, obj: bpy.types.Object) -> None:
|
def edit(cls, obj: bpy.types.Object) -> None:
|
||||||
|
"""Mark object as edited."""
|
||||||
IfcStore.edited_objs.add(obj)
|
IfcStore.edited_objs.add(obj)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def finish_edit(cls, obj: bpy.types.Object) -> None:
|
def finish_edit(cls, obj: bpy.types.Object) -> None:
|
||||||
try:
|
"""Unmark object as edited.
|
||||||
IfcStore.edited_objs.remove(obj)
|
|
||||||
except:
|
Method is safe to use on an object that wasn't marked as edited before.
|
||||||
pass
|
"""
|
||||||
|
IfcStore.edited_objs.discard(obj)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def resolve_uri(cls, uri):
|
def resolve_uri(cls, uri):
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ class Misc(blenderbim.core.tool.Misc):
|
|||||||
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
|
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mark_object_as_edited(cls, obj):
|
def mark_object_as_edited(cls, obj: bpy.types.Object) -> None:
|
||||||
IfcStore.edited_objs.add(obj)
|
tool.Ifc.edit(obj)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def split_objects_with_cutter(
|
def split_objects_with_cutter(
|
||||||
|
|||||||
Reference in New Issue
Block a user