summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-03-23 11:27:03 +0100
committerGitHub <noreply@github.com>2018-03-23 11:27:03 +0100
commitf720d86b0bef3967d1bd65771bf2286c63914808 (patch)
tree94ab283a23e7ed37c32018da9e6f97d04e69d230 /scene
parente2e29d3e8202fd80d6398220a27e8b9bbf4add76 (diff)
parent29d305599dcb095e6586ebecf6e595f85d2cfcaf (diff)
Merge pull request #17555 from poke1024/add-worldenv-warning
Warn about WorldEnvironment being ignored
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/scenario_fx.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp
index 02768ac91f..d5bff676cb 100644
--- a/scene/3d/scenario_fx.cpp
+++ b/scene/3d/scenario_fx.cpp
@@ -79,7 +79,11 @@ Ref<Environment> WorldEnvironment::get_environment() const {
String WorldEnvironment::get_configuration_warning() const {
- if (/*!is_visible_in_tree() ||*/ !is_inside_tree() || !environment.is_valid())
+ if (!environment.is_valid()) {
+ return TTR("WorldEnvironment needs an Environment resource.");
+ }
+
+ if (/*!is_visible_in_tree() ||*/ !is_inside_tree())
return String();
List<Node *> nodes;
@@ -89,6 +93,10 @@ String WorldEnvironment::get_configuration_warning() const {
return TTR("Only one WorldEnvironment is allowed per scene (or set of instanced scenes).");
}
+ if (environment.is_valid() && get_viewport() && !get_viewport()->get_camera() && environment->get_background() != Environment::BG_CANVAS) {
+ return TTR("This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set this environment's Background Mode to Canvas (for 2D scenes).");
+ }
+
return String();
}