check for None

This commit is contained in:
jrkb 2025-05-24 15:22:01 +02:00
parent 4113343e79
commit 7b4e65cbb7
2 changed files with 12 additions and 12 deletions

View file

@ -358,7 +358,7 @@ def turn_collection_hierarchy_into_path(obj):
def find_font_object(fontcollection, font_name):
fonts = find_objects_by_custom_property(fontcollection.objects, "is_font", True)
for font in fonts:
if font["font_name"] == font_name and font.parent == None:
if font["font_name"] == font_name and font.parent is None:
return font
return None
@ -375,7 +375,7 @@ def move_in_fontcollection(obj, fontcollection, allow_duplicates=False):
# parent nesting structure
# the font object
font_obj = find_font_object(fontcollection, obj["font_name"])
if font_obj == None:
if font_obj is None:
font_obj = bpy.data.objects.new(obj["font_name"], None)
font_obj.empty_display_type = "PLAIN_AXES"
fontcollection.objects.link(font_obj)
@ -386,7 +386,7 @@ def move_in_fontcollection(obj, fontcollection, allow_duplicates=False):
# the face object as a child of font object
face_obj = find_font_face_object(font_obj, obj["face_name"])
if face_obj == None:
if face_obj is None:
face_obj = bpy.data.objects.new(obj["face_name"], None)
face_obj.empty_display_type = "PLAIN_AXES"
face_obj["is_face"] = True
@ -678,8 +678,8 @@ def is_metrics_object(o):
if f"{utils.prefix()}_type" in o:
return o[f"{utils.prefix()}_type"] == "metrics"
return (
re.match(".*_metrics$", o.name) != None
or re.match(".*_metrics.[\d]{3}$", o.name) != None
re.match(".*_metrics$", o.name) is not None
or re.match(".*_metrics.[\d]{3}$", o.name) is not None
) and is_mesh(o)