improvement code cleanity

use function to completely delete objects
This commit is contained in:
themancalledjakob 2024-08-07 11:53:03 +02:00
parent f194c4cd24
commit 1bcce247e0

View file

@ -526,16 +526,17 @@ def set_text_on_curve(text_properties):
# if we regenerate.... delete objects
if regenerate:
context_override = bpy.context.copy()
context_override["selected_objects"] = list(glyph_objects)
with bpy.context.temp_override(**context_override):
bpy.ops.object.delete()
completely_delete_objects(glyph_objects)
# context_override = bpy.context.copy()
# context_override["selected_objects"] = list(glyph_objects)
# with bpy.context.temp_override(**context_override):
# bpy.ops.object.delete()
# remove deleted objects
# this is necessary
for g in glyph_objects:
if type(g) != type(None):
bpy.data.objects.remove(g, do_unlink=True)
# # remove deleted objects
# # this is necessary
# for g in glyph_objects:
# if type(g) != type(None):
# bpy.data.objects.remove(g, do_unlink=True)
text_properties.glyphs.clear()