Skip to content

Commit

Permalink
Merge pull request #49343 from theoway/node_auto_arrangement_graph_edit
Browse files Browse the repository at this point in the history
Node Auto Arrangement in GraphEdit/VisualScript/VisualShader
  • Loading branch information
fire authored Aug 10, 2021
2 parents afb4092 + 12fc3f1 commit 18bd0fe
Show file tree
Hide file tree
Showing 9 changed files with 542 additions and 1 deletion.
8 changes: 8 additions & 0 deletions doc/classes/GraphEdit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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">
Expand Down
1 change: 1 addition & 0 deletions editor/editor_themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_icon("reset", "GraphEdit", theme->get_icon("ZoomReset", "EditorIcons"));
theme->set_icon("snap", "GraphEdit", theme->get_icon("SnapGrid", "EditorIcons"));
theme->set_icon("minimap", "GraphEdit", theme->get_icon("GridMinimap", "EditorIcons"));
theme->set_icon("layout", "GraphEdit", theme->get_icon("GridLayout", "EditorIcons"));
theme->set_constant("bezier_len_pos", "GraphEdit", 80 * EDSCALE);
theme->set_constant("bezier_len_neg", "GraphEdit", 160 * EDSCALE);

Expand Down
1 change: 1 addition & 0 deletions editor/icons/GridLayout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules/visual_script/visual_script_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class VisualScriptEditor : public ScriptEditorBase {
EDIT_CUT_NODES,
EDIT_PASTE_NODES,
EDIT_CREATE_FUNCTION,
REFRESH_GRAPH
REFRESH_GRAPH,
};

enum PortAction {
Expand Down
Loading

0 comments on commit 18bd0fe

Please sign in to comment.