diff options
-rw-r--r-- | doc/classes/EditorInspectorPlugin.xml | 14 | ||||
-rw-r--r-- | doc/classes/EditorProperty.xml | 4 | ||||
-rw-r--r-- | doc/classes/MeshTexture.xml | 10 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | scene/resources/visual_shader.cpp | 3 |
5 files changed, 23 insertions, 16 deletions
diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index dd60c479c6..f2dcd2177c 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -4,13 +4,13 @@ Plugin for adding custom property editors on inspector. </brief_description> <description> - This plugins allows adding custom property editors to [EditorInspector]. - Plugins are registered via [method EditorPlugin.add_inspector_plugin]. - When an object is edited, the [method can_handle] function is called and must return true if the object type is supported. - If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class. - Subsequently, the [method parse_category] and [method parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. - Finally [method parse_end] will be called. - On each of these calls, the "add" functions can be called. + This plugins allows adding custom property editors to [EditorInspector]. + Plugins are registered via [method EditorPlugin.add_inspector_plugin]. + When an object is edited, the [method can_handle] function is called and must return true if the object type is supported. + If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class. + Subsequently, the [method parse_category] and [method parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. + Finally [method parse_end] will be called. + On each of these calls, the "add" functions can be called. </description> <tutorials> </tutorials> diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index e187b8156b..735c270279 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -15,7 +15,7 @@ <argument index="0" name="control" type="Control"> </argument> <description> - If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. + If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. </description> </method> <method name="emit_changed"> @@ -60,7 +60,7 @@ <argument index="0" name="editor" type="Control"> </argument> <description> - Add controls with this function if you want them on the bottom (below the label). + Add controls with this function if you want them on the bottom (below the label). </description> </method> <method name="update_property" qualifiers="virtual"> diff --git a/doc/classes/MeshTexture.xml b/doc/classes/MeshTexture.xml index 915e5f07cc..d305cca482 100644 --- a/doc/classes/MeshTexture.xml +++ b/doc/classes/MeshTexture.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="MeshTexture" inherits="Texture" category="Core" version="3.2"> <brief_description> - Simple texture that uses a mesh to draw itself. + Simple texture that uses a mesh to draw itself. </brief_description> <description> - Simple texture that uses a mesh to draw itself. It's limited because flags can't be changed and region drawing is not supported. + Simple texture that uses a mesh to draw itself. It's limited because flags can't be changed and region drawing is not supported. </description> <tutorials> </tutorials> @@ -12,13 +12,13 @@ </methods> <members> <member name="base_texture" type="Texture" setter="set_base_texture" getter="get_base_texture"> - Set the base texture that the Mesh will use to draw. + Set the base texture that the Mesh will use to draw. </member> <member name="image_size" type="Vector2" setter="set_image_size" getter="get_image_size"> - Set the size of the image, needed for reference. + Set the size of the image, needed for reference. </member> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> - Set the mesh used to draw. It must be a mesh using 2D vertices. + Set the mesh used to draw. It must be a mesh using 2D vertices. </member> </members> <constants> diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 4fc323f119..a732231e17 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -351,7 +351,6 @@ void VisualShaderEditor::_update_graph() { Ref<VisualShaderNode> vsnode = visual_shader->get_node(type, nodes[n_i]); GraphNode *node = memnew(GraphNode); - graph->add_child(node); /*if (!vsnode->is_connected("changed", this, "_node_changed")) { vsnode->connect("changed", this, "_node_changed", varray(vsnode->get_instance_id()), CONNECT_DEFERRED); @@ -374,6 +373,8 @@ void VisualShaderEditor::_update_graph() { Ref<VisualShaderNodeUniform> uniform = vsnode; if (uniform.is_valid()) { + graph->add_child(node); + LineEdit *uniform_name = memnew(LineEdit); uniform_name->set_text(uniform->get_uniform_name()); node->add_child(uniform_name); @@ -537,6 +538,10 @@ void VisualShaderEditor::_update_graph() { error_label->set_text(error); node->add_child(error_label); } + + if (!uniform.is_valid()) { + graph->add_child(node); + } } for (List<VisualShader::Connection>::Element *E = connections.front(); E; E = E->next()) { @@ -757,7 +762,6 @@ void VisualShaderEditor::_connection_request(const String &p_from, int p_from_in int to = p_to.to_int(); if (!visual_shader->can_connect_nodes(type, from, p_from_index, to, p_to_index)) { - EditorNode::get_singleton()->show_warning(TTR("Unable to connect, port may be in use or connection may be invalid.")); return; } diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 4229147ba2..b8f21948c3 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -240,6 +240,9 @@ bool VisualShader::can_connect_nodes(Type p_type, int p_from_node, int p_from_po if (!g->nodes.has(p_from_node)) return false; + if (p_from_node == p_to_node) + return false; + if (p_from_port < 0 || p_from_port >= g->nodes[p_from_node].node->get_output_port_count()) return false; |