diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 0be835ef4..606d0d045 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -127,7 +127,7 @@ {"name":"feedback","order":7,"path":"folders/nodes/data/iterate/feedback.yy",}, {"name":"for each","order":9,"path":"folders/nodes/data/iterate/for each.yy",}, {"name":"for filter","order":10,"path":"folders/nodes/data/iterate/for filter.yy",}, - {"name":"for sort inline","order":11,"path":"folders/nodes/data/iterate/for sort inline.yy",}, + {"name":"for sort","order":11,"path":"folders/nodes/data/iterate/for sort.yy",}, {"name":"lua","order":12,"path":"folders/nodes/data/lua.yy",}, {"name":"misc","order":10,"path":"folders/nodes/data/misc.yy",}, {"name":"MK effects","order":24,"path":"folders/nodes/data/MK effects.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index da9f97e62..b02b70788 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -154,7 +154,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"feedback","folderPath":"folders/nodes/data/iterate/feedback.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"for each","folderPath":"folders/nodes/data/iterate/for each.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"for filter","folderPath":"folders/nodes/data/iterate/for filter.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"for sort inline","folderPath":"folders/nodes/data/iterate/for sort inline.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"for sort","folderPath":"folders/nodes/data/iterate/for sort.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"for","folderPath":"folders/nodes/data/iterate/for.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"lua","folderPath":"folders/nodes/data/lua.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"misc","folderPath":"folders/nodes/data/misc.yy",}, @@ -404,8 +404,6 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"execute_shell_simple_ext_x64.dll","CopyToMask":-1,"filePath":"datafiles/report",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"options.ini","CopyToMask":-1,"filePath":"datafiles/report",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"PXC crash reporter.exe","CopyToMask":-1,"filePath":"datafiles/report",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Bevel.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"card_back.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, diff --git a/datafiles/Sample Projects/Bevel.png b/datafiles/Sample Projects/Bevel.png deleted file mode 100644 index bacf4e63e..000000000 Binary files a/datafiles/Sample Projects/Bevel.png and /dev/null differ diff --git a/datafiles/Sample Projects/Broken heart.png b/datafiles/Sample Projects/Broken heart.png index 901dc43a4..a095b20e2 100644 Binary files a/datafiles/Sample Projects/Broken heart.png and b/datafiles/Sample Projects/Broken heart.png differ diff --git a/datafiles/Sample Projects/Dice.png b/datafiles/Sample Projects/Dice.png index 6c376eb18..2d4b5bd23 100644 Binary files a/datafiles/Sample Projects/Dice.png and b/datafiles/Sample Projects/Dice.png differ diff --git a/datafiles/Sample Projects/Shiny gem.png b/datafiles/Sample Projects/Shiny gem.png index 1fad22a54..43a56f63c 100644 Binary files a/datafiles/Sample Projects/Shiny gem.png and b/datafiles/Sample Projects/Shiny gem.png differ diff --git a/datafiles/Sample Projects/Tree sway.png b/datafiles/Sample Projects/Tree sway.png index f0d07d020..9de911242 100644 Binary files a/datafiles/Sample Projects/Tree sway.png and b/datafiles/Sample Projects/Tree sway.png differ diff --git a/datafiles/Sample Projects/arrowRight.png b/datafiles/Sample Projects/arrowRight.png deleted file mode 100644 index a836920f1..000000000 Binary files a/datafiles/Sample Projects/arrowRight.png and /dev/null differ diff --git a/datafiles/Welcome files.zip b/datafiles/Welcome files.zip index 2c50593b1..560b0d34c 100644 Binary files a/datafiles/Welcome files.zip and b/datafiles/Welcome files.zip differ diff --git a/datafiles/data/Theme.zip b/datafiles/data/Theme.zip index 8395dd0de..41dae3598 100644 Binary files a/datafiles/data/Theme.zip and b/datafiles/data/Theme.zip differ diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index 53dcdddd5..8fdd5835e 100644 Binary files a/fonts/_f_sdf/_f_sdf.old.png and b/fonts/_f_sdf/_f_sdf.old.png differ diff --git a/fonts/_f_sdf/_f_sdf.png b/fonts/_f_sdf/_f_sdf.png index e81a7f9cb..31ec70297 100644 Binary files a/fonts/_f_sdf/_f_sdf.png and b/fonts/_f_sdf/_f_sdf.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.old.png b/fonts/_f_sdf_medium/_f_sdf_medium.old.png index f9a559447..c10d817ef 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.old.png and b/fonts/_f_sdf_medium/_f_sdf_medium.old.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.png b/fonts/_f_sdf_medium/_f_sdf_medium.png index 542be9766..917e58478 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.png and b/fonts/_f_sdf_medium/_f_sdf_medium.png differ diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index e79fc36a7..184eec910 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -272,7 +272,8 @@ event_inherited(); var start = category == NODE_CATEGORY? -2 : 0; for(var i = start; i < ds_list_size(category); i++) { - var name = ""; + var name = ""; + var color = noone; if(i == -2) name = "All"; else if(i == -1) name = "New"; @@ -286,14 +287,18 @@ event_inherited(); setPage(NODE_PAGE_DEFAULT); continue; } + color = context.color; draw_set_color(COLORS._main_text_accent); } } var _hov = false; - BLEND_OVERRIDE + if(sHOVER && catagory_pane.hover && point_in_rectangle(_m[0], _m[1], 0, _y + hh, category_width - ui(32), _y + hh + hg - 1)) { + BLEND_OVERRIDE draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y + hh, category_width - ui(32), hg, CDEF.main_white, 1); + BLEND_NORMAL + _hov = true; if(i != ADD_NODE_PAGE && mouse_click(mb_left, sFOCUS)) { @@ -303,7 +308,6 @@ event_inherited(); content_pane.scroll_y_to = 0; } } - BLEND_NORMAL var cc = COLORS._main_text_inner; @@ -319,7 +323,7 @@ event_inherited(); } if(i == ADD_NODE_PAGE) draw_set_text(f_p0b, fa_left, fa_center, COLORS._main_text_accent); - else draw_set_text(f_p0, fa_left, fa_center, cc); + else draw_set_text(f_p0, fa_left, fa_center, cc); var _is_extra = name == "Extra"; name = __txt(name); diff --git a/scripts/node_VFX_group_inline/node_VFX_group_inline.gml b/scripts/node_VFX_group_inline/node_VFX_group_inline.gml index b3bb483f9..090cb8a53 100644 --- a/scripts/node_VFX_group_inline/node_VFX_group_inline.gml +++ b/scripts/node_VFX_group_inline/node_VFX_group_inline.gml @@ -3,14 +3,17 @@ function Node_VFX_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline( color = COLORS.node_blend_vfx; icon = THEME.vfx; + is_root = false; + topoList = ds_list_create(); + inputs[| 0] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true ) .rejectArray(); - topoList = ds_list_create(); - update_on_frame = true; managedRenderOrder = true; + prev_nodes = []; + if(!LOADING && !APPENDING && !CLONING) { #region var input = nodeBuild("Node_VFX_Spawner", x, y); var output = nodeBuild("Node_VFX_Renderer", x + 256, y); @@ -21,10 +24,18 @@ function Node_VFX_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline( addNode(output); } #endregion - static getNextNodes = function() { #region - return __nodeLeafList(nodes); + static clearTopoSorted = function() { INLINE topoSorted = false; prev_nodes = []; } + + static getPreviousNodes = function() { #region + onGetPreviousNodes(prev_nodes); + return prev_nodes; } #endregion + static onRemoveNode = function(node) { node.in_VFX = noone; } + static onAddNode = function(node) { node.in_VFX = self; } + + static getNextNodes = function() { return __nodeLeafList(nodes); } + static reset = function() { #region for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) { var node = nodes[| i]; diff --git a/scripts/node_VFX_spawner/node_VFX_spawner.gml b/scripts/node_VFX_spawner/node_VFX_spawner.gml index c9048044d..76ce2e918 100644 --- a/scripts/node_VFX_spawner/node_VFX_spawner.gml +++ b/scripts/node_VFX_spawner/node_VFX_spawner.gml @@ -83,23 +83,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y } } #endregion - static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region - var spr = getInputData(0); - - if(spr == 0) { - if(!is_surface(def_surface)) - return; - spr = def_surface; - } - - if(is_array(spr)) - spr = spr[safe_mod(round(current_time / 100), array_length(spr))]; - - var cx = xx + w * _s / 2; - var cy = yy + h * _s / 2; - var ss = min((w - 8) / surface_get_width_safe(spr), (h - 8) / surface_get_height_safe(spr)) * _s; - draw_surface_align(spr, cx, cy, ss, fa_center, fa_center); - } #endregion + static getGraphPreviewSurface = function() { return getInputData(0); } getPreviewingNode = VFX_PREVIEW_NODE; } \ No newline at end of file diff --git a/scripts/node_collection_inline/node_collection_inline.gml b/scripts/node_collection_inline/node_collection_inline.gml index 69718c62d..ef49a02d0 100644 --- a/scripts/node_collection_inline/node_collection_inline.gml +++ b/scripts/node_collection_inline/node_collection_inline.gml @@ -14,22 +14,35 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c input_node_type = noone; output_node_type = noone; + is_root = true; + + static topoSortable = function() { #region + return false; + } #endregion + static removeNode = function(node) { #region array_remove(attributes.members, node.node_id); + ds_list_remove(nodes, node); array_remove(node.context_data, self); + onRemoveNode(node); } #endregion + static onRemoveNode = function(node) {} + static addNode = function(node) { #region - if(array_exists(attributes.members, node.node_id)) return; + array_push_unique(attributes.members, node.node_id); - array_push(attributes.members, node.node_id); - ds_list_add(nodes, node); + if(!ds_list_exist(nodes, node)) + ds_list_add(nodes, node); array_push_unique(node.context_data, self); + onAddNode(node); } #endregion + static onAddNode = function(node) {} + static ccw = function(a, b, c) { return (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]); } static getNodeBorder = function(_ind, _vertex, _node) { #region @@ -58,9 +71,7 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c continue; } - var _node = PROJECT.nodeMap[? attributes.members[i]]; - array_push_unique(_node.context_data, self); - ds_list_add(nodes, _node); + addNode(PROJECT.nodeMap[? attributes.members[i]]); } } #endregion @@ -138,22 +149,20 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c group_adding = false; if(PANEL_GRAPH.node_dragging && key_mod_press(SHIFT)) { - var side = undefined; - var _list = PANEL_GRAPH.nodes_selecting; if(group_hovering) { group_adding = true; for( var i = 0, n = array_length(_list); i < n; i++ ) - array_push_unique(attributes.members, _list[i].node_id); + addNode(_list[i]); } else { for( var i = 0, n = array_length(_list); i < n; i++ ) - array_remove(attributes.members, _list[i].node_id); + removeNode(_list[i]); } if(!group_dragging) { for( var i = 0, n = array_length(_list); i < n; i++ ) - array_remove(attributes.members, _list[i].node_id); + removeNode(_list[i]); refreshMember(); refreshGroupBG(); } @@ -191,7 +200,8 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c draw_set_color(_color); group_hover_al = lerp_float(group_hover_al, group_hovering, 4); - draw_set_alpha(_sel? 0.1 : 0.025 + 0.050 * group_hover_al); + group_hovering = 0; + draw_set_alpha(_sel? 0.1 : 0.025 + 0.025 * group_hover_al); draw_primitive_begin(pr_trianglelist); var a = group_vertex[0]; @@ -208,12 +218,14 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c var v2x = _x + c[0] * _s; var v2y = _y + c[1] * _s; - draw_vertex(v0x, v0y); - draw_vertex(v1x, v1y); - draw_vertex(v2x, v2y); + draw_vertex(round(v0x), round(v0y)); + draw_vertex(round(v1x), round(v1y)); + draw_vertex(round(v2x), round(v2y)); - if(!_hov && point_in_triangle(_mx, _my, v0x, v0y, v1x, v1y, v2x, v2y)) + if(!_hov && point_in_triangle(_mx, _my, v0x, v0y, v1x, v1y, v2x, v2y)) { + group_hovering = 1 + key_mod_press(SHIFT) * 2; _hov = true; + } b = group_vertex[i]; } @@ -232,7 +244,6 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c draw_set_alpha(1); - group_hovering = _hov; return _hov; } #endregion diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 5bcd98c95..6dd3d5ab2 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -210,6 +210,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x temp_surface = []; force_requeue = false; + in_VFX = false; + is_group_io = false; #endregion @@ -683,7 +685,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x LOG_BLOCK_END(); } #endregion + static clearTopoSorted = function() { INLINE topoSorted = false; } + static forwardPassiveDynamic = function() { #region + rendered = false; + for( var i = 0, n = ds_list_size(outputs); i < n; i++ ) { var _outp = outputs[| i]; @@ -692,6 +698,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(!_to.node.active || _to.value_from != _outp) continue; _to.node.passiveDynamic = true; + _to.node.rendered = false; } } } #endregion @@ -701,10 +708,10 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(_clearCache) clearInputCache(); } #endregion - static isLeaf = function() { #region + static isLeaf = function(list = noone) { #region for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) { var _inp = inputs[| i]; - if(!_inp.isLeaf()) return false; + if(!_inp.isLeaf(list)) return false; } return true; @@ -722,6 +729,32 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x return true; } #endregion + static getPreviousNodes = function() { #region + var prev = []; + + for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) { + var _in = inputs[| i]; + + if(_in.value_from != noone) { + if(in_VFX && !_in.value_from.node.in_VFX) { + array_push(in_VFX.prev_nodes, _in.value_from.node); + array_push(prev, in_VFX); + continue; + } + + array_push_unique(prev, _in.value_from.node); + } + + if(_in.value_from_loop != noone) + array_push_unique(prev, _in.value_from_loop); + } + + onGetPreviousNodes(prev); + return prev; + } #endregion + + static onGetPreviousNodes = function(arr) {} + static getNextNodes = function() { #region var nodes = []; var nodeNames = []; @@ -732,8 +765,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x for(var i = 0; i < ds_list_size(outputs); i++) { var _ot = outputs[| i]; - if(!_ot.forward) continue; - if(_ot.type == VALUE_TYPE.node) continue; + if(!_ot.forward) continue; for( var j = 0, n = array_length(_ot.value_to_loop); j < n; j++ ) { var _to = _ot.value_to_loop[j]; diff --git a/scripts/node_feedback_inline/node_feedback_inline.gml b/scripts/node_feedback_inline/node_feedback_inline.gml index 427c0639b..86cfa0113 100644 --- a/scripts/node_feedback_inline/node_feedback_inline.gml +++ b/scripts/node_feedback_inline/node_feedback_inline.gml @@ -4,6 +4,7 @@ function Node_Feedback_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) con icon = THEME.feedback; icon_24 = THEME.feedback_24; + is_root = false; selectable = false; update_on_frame = true; diff --git a/scripts/node_iterate_each_inline/node_iterate_each_inline.gml b/scripts/node_iterate_each_inline/node_iterate_each_inline.gml index 31fb93988..c5302ab36 100644 --- a/scripts/node_iterate_each_inline/node_iterate_each_inline.gml +++ b/scripts/node_iterate_each_inline/node_iterate_each_inline.gml @@ -2,6 +2,7 @@ function Node_Iterate_Each_Inline(_x, _y, _group = noone) : Node_Collection_Inli name = "Loop Array"; color = COLORS.node_blend_loop; + is_root = false; input_node = noone; output_node = noone; diff --git a/scripts/node_iterate_filter_inline/node_iterate_filter_inline.gml b/scripts/node_iterate_filter_inline/node_iterate_filter_inline.gml index 433836126..c7530cf3f 100644 --- a/scripts/node_iterate_filter_inline/node_iterate_filter_inline.gml +++ b/scripts/node_iterate_filter_inline/node_iterate_filter_inline.gml @@ -2,6 +2,7 @@ function Node_Iterate_Filter_Inline(_x, _y, _group = noone) : Node_Collection_In name = "Filter Array"; color = COLORS.node_blend_loop; + is_root = false; input_node = noone; output_node = noone; diff --git a/scripts/node_iterate_inline/node_iterate_inline.gml b/scripts/node_iterate_inline/node_iterate_inline.gml index be53d45b8..0a6cd8549 100644 --- a/scripts/node_iterate_inline/node_iterate_inline.gml +++ b/scripts/node_iterate_inline/node_iterate_inline.gml @@ -4,6 +4,8 @@ function Node_Iterate_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x icon = THEME.loop; icon_24 = THEME.loop_24; + is_root = false; + inputs[| 0] = nodeValue("Repeat", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1 ) .uncache(); diff --git a/scripts/node_iterate_sort_inline/node_iterate_sort_inline.gml b/scripts/node_iterate_sort_inline/node_iterate_sort_inline.gml index c47326022..0f9d7644f 100644 --- a/scripts/node_iterate_sort_inline/node_iterate_sort_inline.gml +++ b/scripts/node_iterate_sort_inline/node_iterate_sort_inline.gml @@ -2,6 +2,7 @@ function Node_Iterate_Sort_Inline(_x, _y, _group = noone) : Node_Collection_Inli name = "Sort Array"; color = COLORS.node_blend_loop; + is_root = false; topoList = ds_list_create(); input_node = noone; @@ -143,10 +144,7 @@ function Node_Iterate_Sort_Inline(_x, _y, _group = noone) : Node_Collection_Inli arrOut = array_clone(arrIn); - print($"===== Sort begin ====="); quickSort(arrOut, 0, array_length(arrOut) - 1); - print($"Sorted {arrIn} > {arrOut}") - output_node.outputs[| 0].setValue(arrOut); } #endregion diff --git a/scripts/node_iterate_sort_inline/node_iterate_sort_inline.yy b/scripts/node_iterate_sort_inline/node_iterate_sort_inline.yy index 76aeb45bb..e48423e4e 100644 --- a/scripts/node_iterate_sort_inline/node_iterate_sort_inline.yy +++ b/scripts/node_iterate_sort_inline/node_iterate_sort_inline.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "for sort inline", - "path": "folders/nodes/data/iterate/for sort inline.yy", + "name": "for sort", + "path": "folders/nodes/data/iterate/for sort.yy", }, } \ No newline at end of file diff --git a/scripts/node_iterator_each_inline_input/node_iterator_each_inline_input.gml b/scripts/node_iterator_each_inline_input/node_iterator_each_inline_input.gml index ffded4a61..927480e36 100644 --- a/scripts/node_iterator_each_inline_input/node_iterator_each_inline_input.gml +++ b/scripts/node_iterator_each_inline_input/node_iterator_each_inline_input.gml @@ -8,6 +8,10 @@ function Node_Iterator_Each_Inline_Input(_x, _y, _group = noone) : Node(_x, _y, outputs[| 0] = nodeValue("Value in", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0 ); + static onGetPreviousNodes = function(arr) { + array_push(arr, loop); + } + static update = function() { #region if(!is_instanceof(loop, Node_Iterate_Each_Inline)) return; diff --git a/scripts/node_iterator_filter_inline_input/node_iterator_filter_inline_input.gml b/scripts/node_iterator_filter_inline_input/node_iterator_filter_inline_input.gml index 25c4b9253..75d7c8e22 100644 --- a/scripts/node_iterator_filter_inline_input/node_iterator_filter_inline_input.gml +++ b/scripts/node_iterator_filter_inline_input/node_iterator_filter_inline_input.gml @@ -8,6 +8,10 @@ function Node_Iterator_Filter_Inline_Input(_x, _y, _group = noone) : Node(_x, _y outputs[| 0] = nodeValue("Value in", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0 ); + static onGetPreviousNodes = function(arr) { + array_push(arr, loop); + } + static update = function() { #region if(!is_instanceof(loop, Node_Iterate_Filter_Inline)) return; diff --git a/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.gml b/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.gml index 6f2b1dc84..068088fa6 100644 --- a/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.gml +++ b/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.gml @@ -9,4 +9,9 @@ function Node_Iterator_Sort_Inline_Input(_x, _y, _group = noone) : Node(_x, _y, outputs[| 0] = nodeValue("Value 1", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0 ); outputs[| 1] = nodeValue("Value 2", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0 ); + + static onGetPreviousNodes = function(arr) { + array_push(arr, loop); + } + } \ No newline at end of file diff --git a/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.yy b/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.yy index 2e083f00a..ba2491bf0 100644 --- a/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.yy +++ b/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "for sort inline", - "path": "folders/nodes/data/iterate/for sort inline.yy", + "name": "for sort", + "path": "folders/nodes/data/iterate/for sort.yy", }, } \ No newline at end of file diff --git a/scripts/node_iterator_sort_inline_output/node_iterator_sort_inline_output.yy b/scripts/node_iterator_sort_inline_output/node_iterator_sort_inline_output.yy index 959bd4a27..19100e141 100644 --- a/scripts/node_iterator_sort_inline_output/node_iterator_sort_inline_output.yy +++ b/scripts/node_iterator_sort_inline_output/node_iterator_sort_inline_output.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "for sort inline", - "path": "folders/nodes/data/iterate/for sort inline.yy", + "name": "for sort", + "path": "folders/nodes/data/iterate/for sort.yy", }, } \ No newline at end of file diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 5edc6f958..37cd345f7 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -634,8 +634,7 @@ function __initNodes() { ds_list_add(generator, "Simulation"); addNodeObject(generator, "Particle", s_node_particle, "Node_Particle", [1, Node_Particle],, "Generate particle effect."); - addNodeObject(generator, "VFX", s_node_vfx, "Node_VFX_Group", [1, Node_VFX_Group],, "Create VFX group, which generate particles that can be manipulated using different force nodes."); - addNodeObject(generator, "Inline VFX", s_node_vfx, "Node_VFX_Group_Inline", [1, Node_VFX_Group_Inline],, "Create VFX group, which generate particles that can be manipulated using different force nodes."); + addNodeObject(generator, "VFX", s_node_vfx, "Node_VFX_Group_Inline", [1, Node_VFX_Group_Inline],, "Create VFX group, which generate particles that can be manipulated using different force nodes."); addNodeObject(generator, "RigidSim", s_node_rigidSim, "Node_Rigid_Group_Inline", [1, Node_Rigid_Group_Inline],, "Create group for rigidbody simulation.").setVersion(1110); addNodeObject(generator, "SmokeSim", s_node_smokeSim_group, "Node_Fluid_Group_Inline", [1, Node_Fluid_Group_Inline],, "Create group for fluid simulation.").setVersion(1120); addNodeObject(generator, "StrandSim", s_node_strandSim, "Node_Strand_Group_Inline", [1, Node_Strand_Group_Inline], ["Hair"], "Create group for hair simulation.").setVersion(1140); @@ -745,7 +744,7 @@ function __initNodes() { addNodeObject(values, "Filter Array", s_node_filter_array, "Node_Iterate_Filter_Inline", [1, Node_Iterate_Filter_Inline],, "Filter array using condition.").setVersion(1140); addNodeObject(values, "Sort Array", s_node_sort_array, "Node_Iterate_Sort_Inline", [1, Node_Iterate_Sort_Inline],, "Sort array using node graph.").setVersion(1143); addNodeObject(values, "Parse CSV", s_node_csv_parse, "Node_Array_CSV_Parse", [1, Node_Array_CSV_Parse]).setVersion(1145); - + ds_list_add(values, "Paths"); addNodeObject(values, "Path", s_node_path, "Node_Path", [1, Node_Path]); addNodeObject(values, "Path Anchor", s_node_path_anchor, "Node_Path_Anchor", [1, Node_Path_Anchor]).setVersion(1140); @@ -1019,6 +1018,7 @@ function __initNodes() { addNodeObject(hid, "StrandSim", s_node_strandSim, "Node_Strand_Group", [1, Node_Strand_Group], ["Hair"], "Create group for hair simulation.").setVersion(1140).hideRecent(); addNodeObject(hid, "Feedback", s_node_feedback, "Node_Feedback_Inline", [1, Node_Feedback_Inline]).hideRecent(); addNodeObject(hid, "Loop", s_node_loop, "Node_Iterate_Inline", [1, Node_Iterate_Inline]).hideRecent(); + addNodeObject(hid, "VFX", s_node_vfx, "Node_VFX_Group", [1, Node_VFX_Group]).hideRecent(); addNodeObject(hid, "Loop Array", s_node_loop_array, "Node_Iterate_Each", [1, Node_Iterate_Each]).hideRecent(); addNodeObject(hid, "Loop Input", s_node_loop_array, "Node_Iterator_Each_Inline_Input", [1, Node_Iterator_Each_Inline_Input]).hideRecent(); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 658c631c3..a2c904437 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -1951,7 +1951,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return 1; } #endregion - static isLeaf = function() { INLINE return value_from == noone; } + static isLeaf = function(list = noone) { INLINE return (value_from == noone) || (list != noone && !ds_list_exist(list, value_from.node)); } static isRendered = function() { #region if(type == VALUE_TYPE.node) return true; diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index 54a0e042a..7d7f8cf78 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -21,14 +21,12 @@ function __nodeLeafList(_list) { #region for( var i = 0, n = ds_list_size(_list); i < n; i++ ) { var _node = _list[| i]; - if(!_node.active) continue; - if(!_node.isRenderActive()) continue; - if(!_node.isLeaf()) continue; + if(!_node.active) { LOG_LINE_IF(global.FLAG.render == 1, $"Reject {_node.internalName} [inactive]"); continue; } + if(!_node.isLeaf(_list)) { LOG_LINE_IF(global.FLAG.render == 1, $"Reject {_node.internalName} [not leaf]"); continue; } + if(!_node.isRenderable()) { LOG_LINE_IF(global.FLAG.render == 1, $"Reject {_node.internalName} [not renderable]"); continue; } - if(_node.isRenderable()) { - array_push(nodes, _node); - array_push(nodeNames, _node.internalName); - } + array_push(nodes, _node); + array_push(nodeNames, _node.internalName); } LOG_LINE_IF(global.FLAG.render == 1, $"Push node {nodeNames} to queue"); @@ -58,7 +56,7 @@ function NodeTopoSort() { #region repeat(amo) { var _node = PROJECT.nodeMap[? _key]; - _node.topoSorted = false; + _node.clearTopoSorted(); _key = ds_map_find_next(PROJECT.nodeMap, _key); } @@ -70,11 +68,17 @@ function NodeTopoSort() { #region function __sortGraph(_list, _nodeList) { #region var _root = []; + var _leftOver = []; for( var i = 0, n = ds_list_size(_nodeList); i < n; i++ ) { var _node = _nodeList[| i]; var _isRoot = true; + if(is_instanceof(_node, Node_Collection_Inline) && !_node.is_root) { + array_push(_leftOver, _node); + continue; + } + for( var j = 0, m = ds_list_size(_node.outputs); j < m; j++ ) { var _to = _node.outputs[| j].getJunctionTo(); @@ -91,26 +95,25 @@ function __sortGraph(_list, _nodeList) { #region if(_isRoot) array_push(_root, _node); } - var _st = ds_stack_create(); + var _st = ds_queue_create(); for( var i = 0, n = array_length(_root); i < n; i++ ) - ds_stack_push(_st, _root[i]); + ds_queue_enqueue(_st, _root[i]); - while(!ds_stack_empty(_st)) { - var _node = ds_stack_pop(_st); + while(!ds_queue_empty(_st)) { + var _node = ds_queue_dequeue(_st); if(_node.topoSorted) continue; var _childs = []; + var _prev = _node.getPreviousNodes(); - for( var i = 0, n = ds_list_size(_node.inputs); i < n; i++ ) { - var _in = _node.inputs[| i]; - var _fr = _in.value_from; + for( var i = 0, n = array_length(_prev); i < n; i++ ) { + var _in = _prev[i]; - if(_fr == noone) continue; - if(!ds_list_exist(_nodeList, _fr.node)) continue; - if(_fr.node.topoSorted) continue; + if(!ds_list_exist(_nodeList, _in)) continue; + if(_in.topoSorted) continue; - array_push(_childs, _fr.node); + array_push(_childs, _in); } if(array_empty(_childs)) { @@ -120,11 +123,16 @@ function __sortGraph(_list, _nodeList) { #region if(is_instanceof(_node, Node_Collection) && !_node.managedRenderOrder) __sortGraph(_list, _node.nodes); } else { - ds_stack_push(_st, _node); for( var i = 0, n = array_length(_childs); i < n; i++ ) - ds_stack_push(_st, _childs[i]); + ds_queue_enqueue(_st, _childs[i]); + ds_queue_enqueue(_st, _node); } } + + for( var i = 0, n = array_length(_leftOver); i < n; i++ ) { + if(!_leftOver[i].topoSorted) + ds_list_insert(_list, 0, _leftOver[i]); + } } #endregion function NodeListSort(_list, _nodeList) { #region @@ -138,9 +146,9 @@ function NodeListSort(_list, _nodeList) { #region function __nodeIsRenderLeaf(_node) { #region if(is_undefined(_node)) { LOG_IF(global.FLAG.render == 1, $"Skip undefiend [{_node}]"); return false; } if(!is_instanceof(_node, Node)) { LOG_IF(global.FLAG.render == 1, $"Skip non-node [{_node}]"); return false; } - + if(_node.is_group_io) { LOG_IF(global.FLAG.render == 1, $"Skip group IO [{_node.internalName}]"); return false; } - + if(!_node.active) { LOG_IF(global.FLAG.render == 1, $"Skip inactive [{_node.internalName}]"); return false; } if(!_node.isRenderActive()) { LOG_IF(global.FLAG.render == 1, $"Skip render inactive [{_node.internalName}]"); return false; } if(!_node.attributes.update_graph) { LOG_IF(global.FLAG.render == 1, $"Skip non-auto update [{_node.internalName}]"); return false; } @@ -172,7 +180,7 @@ function Render(partial = false, runAction = false) { #region if(reset_all) { var _key = ds_map_find_first(PROJECT.nodeMap); var amo = ds_map_size(PROJECT.nodeMap); - + repeat(amo) { var _node = PROJECT.nodeMap[? _key]; _node.setRenderStatus(false);