Skip to content

Commit

Permalink
prevent runtime error when selecting untriangulated faces
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorPresto committed Apr 11, 2024
1 parent 31e9969 commit 9bd242b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions i_scene_cp77_gltf/exporters/glb_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def export_cyberpunk_glb(context, filepath, export_poses, export_visible, limit_
for face in mesh.data.polygons:
if len(face.vertices) != 3:
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_mode(type='FACE')
bpy.ops.mesh.select_face_by_sides(number=3, type='NOTEQUAL', extend=False)
bpy.ops.cp77.message_box('INVOKE_DEFAULT', message="All faces must be triangulated before exporting. Untriangulated faces have been selected for you")
return {'CANCELLED'}
Expand Down

0 comments on commit 9bd242b

Please sign in to comment.