diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-05-21 11:09:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 11:09:37 +0200 |
commit | 6c2420bc38eb48fd69cf6a7abb9bf7c9899eec36 (patch) | |
tree | d2f3131517e06a1b675a29b7d4b100d63fc032de /modules/gltf | |
parent | d5f9f58b61c2430ee5fae59a0366581482a3b636 (diff) | |
parent | 5a9eee6b1a2f633935cfcbbe5f938263dd092e8e (diff) |
Merge pull request #48912 from lyuma/gltf_graceful_fail_mesh
Fail gracefully when a mesh fails to import.
Diffstat (limited to 'modules/gltf')
-rw-r--r-- | modules/gltf/gltf_document.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 7b0392fbc1..798034837a 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -5978,13 +5978,15 @@ void GLTFDocument::_process_mesh_instances(Ref<GLTFState> state, Node *scene_roo const GLTFSkinIndex skin_i = node->skin; Map<GLTFNodeIndex, Node *>::Element *mi_element = state->scene_nodes.find(node_i); + ERR_CONTINUE_MSG(mi_element == nullptr, vformat("Unable to find node %d", node_i)); + EditorSceneImporterMeshNode3D *mi = Object::cast_to<EditorSceneImporterMeshNode3D>(mi_element->get()); - ERR_FAIL_COND(mi == nullptr); + ERR_CONTINUE_MSG(mi == nullptr, vformat("Unable to cast node %d of type %s to EditorSceneImporterMeshNode3D", node_i, mi_element->get()->get_class_name())); const GLTFSkeletonIndex skel_i = state->skins.write[node->skin]->skeleton; Ref<GLTFSkeleton> gltf_skeleton = state->skeletons.write[skel_i]; Skeleton3D *skeleton = gltf_skeleton->godot_skeleton; - ERR_FAIL_COND(skeleton == nullptr); + ERR_CONTINUE_MSG(skeleton == nullptr, vformat("Unable to find Skeleton for node %d skin %d", node_i, skin_i)); mi->get_parent()->remove_child(mi); skeleton->add_child(mi); |