fix issues with adding non-existing objects
This commit is contained in:
parent
c06f5643a5
commit
2a9a7ad07d
1 changed files with 7 additions and 5 deletions
12
butils.py
12
butils.py
|
@ -403,10 +403,14 @@ def load_font_from_filepath(filepath):
|
||||||
all_objects = []
|
all_objects = []
|
||||||
for o in bpy.data.objects:
|
for o in bpy.data.objects:
|
||||||
all_objects.append(o)
|
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:
|
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
|
# must be new
|
||||||
if ("glyph" in o.keys()
|
if ("glyph" in o.keys()
|
||||||
and "face_name" 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 ("type" in o.keys() and o["type"] == "metrics")
|
||||||
and not is_metrics_object(o)
|
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"]
|
glyph_id = o["glyph"]
|
||||||
font_name = o["font_name"]
|
font_name = o["font_name"]
|
||||||
face_name = o["face_name"]
|
face_name = o["face_name"]
|
||||||
|
|
Loading…
Reference in a new issue