mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Keep active object when removing from containers
This commit is contained in:
@@ -134,7 +134,7 @@ class RemoveContainer(bpy.types.Operator):
|
||||
return IfcStore.execute_ifc_operator(self, context)
|
||||
|
||||
def _execute(self, context):
|
||||
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
||||
obj = bpy.data.objects.get(self.obj, context.active_object)
|
||||
oprops = obj.BIMObjectProperties
|
||||
self.file = IfcStore.get_file()
|
||||
ifcopenshell.api.run(
|
||||
@@ -152,6 +152,7 @@ class RemoveContainer(bpy.types.Operator):
|
||||
for collection in obj.users_collection:
|
||||
collection.objects.unlink(obj)
|
||||
context.scene.collection.objects.link(obj)
|
||||
context.view_layer.objects.active = obj
|
||||
return {"FINISHED"}
|
||||
|
||||
def remove_collection(self, parent, child):
|
||||
|
||||
Reference in New Issue
Block a user