summaryrefslogtreecommitdiff
path: root/modules/gltf
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gltf')
-rw-r--r--modules/gltf/gltf_document.cpp12
-rw-r--r--modules/gltf/gltf_document.h4
2 files changed, 9 insertions, 7 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index be44f66423..ff0579a11c 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -43,6 +43,7 @@
#include "gltf_texture.h"
#include "core/crypto/crypto_core.h"
+#include "core/error/error_macros.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/json.h"
@@ -4469,9 +4470,9 @@ Error GLTFDocument::_parse_lights(Ref<GLTFState> state) {
const Dictionary &spot = d["spot"];
light->inner_cone_angle = spot["innerConeAngle"];
light->outer_cone_angle = spot["outerConeAngle"];
- ERR_FAIL_COND_V_MSG(light->inner_cone_angle >= light->outer_cone_angle, ERR_PARSE_ERROR, "The inner angle must be smaller than the outer angle.");
+ ERR_CONTINUE_MSG(light->inner_cone_angle >= light->outer_cone_angle, "The inner angle must be smaller than the outer angle.");
} else if (type != "point" && type != "directional") {
- ERR_FAIL_V_MSG(ERR_PARSE_ERROR, "Light type is unknown.");
+ ERR_CONTINUE_MSG(ERR_PARSE_ERROR, "Light type is unknown.");
}
state->lights.push_back(light);
@@ -5380,15 +5381,16 @@ void GLTFDocument::_generate_scene_node(Ref<GLTFState> state, Node *scene_parent
// and attach it to the bone_attachment
scene_parent = bone_attachment;
}
-
- // We still have not managed to make a node
if (gltf_node->mesh >= 0) {
current_node = _generate_mesh_instance(state, scene_parent, node_index);
} else if (gltf_node->camera >= 0) {
current_node = _generate_camera(state, scene_parent, node_index);
} else if (gltf_node->light >= 0) {
current_node = _generate_light(state, scene_parent, node_index);
- } else {
+ }
+
+ // We still have not managed to make a node.
+ if (!current_node) {
current_node = _generate_spatial(state, scene_parent, node_index);
}
diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h
index 3e8ea19045..7a826897a9 100644
--- a/modules/gltf/gltf_document.h
+++ b/modules/gltf/gltf_document.h
@@ -346,8 +346,8 @@ private:
Error _serialize_extensions(Ref<GLTFState> state) const;
public:
- // http://www.itu.int/rec/R-REC-BT.601
- // http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.601-7-201103-I!!PDF-E.pdf
+ // https://www.itu.int/rec/R-REC-BT.601
+ // https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.601-7-201103-I!!PDF-E.pdf
static constexpr float R_BRIGHTNESS_COEFF = 0.299f;
static constexpr float G_BRIGHTNESS_COEFF = 0.587f;
static constexpr float B_BRIGHTNESS_COEFF = 0.114f;