From 296c7847f3ed18a8e06e9e931bfbb2f7e2c3be05 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Tue, 26 Dec 2023 19:28:35 +0700 Subject: [PATCH] - [Graph Panel] Fix crash when grouping nodes. --- fonts/_f_sdf/_f_sdf.old.png | Bin 82361 -> 82361 bytes fonts/_f_sdf/_f_sdf.png | Bin 82361 -> 82361 bytes fonts/_f_sdf_medium/_f_sdf_medium.old.png | Bin 59906 -> 59906 bytes fonts/_f_sdf_medium/_f_sdf_medium.png | Bin 59906 -> 59906 bytes scripts/node_collection/node_collection.gml | 8 ++++---- scripts/node_data/node_data.gml | 4 ++-- scripts/node_noise_cell/node_noise_cell.gml | 9 ++++----- scripts/node_registry/node_registry.gml | 2 +- scripts/panel_collection/panel_collection.gml | 6 +++--- .../panel_graph_export_image.gml | 11 ++++++++--- 10 files changed, 22 insertions(+), 18 deletions(-) diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index b780a81f4ddbb6f036ae28b46f394a275beb5d21..0b0acac6025d8585489a1a20d64989cdba1eeb17 100644 GIT binary patch delta 96 zcmdnl%(}CgwP6dRiKB>Fh=HM%iMf@Lp|*j6m4U&D=uH!+dpI)6V#w@dBy*{ WfUf7Au=XbgAnVh=GBXiJ_ILsWy;dU~qn7)9UFSj*PMxGW*V0iBGR|WK>W< V*YonG^a%za@O1TaS?83{1OPSX8y5fo diff --git a/fonts/_f_sdf/_f_sdf.png b/fonts/_f_sdf/_f_sdf.png index 8db92e979ca64d1499cda7572d68d46f4420d629..a8fc4304841faf9ab58175c66dcc9a33916fc255 100644 GIT binary patch delta 96 zcmdnl%(}CgwP6dRiKB>Fh=IA4si~E*iMD}(m4ShAxNpaF4@X8>3>hb`uO`zg9T^oA V(DjJQUwO>{1fH&bF6*2UngGux81Dc8 delta 96 zcmdnl%(}CgwP6dRiKB>Vh=HM%frXW+rM7{Am4U&`>`bBQ9*&H%7&0%+F0Pwi>By*{ WfUal1@`pkOAn5wj2jLn{+=D5z`O@11l3lD^pW#Aj81m{KTf!lPA8E4MCUKcg9Mbfq_Az#5JNM uC9x#csw6WvwYVfPw}8ROz{ptF&`8$^UC+y#(kFm=7(8A5T-G@yGywqpN+etW diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.png b/fonts/_f_sdf_medium/_f_sdf_medium.png index 5812e537b0d0c953f3b9b4f644e2ed587135bfc8..2f1f9dbb05607cc1727fdb413e1d67a64789bb7b 100644 GIT binary patch delta 119 zcmZp=!rXL)c|+|>5wj2jb1PF*D`OLF0|P4q1LJVtj>!{W%7&mzIB|V7VPIg;C~=J_ uNl7e8wJOQXO)V}-%q?IrGB7gMH8j#SLf0cIf8{k$4}+(xpUXO@geCxRydpFJ delta 119 zcmZp=!rXL)c|+|>5z`O@Ln{LdD^p8t0|P4qgPGZxLX#)Hlnp_bcwu&N9RmY{Mu}@g vNlIc#s#Qs5ZfbE!Vr~J0k%5u1uAz~x5xSoJ${z}WdKf%i{an^LB{Ts5&cq|e diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index d76be8ea0..e07b336ec 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -9,11 +9,11 @@ function groupNodes(nodeArray, _group = noone, record = true, check_connect = tr for(var i = 0; i < array_length(nodeArray); i++) { var node = nodeArray[i]; - if(inline_context != noone) { - array_push_unique(_ctx_nodes, inline_context); + if(node.inline_context != noone) { + array_push_unique(_ctx_nodes, node.inline_context); - for( var k = 0, n = array_length(inline_context.members); k < n; k++ ) { - if(!array_exists(nodeArray, inline_context.members[k])) { + for( var k = 0, n = array_length(node.inline_context.members); k < n; k++ ) { + if(!array_exists(nodeArray, node.inline_context.members[k])) { noti_warning("Grouping incomplete inline group is not allowed."); return; } diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 84408a76c..86034949f 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -1257,7 +1257,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var tx = xx + w * _s / 2; var ty = yy + (h + 4) * _s - 2; - if(display_parameter.show_dimension) { + if(struct_get(display_parameter, "show_dimension")) { var txt = string(getNodeDimension(_s > 0.65)); draw_text(round(tx), round(ty), txt); ty += string_height(txt) - 2; @@ -1265,7 +1265,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x draw_set_font(f_p3); - if(display_parameter.show_compute) { + if(struct_get(display_parameter, "show_compute")) { var rt = 0, unit = ""; if(render_time == 0) { diff --git a/scripts/node_noise_cell/node_noise_cell.gml b/scripts/node_noise_cell/node_noise_cell.gml index a4b566481..8dcee0c69 100644 --- a/scripts/node_noise_cell/node_noise_cell.gml +++ b/scripts/node_noise_cell/node_noise_cell.gml @@ -84,21 +84,20 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) case 3 : shader = sh_cell_noise_crystal; break; } - surface_set_target(_outSurf); - shader_set(shader); + surface_set_shader(_outSurf, shader); shader_set_f("dimension", _dim); shader_set_f("time", _tim); shader_set_f("position", _pos); - shader_set_f_map("scale", _data[2], _data[11], inputs[| 2]); + shader_set_f_map("scale", _data[2], _data[11], inputs[| 2]); shader_set_f("contrast", _con); shader_set_f("middle", _mid); shader_set_f("radiusScale", _rad); shader_set_f("radiusShatter", _sht); shader_set_i("pattern", _pat); shader_set_i("colored", _col); + draw_sprite_stretched(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1]); - shader_reset(); - surface_reset_target(); + surface_reset_shader(); return _outSurf; } diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 6f9020eaf..cf53f63ca 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -859,7 +859,7 @@ function __initNodes() { ds_list_add(node, "Shader"); addNodeObject(node, "HLSL", s_node_hlsl, "Node_HLSL", [1, Node_HLSL],, "Execute HLSL shader on a surface.").setVersion(11520); } - + ds_list_add(node, "Organize"); addNodeObject(node, "Pin", s_node_pin, "Node_Pin", [1, Node_Pin],, "Create pin to organize your connection. Can be create by double clicking on a connection line."); addNodeObject(node, "Frame", s_node_frame, "Node_Frame", [1, Node_Frame],, "Create frame surrounding nodes."); diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index a79fb4e63..3b6caec62 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -198,7 +198,7 @@ function Panel_Collection() : PanelContent() constructor { BLEND_OVERRIDE; draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size); BLEND_NORMAL; - + var meta = noone; if(variable_struct_exists(_node, "getMetadata")) meta = _node.getMetadata(); @@ -213,7 +213,7 @@ function Panel_Collection() : PanelContent() constructor { initMenu(); menuCall("collection_menu",,, contentMenu,, _menu_node); } - + if(!instance_exists(o_dialog_menubox) && meta != noone && meta != undefined) TOOLTIP = meta; } @@ -222,7 +222,7 @@ function Panel_Collection() : PanelContent() constructor { draw_sprite_stretched_ext(THEME.node_glow, 0, _boxx - 9, yy - 9, grid_size + 18, grid_size + 18, COLORS._main_value_positive, updated_prog); if(variable_struct_exists(_node, "getSpr")) _node.getSpr(); - + if(sprite_exists(_node.spr)) { var sw = sprite_get_width(_node.spr); var sh = sprite_get_height(_node.spr); diff --git a/scripts/panel_graph_export_image/panel_graph_export_image.gml b/scripts/panel_graph_export_image/panel_graph_export_image.gml index 5498e5548..a3498fa45 100644 --- a/scripts/panel_graph_export_image/panel_graph_export_image.gml +++ b/scripts/panel_graph_export_image/panel_graph_export_image.gml @@ -90,6 +90,11 @@ function graph_export_image(allList, nodeList, settings = {}) { surface_set_target(cs); DRAW_CLEAR var _params = { + show_dimension : true, + show_compute : true, + avoid_label : true, + preview_scale : 100, + x : gr_x, y : gr_y, s : scale, @@ -100,9 +105,9 @@ function graph_export_image(allList, nodeList, settings = {}) { max_layer : 1, cur_layer : 1, highlight : false, - log: true + log: true, }; - + for(var i = 0; i < ds_list_size(nodeList); i++) nodeList[| i].drawConnections(_params, true); surface_reset_target(); @@ -122,7 +127,7 @@ function graph_export_image(allList, nodeList, settings = {}) { for(var i = 0; i < ds_list_size(nodeList); i++) { var _node = nodeList[| i]; if(instanceof(_node) == "Node_Frame") continue; - var val = _node.drawNode(gr_x, gr_y, mx, my, scale); + var val = _node.drawNode(gr_x, gr_y, mx, my, scale, _params); } #endregion