aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Liebl2018-03-16 11:15:15 +0100
committerHein-Pieter van Braam2018-04-29 15:00:41 +0200
commit6e658fdcc12b3dce20c485fe67f91bb9928755d0 (patch)
treefb44f57012ec498f4d461335fbac89f463878d05
parentaedc4a4e80dbc6a19b9d69755f13943cf6aa1631 (diff)
downloadgodot-6e658fdcc12b3dce20c485fe67f91bb9928755d0.tar.gz
godot-6e658fdcc12b3dce20c485fe67f91bb9928755d0.tar.zst
godot-6e658fdcc12b3dce20c485fe67f91bb9928755d0.zip
Warn about WorldEnvironment being ignored
(cherry picked from commit 29d305599dcb095e6586ebecf6e595f85d2cfcaf)
-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 02768ac91..d5bff676c 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();
}