diff --git a/butils.py b/butils.py index 8e31766..d4d0476 100644 --- a/butils.py +++ b/butils.py @@ -403,10 +403,14 @@ def load_font_from_filepath(filepath): all_objects = [] for o in bpy.data.objects: all_objects.append(o) - for f in bpy.context.scene.abc3d_data.available_fonts.values(): - print(f"before loop available font: {f.font_name} {f.face_name}") for o in all_objects: - if o.name not in allObjectsBefore: + o_exists = True + try: + o, o.name + + except ReferenceError as e: + o_exists = False + if o_exists and o.name not in allObjectsBefore: # must be new if ("glyph" in o.keys() and "face_name" in o.keys() @@ -414,8 +418,6 @@ def load_font_from_filepath(filepath): and not ("type" in o.keys() and o["type"] == "metrics") and not is_metrics_object(o) ): - for f in bpy.context.scene.abc3d_data.available_fonts.values(): - print(f"super inside available font: {f.font_name} {f.face_name}") glyph_id = o["glyph"] font_name = o["font_name"] face_name = o["face_name"]