summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index 07a4cf5884..777f757bb4 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -1256,12 +1256,15 @@ Error EditorSceneImporterGLTF::_parse_materials(GLTFState &state) {
}
if (mr.has("metallicFactor")) {
-
material->set_metallic(mr["metallicFactor"]);
+ } else {
+ material->set_metallic(1.0);
}
- if (mr.has("roughnessFactor")) {
+ if (mr.has("roughnessFactor")) {
material->set_roughness(mr["roughnessFactor"]);
+ } else {
+ material->set_roughness(1.0);
}
if (mr.has("metallicRoughnessTexture")) {