Skip to content

Commit

Permalink
Fix crash when exporting gltf mesh that has no skin.
Browse files Browse the repository at this point in the history
(cherry picked from commit 209ac95)
  • Loading branch information
jitspoe committed Nov 23, 2021
1 parent 3970f28 commit 734b4a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6068,7 +6068,10 @@ void GLTFDocument::_convert_mesh_instances(Ref<GLTFState> state) {
int bone_cnt = skeleton->get_bone_count();
ERR_FAIL_COND(bone_cnt != gltf_skeleton->joints.size());

ObjectID gltf_skin_key = skin->get_instance_id();
ObjectID gltf_skin_key = 0;
if (skin.is_valid()) {
gltf_skin_key = skin->get_instance_id();
}
ObjectID gltf_skel_key = godot_skeleton->get_instance_id();
GLTFSkinIndex skin_gltf_i = -1;
GLTFNodeIndex root_gltf_i = -1;
Expand Down

0 comments on commit 734b4a4

Please sign in to comment.