From 9bd242b2df3f93460a3108ecc9de5f55d232ddb1 Mon Sep 17 00:00:00 2001 From: DoctorPresto <111536029+DoctorPresto@users.noreply.github.com> Date: Wed, 10 Apr 2024 23:49:27 -0400 Subject: [PATCH] prevent runtime error when selecting untriangulated faces --- i_scene_cp77_gltf/exporters/glb_export.py | 1 + 1 file changed, 1 insertion(+) diff --git a/i_scene_cp77_gltf/exporters/glb_export.py b/i_scene_cp77_gltf/exporters/glb_export.py index 2ef4df1..86b5326 100644 --- a/i_scene_cp77_gltf/exporters/glb_export.py +++ b/i_scene_cp77_gltf/exporters/glb_export.py @@ -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'}