mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
unlink pasted blender objects if there is no active ifc file #4619
This commit is contained in:
@@ -1446,14 +1446,13 @@ class OverridePasteBuffer(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
bpy.ops.view3d.pastebuffer()
|
bpy.ops.view3d.pastebuffer()
|
||||||
if IfcStore.get_file():
|
for obj in context.selected_objects:
|
||||||
for obj in context.selected_objects:
|
# Pasted objects may come from another Blender session, or even
|
||||||
# Pasted objects may come from another Blender session, or even
|
# from the same session where the original object has since
|
||||||
# from the same session where the original object has since
|
# been deleted. As the source element may not exist, paste will
|
||||||
# been deleted. As the source element may not exist, paste will
|
# always unlink the element. If you want to duplicate an
|
||||||
# always unlink the element. If you want to duplicate an
|
# element, use the duplicate commands.
|
||||||
# element, use the duplicate commands.
|
tool.Root.unlink_object(obj)
|
||||||
tool.Root.unlink_object(obj)
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user