Skip to content

Commit

Permalink
ESE: Fixed the error when outputting 'Text' object types
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarti856 committed Feb 1, 2025
1 parent 176f4dd commit 182df8c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions io_scene_sphinx/ese_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,10 @@ def write_mesh_data(out, scene, depsgraph, scene_materials):
vertex_index_map = {v: idx for idx, v in enumerate(unique_vertices)}
uv_index_map = {uv: idx for idx, uv in enumerate(unique_uvs)}
color_index_map = {color: idx for idx, color in enumerate(unique_colors)}
mesh_materials = scene_materials[ob_main.name]

mesh_materials = []
if ob_main.name in scene_materials:
mesh_materials = scene_materials[ob_main.name]
mesh_materials_names = [m.name if m else None for m in mesh_materials]

# Start printing
Expand Down Expand Up @@ -540,9 +543,10 @@ def write_mesh_data(out, scene, depsgraph, scene_materials):

out.write('\t\t*MESH_VERTFLAGSLIST {\n')
for idx, vert in enumerate(me_verts):
flag_value = euro_vtx_flags.data[vert.index].value
if flag_value != 0:
out.write(f'\t\t\t*VFLAG %u %u\n' % (idx, flag_value))
if vert.index < len(euro_vtx_flags.data):
flag_value = euro_vtx_flags.data[vert.index].value
if flag_value != 0:
out.write(f'\t\t\t*VFLAG %u %u\n' % (idx, flag_value))
out.write('\t\t}\n') # MESH_VERTFLAGSLIST

#Close mesh block
Expand All @@ -553,7 +557,10 @@ def write_mesh_data(out, scene, depsgraph, scene_materials):
write_animation_node(out, ob_main, obj_matrix_data)

out.write(f'\t*WIREFRAME_COLOR {df} {df} {df}\n' % (ob.color[0], ob.color[1], ob.color[2]))
out.write('\t*MATERIAL_REF %d\n' % list(scene_materials.keys()).index(ob.name))

#Write material index
if ob.name in scene_materials:
out.write('\t*MATERIAL_REF %d\n' % list(scene_materials.keys()).index(ob.name))

#-------------------------------------------------------------------------------------------------------------------------------
# SHAPE KEYS
Expand Down

0 comments on commit 182df8c

Please sign in to comment.