Skip to content

Commit f79323c

Browse files
author
rankaisija64
committed
fix
1 parent 99b58ff commit f79323c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
bl_info = {
2222
"name": "SharpOcarina Export",
2323
"author": "dr.doodong, Dragorn421, Campbell Barton, Bastien Montagne",
24-
"version": (1, 0, 5),
24+
"version": (1, 0, 6),
2525
"blender": (3, 0, 0),
2626
"location": "File > Export",
2727
"description": "Sharp Ocarina Tag Manager",

export.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,16 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict, copy_textures):
125125
import time
126126

127127
def write_file_material_info(object:bpy.types.Object, material_name:str, scene:bpy.types.Scene) -> str:
128-
if material_name == "None":
129-
return ""
130-
131128
result:str = ""
132-
material = bpy.data.materials[material_name]
129+
130+
material:bpy.types.Material = bpy.data.materials[material_name]
133131

132+
if material == None:
133+
return result
134134
if hasattr(material, "ocarina") == False:
135135
return result
136136

137+
137138
mat_data:properties.Properties_Material = material.ocarina
138139
obj_data:properties.Properties_Object = object.ocarina
139140

@@ -679,7 +680,7 @@ def findVertexGroupName(face, vWeightMap):
679680
# can be mat_image or (null)
680681
fw("g SO%s_%s_%s" % (int(time.time()),obj_group_name_base,mat_data[0],))
681682

682-
fw(write_file_material_info(ob, mat_data[0], scene))
683+
fw(write_file_material_info(ob, material_names[f_mat], scene))
683684

684685
fw("\n")
685686
if EXPORT_MTL:

0 commit comments

Comments
 (0)