Fix crash when exporting gltf mesh that has no skin.

(cherry picked from commit 734b4a46bc)
This commit is contained in:
jitspoe 2021-11-22 22:44:30 -05:00 committed by Rémi Verschelde
parent 07e5022cce
commit b9d6d54746
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -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;