summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorUmang Kalra <umangkalra10@gmail.com>2021-08-11 00:44:19 +0530
committerUmang Kalra <umangkalra10@gmail.com>2021-08-11 00:44:28 +0530
commit12fc3f1eefbe43a17e88f43f805e3c118459b7a8 (patch)
treead6c13ec87585364225479ed61fc5c00c23f65b1 /doc/classes
parentda339f8ffcf4c33bb44129d718c0adde910e391d (diff)
Automatic arrangement of nodes in VisualScript/VisualShaders editors
This PR and commit adds the functionality to arrange nodes in VisualScript/VisualShader editor. The layout generated by this feature is compact, with minimum crossings between connections & uniform horizontal & vertical gaps between the nodes. This work has been sponsored by GSoC '21. Full list of additions/changes: • Added arrange_nodes() method in GraphEdit module. • This method computes new positions for all the selected nodes by forming blocks and compressing them. The nodes are moved to these new positions. • Adding this method to GraphEdit makes it available for use in VisualScript/VisualShaders editors and its other subclasses. • Button with an icon has been added to call arrange_nodes() in GraphEdit. • This button is inherited by VisualScript/VisualShaders editors to invoke the method. • Undo/redo is functional with this method. • By using signals in arrange_nodes(), position changes are registered in undo/redo stack of the subclass that is using the method. • Metadata of the method has been updated in ClassDB • Method description has been added to class reference of GraphEdit
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/GraphEdit.xml8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 2e5d2e6497..a65a88a4f2 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -32,6 +32,12 @@
Makes possible to disconnect nodes when dragging from the slot at the right if it has the specified type.
</description>
</method>
+ <method name="arrange_nodes">
+ <return type="void" />
+ <description>
+ Rearranges selected nodes in a layout with minimum crossings between connections and uniform horizontal and vertical gap between nodes.
+ </description>
+ </method>
<method name="clear_connections">
<return type="void" />
<description>
@@ -283,6 +289,8 @@
<theme_item name="grid_minor" data_type="color" type="Color" default="Color(1, 1, 1, 0.05)">
Color of minor grid lines.
</theme_item>
+ <theme_item name="layout" data_type="icon" type="Texture2D">
+ </theme_item>
<theme_item name="minimap" data_type="icon" type="Texture2D">
</theme_item>
<theme_item name="minus" data_type="icon" type="Texture2D">