diff options
author | jitspoe <jitspoe@yahoo.com> | 2021-11-22 22:40:47 -0500 |
---|---|---|
committer | jitspoe <jitspoe@yahoo.com> | 2021-11-22 22:40:47 -0500 |
commit | 8f433a1f532f7ffeaada357e53ca1fe8a30c5c94 (patch) | |
tree | 6f672566ecbbf6c7412ed494473f0424429e0f56 /modules/gltf | |
parent | dbef4bbd98b655d6f89601c9e44c679b373b3628 (diff) |
Fix crash when exporting meshes to gltf that have no skin.
Diffstat (limited to 'modules/gltf')
-rw-r--r-- | modules/gltf/gltf_document.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index fac1e61b18..f3317aeada 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -6115,7 +6115,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; + 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; |