summaryrefslogtreecommitdiff
path: root/editor/plugins/visual_shader_editor_plugin.cpp
diff options
context:
space:
mode:
authorChaosus <chaosus89@gmail.com>2019-05-02 10:00:08 +0300
committerChaosus <chaosus89@gmail.com>2019-05-02 10:00:08 +0300
commit62b7132947c52676776f8fd5cf9ccadbf49dd2f2 (patch)
tree92974c9d65b0313769e29a61e6e0faf50a8a90ad /editor/plugins/visual_shader_editor_plugin.cpp
parent9f49e50d6d6ba8ad54e1106ab3954177ecc794c2 (diff)
Fix input entries when switching to new visual shader
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.cpp')
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index f8261fe949..cd86c3890d 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -58,11 +58,9 @@ void VisualShaderNodePlugin::_bind_methods() {
void VisualShaderEditor::edit(VisualShader *p_visual_shader) {
- bool was_null = false;
+ bool first_init = false;
if (p_visual_shader) {
- if (visual_shader.is_null()) {
- was_null = true;
- }
+ first_init = true;
visual_shader = Ref<VisualShader>(p_visual_shader);
} else {
visual_shader.unref();
@@ -71,7 +69,7 @@ void VisualShaderEditor::edit(VisualShader *p_visual_shader) {
if (visual_shader.is_null()) {
hide();
} else {
- if (was_null) { // to avoid tree collapse
+ if (first_init) { // to avoid tree collapse
_update_options_menu();
}
_update_graph();