diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-08-15 09:03:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-15 09:03:53 +0200 |
commit | e92777c1ee6603ea4b59f58aa3230d96c4d54c3f (patch) | |
tree | 030cf83c6a1ec81cb6fd307df7753047ee7063a4 | |
parent | 4c6cf97257343a95dd9042f9441dfe5de5f39cc7 (diff) | |
parent | ae788125a0ef081c99ce7360f689e96b8739db6d (diff) |
Merge pull request #21007 from guilhermefelipecgs/disable_camera_interpolation
Disable camera interpolation when switching scene tabs
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 9 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index c3d48d498c..9782b9d1f4 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2081,6 +2081,15 @@ void SpatialEditorViewport::set_message(String p_message, float p_time) { message_time = p_time; } +void SpatialEditorPlugin::edited_scene_changed() { + for (int i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) { + SpatialEditorViewport *viewport = SpatialEditor::get_singleton()->get_editor_viewport(i); + if (viewport->is_visible()) { + viewport->notification(Control::NOTIFICATION_VISIBILITY_CHANGED); + } + } +} + void SpatialEditorViewport::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 0ebc11e5df..4057145c2f 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -741,6 +741,8 @@ public: virtual void set_state(const Dictionary &p_state); virtual void clear() { spatial_editor->clear(); } + virtual void edited_scene_changed(); + SpatialEditorPlugin(EditorNode *p_node); ~SpatialEditorPlugin(); }; |