mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
assign_class - reload representation after assignment
Just to make sure user will set what was actually saved to IFC right away. To prevent confusion when they see it only after model was reloaded completely.
This commit is contained in:
@@ -290,6 +290,7 @@ class AssignClass(bpy.types.Operator, tool.Ifc.Operator):
|
||||
should_sync_changes_first=False,
|
||||
)
|
||||
else:
|
||||
# TODO: replace empty geometry meshes with empties.
|
||||
element = core.assign_class(
|
||||
tool.Ifc,
|
||||
tool.Collector,
|
||||
@@ -301,6 +302,17 @@ class AssignClass(bpy.types.Operator, tool.Ifc.Operator):
|
||||
context=ifc_context,
|
||||
ifc_representation_class=self.ifc_representation_class,
|
||||
)
|
||||
tool.Geometry.reload_representation(obj)
|
||||
|
||||
# TODO: reload representation might lead to the object being replaced by object of the other type.
|
||||
# We probably should track it somehow and keep the original selection.
|
||||
|
||||
# Validation selection.
|
||||
new_selected_objects = list(filter(tool.Blender.is_valid_data_block, current_selection[2]))
|
||||
active_object = current_selection[1]
|
||||
if active_object and not tool.Blender.is_valid_data_block(active_object):
|
||||
active_object = None
|
||||
current_selection = (current_selection[0], active_object, new_selected_objects)
|
||||
|
||||
tool.Blender.set_objects_selection(*current_selection)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user