Warn about WorldEnvironment being ignored
(cherry picked from commit 29d305599d
)
This commit is contained in:
parent
aedc4a4e80
commit
6e658fdcc1
1 changed files with 9 additions and 1 deletions
|
@ -79,7 +79,11 @@ Ref<Environment> WorldEnvironment::get_environment() const {
|
||||||
|
|
||||||
String WorldEnvironment::get_configuration_warning() 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();
|
return String();
|
||||||
|
|
||||||
List<Node *> nodes;
|
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).");
|
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();
|
return String();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue