diff --git a/butils.py b/butils.py index de645db..33349a5 100644 --- a/butils.py +++ b/butils.py @@ -486,6 +486,22 @@ def ShowMessageBox(title = "Message Box", icon = 'INFO', message=""): self.layout.label(text=n) bpy.context.window_manager.popup_menu(draw, title = title, icon = icon) +def completely_delete_objs(objs): + context_override = bpy.context.copy() + context_override["selected_objects"] = list(objs) + with bpy.context.temp_override(**context_override): + bpy.ops.object.delete() + + # remove deleted objects + # this is necessary + for g in objs: + if type(g) != type(None): + try: + bpy.data.objects.remove(g, do_unlink=True) + except ReferenceError as e: + # not important + pass + def set_text_on_curve(text_properties): # starttime = time.perf_counter_ns() mom = text_properties.text_object