From 84bd8ad20a8228e0d2842c5a0a66359a96168a95 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 16 Mar 2022 00:55:47 +0100 Subject: [PATCH] Removed VisualShaders. --- editor/editor_node.cpp | 10 - .../plugins/visual_shader_editor_plugin.cpp | 3437 ------------- editor/plugins/visual_shader_editor_plugin.h | 357 -- scene/gui/control.cpp | 2 +- scene/register_scene_types.cpp | 64 - scene/resources/visual_shader.cpp | 2960 ----------- scene/resources/visual_shader.h | 559 --- scene/resources/visual_shader_nodes.cpp | 4420 ----------------- scene/resources/visual_shader_nodes.h | 1805 ------- 9 files changed, 1 insertion(+), 13613 deletions(-) delete mode 100644 editor/plugins/visual_shader_editor_plugin.cpp delete mode 100644 editor/plugins/visual_shader_editor_plugin.h delete mode 100644 scene/resources/visual_shader.cpp delete mode 100644 scene/resources/visual_shader.h delete mode 100644 scene/resources/visual_shader_nodes.cpp delete mode 100644 scene/resources/visual_shader_nodes.h diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 4fa22b7c1..4022fc011 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -156,7 +156,6 @@ #include "editor/plugins/tile_set_editor_plugin.h" #include "editor/plugins/version_control_editor_plugin.h" #include "editor/plugins/viewport_preview_editor_plugin.h" -#include "editor/plugins/visual_shader_editor_plugin.h" #include "editor/progress_dialog.h" #include "editor/project_export.h" #include "editor/project_settings_editor.h" @@ -5902,10 +5901,6 @@ EditorNode::EditorNode() { Ref rmp; rmp.instance(); EditorInspector::add_inspector_plugin(rmp); - - Ref smp; - smp.instance(); - EditorInspector::add_inspector_plugin(smp); } editor_selection = memnew(EditorSelection); @@ -6890,7 +6885,6 @@ EditorNode::EditorNode() { add_editor_plugin(VersionControlEditorPlugin::get_singleton()); add_editor_plugin(memnew(ShaderEditorPlugin(this))); - add_editor_plugin(memnew(VisualShaderEditorPlugin(this))); add_editor_plugin(memnew(CameraEditorPlugin(this))); add_editor_plugin(memnew(ThemeEditorPlugin(this))); @@ -6964,10 +6958,6 @@ EditorNode::EditorNode() { Ref particles_mat_convert; particles_mat_convert.instance(); resource_conversion_plugins.push_back(particles_mat_convert); - - Ref vshader_convert; - vshader_convert.instance(); - resource_conversion_plugins.push_back(vshader_convert); } update_spinner_step_msec = OS::get_singleton()->get_ticks_msec(); update_spinner_step_frame = Engine::get_singleton()->get_frames_drawn(); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp deleted file mode 100644 index a0ed93588..000000000 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ /dev/null @@ -1,3437 +0,0 @@ -/*************************************************************************/ -/* visual_shader_editor_plugin.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "visual_shader_editor_plugin.h" - -#include "core/io/resource_loader.h" -#include "core/math/math_defs.h" -#include "core/os/input.h" -#include "core/os/keyboard.h" -#include "core/project_settings.h" -#include "editor/editor_log.h" -#include "editor/editor_properties.h" -#include "editor/editor_scale.h" -#include "scene/animation/animation_player.h" -#include "scene/gui/menu_button.h" -#include "scene/gui/panel.h" -#include "scene/main/viewport.h" -#include "scene/resources/visual_shader_nodes.h" -#include "servers/visual/shader_types.h" - -Control *VisualShaderNodePlugin::create_editor(const Ref &p_parent_resource, const Ref &p_node) { - if (get_script_instance()) { - return get_script_instance()->call("create_editor", p_parent_resource, p_node); - } - return nullptr; -} - -void VisualShaderNodePlugin::_bind_methods() { - BIND_VMETHOD(MethodInfo(Variant::OBJECT, "create_editor", PropertyInfo(Variant::OBJECT, "parent_resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), PropertyInfo(Variant::OBJECT, "for_node", PROPERTY_HINT_RESOURCE_TYPE, "VisualShaderNode"))); -} - -/////////////////// - -void VisualShaderEditor::edit(VisualShader *p_visual_shader) { - bool changed = false; - if (p_visual_shader) { - if (visual_shader.is_null()) { - changed = true; - } else { - if (visual_shader.ptr() != p_visual_shader) { - changed = true; - } - } - visual_shader = Ref(p_visual_shader); - if (!visual_shader->is_connected("changed", this, "_update_preview")) { - visual_shader->connect("changed", this, "_update_preview"); - } - visual_shader->set_graph_offset(graph->get_scroll_ofs() / EDSCALE); - } else { - if (visual_shader.is_valid()) { - if (visual_shader->is_connected("changed", this, "")) { - visual_shader->disconnect("changed", this, "_update_preview"); - } - } - visual_shader.unref(); - } - - if (visual_shader.is_null()) { - hide(); - } else { - if (changed) { // to avoid tree collapse - _clear_buffer(); - _update_options_menu(); - _update_preview(); - } - _update_graph(); - } -} - -void VisualShaderEditor::add_plugin(const Ref &p_plugin) { - if (plugins.find(p_plugin) != -1) { - return; - } - plugins.push_back(p_plugin); -} - -void VisualShaderEditor::remove_plugin(const Ref &p_plugin) { - plugins.erase(p_plugin); -} - -void VisualShaderEditor::clear_custom_types() { - for (int i = 0; i < add_options.size(); i++) { - if (add_options[i].is_custom) { - add_options.remove(i); - i--; - } - } -} - -void VisualShaderEditor::add_custom_type(const String &p_name, const Ref