fix naming when creating font

This commit is contained in:
jrkb 2025-05-14 17:22:04 +02:00
parent 05371c3675
commit 1d4fece0ea

View file

@ -1358,7 +1358,8 @@ class ABC3D_OT_CreateFontFromObjects(bpy.types.Operator):
row = layout.row()
row.prop(self, "autodetect_names")
first_object_name = context.selected_objects[-1].name
self.font_name, self.face_name = self.do_autodetect_names(first_object_name)
if self.autodetect_names:
self.font_name, self.face_name = self.do_autodetect_names(first_object_name)
if self.autodetect_names:
scale_y = 0.5
row = layout.row()
@ -1450,8 +1451,9 @@ class ABC3D_OT_CreateFontFromObjects(bpy.types.Operator):
# glyph_id = Font.name_to_glyph(name)
name = o.name.split("_")[0]
glyph_id = Font.name_to_glyph(name)
o.name = f"{name}_{font_name}_{face_name}"
if type(glyph_id) != type(None):
if glyph_id is not None:
o["glyph"] = glyph_id
o["font_name"] = font_name
o["face_name"] = face_name