summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2023-01-29 16:04:39 -0800
committerclayjohn <claynjohn@gmail.com>2023-01-30 12:25:49 -0800
commit90718090210f9fc2a81cb00c99a74c18b3694e34 (patch)
tree47c4f9a2a1eead96217a9d441578f0f95e8d66ef /editor
parent1a37aefbf9fbac494294f00e675f665a5f44c347 (diff)
Remove viewport_set_disable_environment in favor of viewport_set_environment_mode
This allows us to set a default value inherited by child viewports and have child viewports set the value themselves which is needed for disabling the environment in the editor
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index a1028a14c5..f3f2f771af 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -643,7 +643,7 @@ void EditorNode::_notification(int p_what) {
}
RenderingServer::get_singleton()->viewport_set_disable_2d(get_scene_root()->get_viewport_rid(), true);
- RenderingServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_environment_mode(get_viewport()->get_viewport_rid(), RenderingServer::VIEWPORT_ENVIRONMENT_DISABLED);
feature_profile_manager->notify_changed();
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index e09636d297..0f9ce89f02 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5401,11 +5401,13 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) {
canvas_item_editor->show();
canvas_item_editor->set_physics_process(true);
RenderingServer::get_singleton()->viewport_set_disable_2d(EditorNode::get_singleton()->get_scene_root()->get_viewport_rid(), false);
+ RenderingServer::get_singleton()->viewport_set_environment_mode(EditorNode::get_singleton()->get_scene_root()->get_viewport_rid(), RS::VIEWPORT_ENVIRONMENT_ENABLED);
} else {
canvas_item_editor->hide();
canvas_item_editor->set_physics_process(false);
RenderingServer::get_singleton()->viewport_set_disable_2d(EditorNode::get_singleton()->get_scene_root()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_environment_mode(EditorNode::get_singleton()->get_scene_root()->get_viewport_rid(), RS::VIEWPORT_ENVIRONMENT_DISABLED);
}
}