From a581d4fbe1286ad190e81ab3246467472e7adab2 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Tue, 7 May 2024 11:53:51 +0700 Subject: [PATCH] 1.17.0.2 - [Loop array] Output now duplicate data instead of referencing it. - [Splice Spritesheet] Fix output empty when either width or height is set to 1. - [Splice Spritesheet] Fix vertical orientation output error. - [Atlas set] Add an option to recalculate position after applying new rotation. --- objects/o_dialog_add_node/Create_0.gml | 2 +- scripts/__node/__node.gml | 2 +- scripts/__node_module/__node_module.gml | 4 +- scripts/globals/globals.gml | 18 ++++----- scripts/node_array/node_array.gml | 2 +- scripts/node_array_add/node_array_add.gml | 2 +- .../node_array_length/node_array_length.gml | 2 +- scripts/node_array_zip/node_array_zip.gml | 4 +- .../node_ase_file_read/node_ase_file_read.gml | 2 +- scripts/node_atlas_set/node_atlas_set.gml | 28 +++++++++++++- .../node_colors_replace.gml | 2 +- scripts/node_condition/node_condition.gml | 4 +- scripts/node_data/node_data.gml | 23 +++++++----- scripts/node_dynasurf/node_dynasurf.gml | 2 +- scripts/node_export/node_export.gml | 3 +- .../node_feedback_output.gml | 2 +- .../node_group_output/node_group_output.gml | 2 +- scripts/node_image_sheet/node_image_sheet.gml | 35 +++++++++++------- .../node_iterate_each/node_iterate_each.gml | 2 +- .../node_iterate_each_inline.gml | 4 +- .../node_iterate_filter.gml | 2 +- .../node_iterate_sort/node_iterate_sort.gml | 2 +- .../node_iterator_each_inline_input.gml | 2 +- .../node_iterator_each_inline_output.gml | 14 ++++++- .../node_iterator_each_output.gml | 6 +-- .../node_iterator_filter_output.gml | 4 +- .../node_iterator_index.gml | 2 +- .../node_iterator_output.gml | 8 ++-- .../node_json_file_write.gml | 4 +- scripts/node_lua_compute/node_lua_compute.gml | 2 +- scripts/node_lua_global/node_lua_global.gml | 2 +- scripts/node_lua_surface/node_lua_surface.gml | 2 +- scripts/node_number/node_number.gml | 4 +- scripts/node_pin/node_pin.gml | 2 +- .../node_sequence_anim/node_sequence_anim.gml | 2 +- .../node_strand_render_texture.gml | 2 +- scripts/node_struct/node_struct.gml | 2 +- scripts/node_switch/node_switch.gml | 2 +- scripts/node_transform/node_transform.gml | 2 +- scripts/node_tunnel_in/node_tunnel_in.gml | 2 +- scripts/node_value/node_value.gml | 21 +++++------ scripts/node_vector2/node_vector2.gml | 2 +- .../node_vector_split/node_vector_split.gml | 2 +- scripts/panel_graph/panel_graph.gml | 6 +-- scripts/render_data/render_data.gml | 37 ++++++++++--------- 45 files changed, 164 insertions(+), 117 deletions(-) diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 81bc5dca8..e3fd23f18 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -196,7 +196,7 @@ event_inherited(); for( var i = 0; i < ds_list_size(_new_list); i++ ) { var _in = _new_list[| i].inputs; for( var j = 0; j < ds_list_size(_in); j++ ) { - if(_in[| j].isLeaf()) + if(_in[| j].value_from == noone) ds_list_add(_inputs, _in[| j]); } diff --git a/scripts/__node/__node.gml b/scripts/__node/__node.gml index 3e2366e08..943c907cb 100644 --- a/scripts/__node/__node.gml +++ b/scripts/__node/__node.gml @@ -32,7 +32,7 @@ function __Node_Base(x, y) constructor { for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) { var _inp = inputs[| i]; - if(_inp.is_anim && _inp.isLeaf()) { + if(_inp.is_anim && _inp.value_from == noone) { _cur_anim = true; break; } diff --git a/scripts/__node_module/__node_module.gml b/scripts/__node_module/__node_module.gml index 114f98cc2..a3e080a3e 100644 --- a/scripts/__node_module/__node_module.gml +++ b/scripts/__node_module/__node_module.gml @@ -9,7 +9,7 @@ function NodeModule(parent) constructor { static isLeaf = function() { #region for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) { var _inp = inputs[| i]; - if(!_inp.isLeaf()) return false; + if(_inp.value_from != noone) return false; } return true; @@ -19,7 +19,7 @@ function NodeModule(parent) constructor { for(var i = 0; i < ds_list_size(inputs); i++) { var jun = inputs[| i]; - if(jun.isLeaf()) continue; + if(jun.value_from == noone) continue; if(!jun.value_from.node.active) continue; if(!jun.isVisible()) continue; diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 0a20ed383..34237494d 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -36,9 +36,9 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION; LATEST_VERSION = 11600; - VERSION = 11701; + VERSION = 11702; SAVE_VERSION = 11690; - VERSION_STRING = "1.17.0.1"; + VERSION_STRING = "1.17.0.2"; BUILD_NUMBER = 11707; globalvar HOTKEYS, HOTKEY_CONTEXT; @@ -197,11 +197,11 @@ #endregion #region debug - global.FLAG = {}; - - global.FLAG.render = 0; - global.FLAG.renderTime = false; - global.FLAG.keyframe_override = true; - global.FLAG.wav_import = true; - global.FLAG.ase_import = false; + global.FLAG = { + render : 0, + renderTime : false, + keyframe_override : true, + wav_import : true, + ase_import : false, + }; #endregion \ No newline at end of file diff --git a/scripts/node_array/node_array.gml b/scripts/node_array/node_array.gml index d49fe62ef..d0ff0c010 100644 --- a/scripts/node_array/node_array.gml +++ b/scripts/node_array/node_array.gml @@ -107,7 +107,7 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { _l[| i].index = i; array_push(input_display_list, i); - if(i >= input_fix_len && _l[| i].isLeaf()) + if(i >= input_fix_len && _l[| i].value_from == noone) extra = false; } array_insert(input_display_list, 1, array_adjust_tool); diff --git a/scripts/node_array_add/node_array_add.gml b/scripts/node_array_add/node_array_add.gml index ca5a56fa5..c499d4221 100644 --- a/scripts/node_array_add/node_array_add.gml +++ b/scripts/node_array_add/node_array_add.gml @@ -51,7 +51,7 @@ function Node_Array_Add(_x, _y, _group = noone) : Node(_x, _y, _group) construct static update = function(frame = CURRENT_FRAME) { var _arr = getInputData(0); - if(inputs[| 0].isLeaf()) { + if(inputs[| 0].value_from == noone) { inputs[| 0].setType(VALUE_TYPE.any); outputs[| 0].setType(VALUE_TYPE.any); return; diff --git a/scripts/node_array_length/node_array_length.gml b/scripts/node_array_length/node_array_length.gml index fab080e44..dbf092703 100644 --- a/scripts/node_array_length/node_array_length.gml +++ b/scripts/node_array_length/node_array_length.gml @@ -8,7 +8,7 @@ function Node_Array_Length(_x, _y, _group = noone) : Node(_x, _y, _group) constr outputs[| 0] = nodeValue("Size", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0); static step = function() { #region - inputs[| 0].setType(inputs[| 0].isLeaf()? VALUE_TYPE.any : inputs[| 0].value_from.type); + inputs[| 0].setType(inputs[| 0].value_from == noone? VALUE_TYPE.any : inputs[| 0].value_from.type); } #endregion static update = function(frame = CURRENT_FRAME) { #region diff --git a/scripts/node_array_zip/node_array_zip.gml b/scripts/node_array_zip/node_array_zip.gml index 9c8602a71..0d2220d00 100644 --- a/scripts/node_array_zip/node_array_zip.gml +++ b/scripts/node_array_zip/node_array_zip.gml @@ -44,7 +44,7 @@ function Node_Array_Zip(_x, _y, _group = noone) : Node(_x, _y, _group) construct } #endregion static step = function() { #region - if(inputs[| 0].isLeaf()) { + if(inputs[| 0].value_from == noone) { inputs[| 0].setType(VALUE_TYPE.any); outputs[| 0].setType(VALUE_TYPE.any); } else { @@ -53,7 +53,7 @@ function Node_Array_Zip(_x, _y, _group = noone) : Node(_x, _y, _group) construct } for( var i = 0; i < ds_list_size(inputs) - 1; i += data_length ) - inputs[| i].setType(inputs[| i].isLeaf()? VALUE_TYPE.any : inputs[| i].value_from.type); + inputs[| i].setType(inputs[| i].value_from == noone? VALUE_TYPE.any : inputs[| i].value_from.type); } #endregion static update = function(frame = CURRENT_FRAME) { #region diff --git a/scripts/node_ase_file_read/node_ase_file_read.gml b/scripts/node_ase_file_read/node_ase_file_read.gml index b03159811..94e32d9ce 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -100,7 +100,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, by, _w, _h, COLORS.node_composite_bg_blend, 1); - var index = inputs[| 2].isLeaf()? inputs[| 2].is_anim : 2; + var index = inputs[| 2].value_from == noone? inputs[| 2].is_anim : 2; draw_sprite_ui_uniform(THEME.animate_clock, index, abx, lb_y, 1, index == 2? COLORS._main_accent : c_white, 0.8); if(_hover && point_in_circle(_m[0], _m[1], abx, lb_y, ui(10))) { draw_sprite_ui_uniform(THEME.animate_clock, index, abx, lb_y, 1, index == 2? COLORS._main_accent : c_white, 1); diff --git a/scripts/node_atlas_set/node_atlas_set.gml b/scripts/node_atlas_set/node_atlas_set.gml index 0c28bed0c..0098c7f30 100644 --- a/scripts/node_atlas_set/node_atlas_set.gml +++ b/scripts/node_atlas_set/node_atlas_set.gml @@ -25,8 +25,14 @@ function Node_Atlas_Set(_x, _y, _group = noone) : Node(_x, _y, _group) construct inputs[| 6] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) .setArrayDepth(1); + inputs[| 7] = nodeValue("Recalculate Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true); + outputs[| 0] = nodeValue("Atlas", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); + input_display_list = [ + 0, 1, 2, 3, 7, 4, 5, 6, + ]; + static update = function(frame = CURRENT_FRAME) { var atl = getInputData(0); @@ -41,6 +47,7 @@ function Node_Atlas_Set(_x, _y, _group = noone) : Node(_x, _y, _group) construct var scal = getInputData(4); var blns = getInputData(5); var alph = getInputData(6); + var _rot = getInputData(7); var use = array_create(7); for( var i = 1; i < 7; i++ ) use[i] = inputs[| i].value_from != noone; @@ -54,6 +61,8 @@ function Node_Atlas_Set(_x, _y, _group = noone) : Node(_x, _y, _group) construct natl[i] = _at.clone(); + var _surf = _at.surface.get(); + if(use[1]) natl[i].setSurface(array_safe_get_fast(surf, i)); if(use[2]) { @@ -62,7 +71,24 @@ function Node_Atlas_Set(_x, _y, _group = noone) : Node(_x, _y, _group) construct natl[i].y = array_safe_get_fast(pos, 1); } - if(use[3]) natl[i].rotation = array_safe_get_fast(rota, i); + if(use[3]) { + var _or = natl[i].rotation; + var _nr = array_safe_get_fast(rota, i); + + natl[i].rotation = _nr; + + if(_rot) { + var _sw = surface_get_width_safe(_surf) * natl[i].sx; + var _sh = surface_get_height_safe(_surf) * natl[i].sy; + + var p0 = point_rotate(0, 0, _sw / 2, _sh / 2, -_or); + var p1 = point_rotate(0, 0, _sw / 2, _sh / 2, _nr); + + natl[i].x = natl[i].x - p0[1] + p1[0]; + natl[i].y = natl[i].y - p0[0] + p1[1]; + } + + } if(use[4]) { var sca = array_safe_get_fast(scal, i); diff --git a/scripts/node_colors_replace/node_colors_replace.gml b/scripts/node_colors_replace/node_colors_replace.gml index 01facfcef..3bf32d278 100644 --- a/scripts/node_colors_replace/node_colors_replace.gml +++ b/scripts/node_colors_replace/node_colors_replace.gml @@ -59,7 +59,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g bx += bs + ui(4); var jun = inputs[| 2]; - var index = jun.isLeaf()? jun.is_anim : 2; + var index = jun.value_from == noone? jun.is_anim : 2; if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.animate_clock, index, index == 2? COLORS._main_accent : COLORS._main_icon) == 2) jun.setAnim(!jun.is_anim); diff --git a/scripts/node_condition/node_condition.gml b/scripts/node_condition/node_condition.gml index 85a629e5d..e33bd3aa8 100644 --- a/scripts/node_condition/node_condition.gml +++ b/scripts/node_condition/node_condition.gml @@ -54,8 +54,8 @@ function Node_Condition(_x, _y, _group = noone) : Node(_x, _y, _group) construct inputs[| 7].setVisible(_mode == 2, _mode == 2); inputs[| 8].setVisible(_mode == 2, _mode == 2); - inputs[| 3].setType(inputs[| 3].isLeaf()? VALUE_TYPE.any : inputs[| 3].value_from.type); - inputs[| 4].setType(inputs[| 4].isLeaf()? VALUE_TYPE.any : inputs[| 4].value_from.type); + inputs[| 3].setType(inputs[| 3].value_from == noone? VALUE_TYPE.any : inputs[| 3].value_from.type); + inputs[| 4].setType(inputs[| 4].value_from == noone? VALUE_TYPE.any : inputs[| 4].value_from.type); } #endregion static update = function(frame = CURRENT_FRAME) { #region diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index a94587acc..ccee578b0 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -251,7 +251,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { force_requeue = false; is_simulation = false; - in_VFX = false; + in_VFX = false; is_group_io = false; #endregion @@ -778,7 +778,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) { var _inp = inputs[| i]; - if(!_inp.isLeaf()) return false; + if(!_inp.value_from == noone) return false; } return true; @@ -790,8 +790,11 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { if(list == noone) return isLeaf(); for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) { - var _inp = inputs[| i]; - if(!_inp.isLeafList(list)) return false; + var _inp = inputs[| i].value_from; + + // print($"Checking isLeafList {inputs[| i]} < {_inp} | list {ds_list_to_array(list)}"); + if(_inp != noone && ds_list_exist(list, _inp.node)) + return false; } return true; @@ -1361,7 +1364,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { jun.draw_blend = -1; } - if(jun.isLeaf()) continue; + if( jun.value_from == noone) continue; if(!jun.value_from.node.active) continue; if(!jun.isVisible()) continue; @@ -1619,7 +1622,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { if(!PREFERENCES.connection_line_highlight_all && _depth == 1) return; for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) { - if(inputs[| i].isLeaf()) continue; + if(inputs[| i].value_from == noone) continue; inputs[| i].value_from.node.drawBranch(_depth + 1); } } #endregion @@ -1660,7 +1663,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { for(var j = 0; j < array_length(jun.value_to); j++) { var _vt = jun.value_to[j]; - if(_vt.isLeaf()) break; + if(_vt.value_from == noone) break; if(_vt.value_from.node != self) break; _vt.removeFrom(false); @@ -1668,7 +1671,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { if(!_merge) continue; for( var k = 0; k < ds_list_size(inputs); k++ ) { - if(inputs[| k].isLeaf()) continue; + if(inputs[| k].value_from == noone) continue; if(_vt.setFrom(inputs[| k].value_from)) break; } } @@ -1806,7 +1809,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) { var _input = inputs[| i]; - if(_input.isLeaf()) continue; + if(_input.value_from == noone) continue; _input.value_from.node.cachedPropagate(_group); } @@ -1825,7 +1828,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { for(var i = 0; i < ds_list_size(inputs); i++) { var _in = inputs[| i]; - if(_in.isLeaf()) continue; + if(_in.value_from == noone) continue; if(_in.value_from.node.group == group) continue; var _ind = string(_in.value_from); diff --git a/scripts/node_dynasurf/node_dynasurf.gml b/scripts/node_dynasurf/node_dynasurf.gml index 7c0c7c063..3415e26cc 100644 --- a/scripts/node_dynasurf/node_dynasurf.gml +++ b/scripts/node_dynasurf/node_dynasurf.gml @@ -99,7 +99,7 @@ function dynaSurf_output_getNextNode() { #region var _to = junc.value_to[j]; if(!_to.node.isRenderActive()) continue; - if(!_to.node.active || _to.isLeaf()) + if(!_to.node.active || _to.value_from == noone) continue; if(_to.value_from.node != group) continue; diff --git a/scripts/node_export/node_export.gml b/scripts/node_export/node_export.gml index ae2890124..dcb68608b 100644 --- a/scripts/node_export/node_export.gml +++ b/scripts/node_export/node_export.gml @@ -336,9 +336,8 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor var loop = getInputData( 5); var opti = getInputData( 6); var fuzz = getInputData( 7); - var rate = getInputData( 8); + var rate = max(1, getInputData( 8)); var qual = getInputData(10); - if(rate == 0) rate = 1; temp_path = string_replace_all(temp_path, "/", "\\"); target_path = string_replace_all(target_path, "/", "\\"); diff --git a/scripts/node_feedback_output/node_feedback_output.gml b/scripts/node_feedback_output/node_feedback_output.gml index 3f3c133cb..8101d818d 100644 --- a/scripts/node_feedback_output/node_feedback_output.gml +++ b/scripts/node_feedback_output/node_feedback_output.gml @@ -10,7 +10,7 @@ function Node_Feedback_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y cache_value = -1; static update = function(frame = CURRENT_FRAME) { - if(inputs[| 0].isLeaf()) return; + if(inputs[| 0].value_from == noone) return; if(IS_LAST_FRAME) { cache_value = noone; return; diff --git a/scripts/node_group_output/node_group_output.gml b/scripts/node_group_output/node_group_output.gml index 05856d81a..7eaabf1e8 100644 --- a/scripts/node_group_output/node_group_output.gml +++ b/scripts/node_group_output/node_group_output.gml @@ -43,7 +43,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(!_to.node.isRenderActive()) continue; //printIf(global.FLAG.render, "Value to " + _to.name); - if(!_to.node.active || _to.isLeaf()) { + if(!_to.node.active || _to.value_from == noone) { //printIf(global.FLAG.render, "no value from"); continue; } diff --git a/scripts/node_image_sheet/node_image_sheet.gml b/scripts/node_image_sheet/node_image_sheet.gml index a110ed1e7..def709d6b 100644 --- a/scripts/node_image_sheet/node_image_sheet.gml +++ b/scripts/node_image_sheet/node_image_sheet.gml @@ -24,7 +24,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru inputs[| 8] = nodeValue("Animation speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1); - inputs[| 9] = nodeValue("Orientation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 9] = nodeValue("Main Axis", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, [ new scrollItem("Horizontal", s_node_alignment, 0), new scrollItem("Vertical", s_node_alignment, 1), ]); @@ -38,16 +38,14 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru var _size = getInputData(1); var _offs = getInputData(4); var _spac = getInputData(5); - var _orie = getInputData(9); - + var sh_w = _size[0] + _spac[0]; var sh_h = _size[1] + _spac[1]; var fill_w = floor((ww - _offs[0]) / sh_w); var fill_h = floor((hh - _offs[1]) / sh_h); - if(_orie == 0) inputs[| 3].setValue([ fill_w, fill_h ]); - else inputs[| 3].setValue([ fill_h, fill_w ]); + inputs[| 3].setValue([ fill_w, fill_h ]); doUpdate(); } }); #endregion @@ -96,7 +94,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru surf_size_h = 1; surf_space = 0; - surf_origin = 0; + surf_axis = 0; sprite_pos = []; sprite_valid = []; @@ -111,21 +109,28 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru function getSpritePosition(index) { #region var _dim = curr_dim; - var _col = curr_amo[0]; var _off = curr_off; var _spa = surf_space; - var _ori = surf_origin; + var _axs = surf_axis; - var _irow = floor(index / _col); - var _icol = safe_mod(index, _col); + var _irow, _icol; + + if(_axs == 0) { + _irow = floor(index / curr_amo[0]); + _icol = safe_mod(index, curr_amo[0]); + + } else { + _icol = floor(index / curr_amo[1]); + _irow = safe_mod(index, curr_amo[1]); + + } var _x, _y; var _x = _off[0] + _icol * (_dim[0] + _spa[0]); var _y = _off[1] + _irow * (_dim[1] + _spa[1]); - if(_ori == 0) return [ _x, _y ]; - else return [ _y, _x ]; + return [ _x, _y ]; } #endregion static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region @@ -303,7 +308,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru var _pad = getInputData(6); surf_space = getInputData(5); - surf_origin = getInputData(9); + surf_axis = getInputData(9); var ww = _dim[0] + _pad[0] + _pad[2]; var hh = _dim[1] + _pad[1] + _pad[3]; @@ -322,7 +327,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru curr_amo = is_array(_amo)? _amo : [1, 1]; curr_off = _off; - if(ww <= 1 || hh <= 1) return; + if(ww < 1 || hh < 1) return; if(_filt) { var filSize = 4; @@ -352,9 +357,11 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru if(!is_surface(_s)) _s = surface_create(ww, hh, cDep); + else if(surface_get_format(_s) != cDep) { surface_free(_s); _s = surface_create(ww, hh, cDep); + } else if(_resizeSurf) surface_resize(_s, ww, hh); diff --git a/scripts/node_iterate_each/node_iterate_each.gml b/scripts/node_iterate_each/node_iterate_each.gml index a55e72dda..08f3653ba 100644 --- a/scripts/node_iterate_each/node_iterate_each.gml +++ b/scripts/node_iterate_each/node_iterate_each.gml @@ -17,7 +17,7 @@ function Node_Iterate_Each(_x, _y, _group = noone) : Node_Iterator(_x, _y, _grou } #endregion static onStep = function() { #region - var type = inputs[| 0].isLeaf()? VALUE_TYPE.any : inputs[| 0].value_from.type; + var type = inputs[| 0].value_from == noone? VALUE_TYPE.any : inputs[| 0].value_from.type; inputs[| 0].setType(type); } #endregion 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 2791da902..657160eda 100644 --- a/scripts/node_iterate_each_inline/node_iterate_each_inline.gml +++ b/scripts/node_iterate_each_inline/node_iterate_each_inline.gml @@ -1,6 +1,7 @@ function Node_Iterate_Each_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x, _y, _group) constructor { name = "Loop Array"; color = COLORS.node_blend_loop; + managedRenderOrder = true; is_root = false; input_node = noone; @@ -47,8 +48,9 @@ function Node_Iterate_Each_Inline(_x, _y, _group = noone) : Node_Collection_Inli LOG_IF(global.FLAG.render == 1, "[outputNextNode] Get next node from inline iterate"); resetRender(); - LOG_IF(global.FLAG.render == 1, $"Loop restart: iteration {iterated}"); var _nodes = __nodeLeafList(nodes); + LOG_IF(global.FLAG.render == 1, $"Loop restart: iteration {iterated} : leaf {_nodes}"); + array_push_unique(_nodes, input_node); iterated++; diff --git a/scripts/node_iterate_filter/node_iterate_filter.gml b/scripts/node_iterate_filter/node_iterate_filter.gml index ef0086dfb..94ca8b160 100644 --- a/scripts/node_iterate_filter/node_iterate_filter.gml +++ b/scripts/node_iterate_filter/node_iterate_filter.gml @@ -17,7 +17,7 @@ function Node_Iterate_Filter(_x, _y, _group = noone) : Node_Iterator(_x, _y, _gr } #endregion static onStep = function() { #region - var type = inputs[| 0].isLeaf()? VALUE_TYPE.any : inputs[| 0].value_from.type; + var type = inputs[| 0].value_from == noone? VALUE_TYPE.any : inputs[| 0].value_from.type; inputs[| 0].setType(type); } #endregion diff --git a/scripts/node_iterate_sort/node_iterate_sort.gml b/scripts/node_iterate_sort/node_iterate_sort.gml index 551854d62..f7e1928b4 100644 --- a/scripts/node_iterate_sort/node_iterate_sort.gml +++ b/scripts/node_iterate_sort/node_iterate_sort.gml @@ -44,7 +44,7 @@ function Node_Iterate_Sort(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr static getNextNodes = function() { return getNextNodesExternal(); } static onStep = function() { #region - var type = inputs[| 0].isLeaf()? VALUE_TYPE.any : inputs[| 0].value_from.type; + var type = inputs[| 0].value_from == noone? VALUE_TYPE.any : inputs[| 0].value_from.type; inputs[| 0].setType(type); } #endregion 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 3f32dfa02..5f13ca681 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 @@ -27,6 +27,6 @@ function Node_Iterator_Each_Inline_Input(_x, _y, _group = noone) : Node(_x, _y, var val = inputs[| 0].getValue(); var itr = loop.iterated - 1; - outputs[| 0].setValue(array_safe_get_fast(val, itr)); + outputs[| 0].setValue(val[itr]); } #endregion } \ No newline at end of file diff --git a/scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.gml b/scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.gml index a7af48127..d1e4f6ee4 100644 --- a/scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.gml +++ b/scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.gml @@ -30,7 +30,19 @@ function Node_Iterator_Each_Inline_Output(_x, _y, _group = noone) : Node(_x, _y, var arr = outputs[| 0].getValue(); var itr = loop.iterated - 1; - array_safe_set(arr, itr, val); + if(_typ == VALUE_TYPE.surface) { + if(is_instanceof(val, SurfaceAtlas)) + arr[@ itr] = val.clone(); + + else if(surface_exists(val)) + arr[@ itr] = surface_clone(val); + + else + arr[@ itr] = val; + + } else + arr[@ itr] = val; + outputs[| 0].setValue(arr); } #endregion } \ No newline at end of file diff --git a/scripts/node_iterator_each_output/node_iterator_each_output.gml b/scripts/node_iterator_each_output/node_iterator_each_output.gml index d6982da40..1165a4814 100644 --- a/scripts/node_iterator_each_output/node_iterator_each_output.gml +++ b/scripts/node_iterator_each_output/node_iterator_each_output.gml @@ -19,7 +19,7 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group static step = function() { #region if(!variable_struct_exists(group, "iterated")) return; - var type = inputs[| 0].isLeaf()? VALUE_TYPE.any : inputs[| 0].value_from.type; + var type = inputs[| 0].value_from == noone? VALUE_TYPE.any : inputs[| 0].value_from.type; inputs[| 0].setType(type); group.outputs[| 0].setType(type); @@ -29,7 +29,7 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group } #endregion static cloneValue = function(_prev_val, _val) { #region - if(inputs[| 0].isLeaf()) return _prev_val; + if(inputs[| 0].value_from == noone) return _prev_val; var is_surf = inputs[| 0].value_from.type == VALUE_TYPE.surface; var _new_val = []; @@ -44,7 +44,7 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group } #endregion static update = function(frame = CURRENT_FRAME) { #region - if(inputs[| 0].isLeaf()) { + if(inputs[| 0].value_from == noone) { group.iterationUpdate(); return; } diff --git a/scripts/node_iterator_filter_output/node_iterator_filter_output.gml b/scripts/node_iterator_filter_output/node_iterator_filter_output.gml index fc65f75ee..caad6c2ae 100644 --- a/scripts/node_iterator_filter_output/node_iterator_filter_output.gml +++ b/scripts/node_iterator_filter_output/node_iterator_filter_output.gml @@ -19,13 +19,13 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro static step = function() { if(!variable_struct_exists(group, "iterated")) return; - var type = inputs[| 0].isLeaf()? VALUE_TYPE.any : inputs[| 0].value_from.type; + var type = inputs[| 0].value_from == noone? VALUE_TYPE.any : inputs[| 0].value_from.type; inputs[| 0].setType(type) group.outputs[| 0].setType(type); } static update = function(frame = CURRENT_FRAME) { - if(inputs[| 0].isLeaf()) { + if(inputs[| 0].value_from == noone) { group.iterationUpdate(); return; } diff --git a/scripts/node_iterator_index/node_iterator_index.gml b/scripts/node_iterator_index/node_iterator_index.gml index 80fd83298..f83b9d4d2 100644 --- a/scripts/node_iterator_index/node_iterator_index.gml +++ b/scripts/node_iterator_index/node_iterator_index.gml @@ -13,7 +13,7 @@ function Node_Iterator_Index(_x, _y, _group = noone) : Node(_x, _y, _group) cons if(inline_context != noone) gr = inline_context; if(gr == noone) return; - outputs[| 0].setValue(gr.iterated); + outputs[| 0].setValue(gr.iterated - 1); } #endregion static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region diff --git a/scripts/node_iterator_output/node_iterator_output.gml b/scripts/node_iterator_output/node_iterator_output.gml index e96d46a6e..0db3d1b45 100644 --- a/scripts/node_iterator_output/node_iterator_output.gml +++ b/scripts/node_iterator_output/node_iterator_output.gml @@ -8,7 +8,7 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y inputs[| 0].setFrom_condition = function(_valueFrom) { #region if(instanceof(_valueFrom.node) != "Node_Iterator_Input") return true; - if(inputs[| 1].isLeaf()) return true; + if(inputs[| 1].value_from == noone) return true; if(inputs[| 1].value_from.node == _valueFrom.node) { noti_warning("setFrom: Immediate cycle disallowed",, self); return false; @@ -22,7 +22,7 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y inputs[| 1].setFrom_condition = function(_valueFrom) { #region if(instanceof(_valueFrom.node) != "Node_Iterator_Input") return true; - if(inputs[| 0].isLeaf()) return true; + if(inputs[| 0].value_from == noone) return true; if(inputs[| 0].value_from.node == _valueFrom.node) { noti_warning("setFrom: Immediate cycle disallowed",, self); return false; @@ -42,7 +42,7 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y } #endregion static cloneValue = function(_prev_val, _val) { #region - if(inputs[| 0].isLeaf()) return _prev_val; + if(inputs[| 0].value_from == noone) return _prev_val; var is_surf = inputs[| 0].value_from.type == VALUE_TYPE.surface; var _new_val; @@ -54,7 +54,7 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y } #endregion static update = function(frame = CURRENT_FRAME) { #region - if(inputs[| 0].isLeaf()) { + if(inputs[| 0].value_from == noone) { group.iterationUpdate(); return; } diff --git a/scripts/node_json_file_write/node_json_file_write.gml b/scripts/node_json_file_write/node_json_file_write.gml index a43b30edf..5f744104f 100644 --- a/scripts/node_json_file_write/node_json_file_write.gml +++ b/scripts/node_json_file_write/node_json_file_write.gml @@ -85,7 +85,7 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con var cont = {}; - if(inputs[| 1].isLeaf()) { + if(inputs[| 1].value_from == noone) { for( var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length ) { var _key = getInputData(i + 0); var _val = getInputData(i + 1); @@ -103,7 +103,7 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con static step = function() { for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) { var inp = inputs[| i + 1]; - var typ = inp.isLeaf()? VALUE_TYPE.any : inp.value_from.type; + var typ = inp.value_from == noone? VALUE_TYPE.any : inp.value_from.type; inp.setType(typ); } } diff --git a/scripts/node_lua_compute/node_lua_compute.gml b/scripts/node_lua_compute/node_lua_compute.gml index 282557125..017a72d5b 100644 --- a/scripts/node_lua_compute/node_lua_compute.gml +++ b/scripts/node_lua_compute/node_lua_compute.gml @@ -49,7 +49,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru } if(!LOADING && !APPENDING) createNewInput(); #endregion static getState = function() { #region - if(inputs[| 3].isLeaf()) return lua_state; + if(inputs[| 3].value_from == noone) return lua_state; return inputs[| 3].value_from.node.getState(); } #endregion diff --git a/scripts/node_lua_global/node_lua_global.gml b/scripts/node_lua_global/node_lua_global.gml index 19632c446..358bf2bd5 100644 --- a/scripts/node_lua_global/node_lua_global.gml +++ b/scripts/node_lua_global/node_lua_global.gml @@ -21,7 +21,7 @@ function Node_Lua_Global(_x, _y, _group = noone) : Node(_x, _y, _group) construc is_beginning = false; static getState = function() { #region - if(inputs[| 2].isLeaf()) return lua_state; + if(inputs[| 2].value_from == noone) return lua_state; return inputs[| 2].value_from.node.getState(); } #endregion diff --git a/scripts/node_lua_surface/node_lua_surface.gml b/scripts/node_lua_surface/node_lua_surface.gml index 10306ed57..9edfb0946 100644 --- a/scripts/node_lua_surface/node_lua_surface.gml +++ b/scripts/node_lua_surface/node_lua_surface.gml @@ -51,7 +51,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru } if(!LOADING && !APPENDING) createNewInput(); #endregion static getState = function() { #region - if(inputs[| 3].isLeaf()) + if(inputs[| 3].value_from == noone) return lua_state; return inputs[| 3].value_from.node.getState(); } #endregion diff --git a/scripts/node_number/node_number.gml b/scripts/node_number/node_number.gml index 7bb4d6847..85d430d0a 100644 --- a/scripts/node_number/node_number.gml +++ b/scripts/node_number/node_number.gml @@ -57,14 +57,14 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor inputs[| 5].setVisible(false); break; case 1 : - if(inputs[| 0].isLeaf() && !show_parameter) setDimension(160, 96, false); + if(inputs[| 0].value_from == noone && !show_parameter) setDimension(160, 96, false); inputs[| 3].setVisible(true); inputs[| 4].setVisible(true); inputs[| 5].setVisible(true); break; case 2 : - if(inputs[| 0].isLeaf() && !show_parameter) setDimension(128, 128, false); + if(inputs[| 0].value_from == noone && !show_parameter) setDimension(128, 128, false); inputs[| 3].setVisible(false); inputs[| 4].setVisible(false); diff --git a/scripts/node_pin/node_pin.gml b/scripts/node_pin/node_pin.gml index 0dad121d5..dd77df8a6 100644 --- a/scripts/node_pin/node_pin.gml +++ b/scripts/node_pin/node_pin.gml @@ -19,7 +19,7 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { outputs[| 0] = nodeValue("Out", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0); static step = function() { #region - if(inputs[| 0].isLeaf()) return; + if(inputs[| 0].value_from == noone) return; inputs[| 0].setType(inputs[| 0].value_from.type); outputs[| 0].setType(inputs[| 0].value_from.type); diff --git a/scripts/node_sequence_anim/node_sequence_anim.gml b/scripts/node_sequence_anim/node_sequence_anim.gml index 38ba49d1e..4b1a8ce3f 100644 --- a/scripts/node_sequence_anim/node_sequence_anim.gml +++ b/scripts/node_sequence_anim/node_sequence_anim.gml @@ -31,7 +31,7 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const _ord[i] = i; } - if(_hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h) && inputs[| 2].isLeaf()) { + if(_hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h) && inputs[| 2].value_from == noone) { draw_sprite_stretched(THEME.button_def, mouse_click(mb_left, _focus)? 2 : 1, _x, _y, _w, _h); if(mouse_press(mb_left, _focus)) dialogPanelCall(new Panel_Array_Sequence(self)); diff --git a/scripts/node_strand_render_texture/node_strand_render_texture.gml b/scripts/node_strand_render_texture/node_strand_render_texture.gml index 600a937b0..2040b090c 100644 --- a/scripts/node_strand_render_texture/node_strand_render_texture.gml +++ b/scripts/node_strand_render_texture/node_strand_render_texture.gml @@ -60,7 +60,7 @@ function Node_Strand_Render_Texture(_x, _y, _group = noone) : Node(_x, _y, _grou return; if(!is_array(_str)) _str = [ _str ]; - if(inputs[| 4].isLeaf()) + if(inputs[| 4].value_from == noone) return; if(!is_array(_tex)) _tex = [ _tex ]; diff --git a/scripts/node_struct/node_struct.gml b/scripts/node_struct/node_struct.gml index 4e9b5c483..faae141b4 100644 --- a/scripts/node_struct/node_struct.gml +++ b/scripts/node_struct/node_struct.gml @@ -55,7 +55,7 @@ function Node_Struct(_x, _y, _group = noone) : Node(_x, _y, _group) constructor static step = function() { for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) { var inp = inputs[| i + 1]; - var typ = inp.isLeaf()? VALUE_TYPE.any : inp.value_from.type; + var typ = inp.value_from == noone? VALUE_TYPE.any : inp.value_from.type; inp.setType(typ); } } diff --git a/scripts/node_switch/node_switch.gml b/scripts/node_switch/node_switch.gml index b89c006cc..6b0dd5180 100644 --- a/scripts/node_switch/node_switch.gml +++ b/scripts/node_switch/node_switch.gml @@ -87,7 +87,7 @@ function Node_Switch(_x, _y, _group = noone) : Node(_x, _y, _group) constructor static step = function() { #region for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) { var _inp = inputs[| i + 1]; - if(_inp.isLeaf()) continue; + if(_inp.value_from == noone) continue; _inp.setType(_inp.value_from.type); } diff --git a/scripts/node_transform/node_transform.gml b/scripts/node_transform/node_transform.gml index 9df9f00ec..48cc30864 100644 --- a/scripts/node_transform/node_transform.gml +++ b/scripts/node_transform/node_transform.gml @@ -574,7 +574,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) } #region path - if(inputs[| 2].is_anim && inputs[| 2].isLeaf() && !inputs[| 2].sep_axis) { + if(inputs[| 2].is_anim && inputs[| 2].value_from == noone && !inputs[| 2].sep_axis) { var posInp = inputs[| 2]; var allPos = posInp.animator.values; var ox, oy, nx, ny; diff --git a/scripts/node_tunnel_in/node_tunnel_in.gml b/scripts/node_tunnel_in/node_tunnel_in.gml index 69559e3f5..31b32a91a 100644 --- a/scripts/node_tunnel_in/node_tunnel_in.gml +++ b/scripts/node_tunnel_in/node_tunnel_in.gml @@ -91,7 +91,7 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct value_validation[VALIDATION.error] = error_notification != noone; - if(inputs[| 1].isLeaf()) { + if(inputs[| 1].value_from == noone) { inputs[| 1].setType(VALUE_TYPE.any); inputs[| 1].display_type = VALUE_DISPLAY._default; } else { diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index f5f55b348..a153f4166 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -2138,9 +2138,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return 1; } #endregion - static isLeaf = function() { INLINE return value_from == noone; } - static isLeafList = function(list = noone) { INLINE return value_from == noone || !ds_list_exist(list, value_from.node); } - static isRendered = function() { #region if(type == VALUE_TYPE.node) return true; @@ -2266,7 +2263,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } #endregion static checkConnection = function(_remove_list = true) { #region - if(isLeaf()) return; + if(value_from == noone) return; if(value_from.node.active) return; removeFrom(_remove_list); @@ -2301,30 +2298,30 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _angle = argument_count > arc + 0? argument[arc + 0] : 0; var _scale = argument_count > arc + 1? argument[arc + 1] : 1; var _spr = argument_count > arc + 2? argument[arc + 2] : THEME.anchor_selector; - return preview_overlay_scalar(isLeaf(), active, _x, _y, _s, _mx, _my, _snx, _sny, _angle, _scale, _spr); + return preview_overlay_scalar(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _angle, _scale, _spr); case VALUE_DISPLAY.rotation : var _rad = argument_count > arc + 0? argument[ arc + 0] : 64; - return preview_overlay_rotation(isLeaf(), active, _x, _y, _s, _mx, _my, _snx, _sny, _rad); + return preview_overlay_rotation(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _rad); case VALUE_DISPLAY.vector : var _spr = argument_count > arc + 0? argument[arc + 0] : THEME.anchor_selector; var _sca = argument_count > arc + 1? argument[arc + 1] : 1; - return preview_overlay_vector(isLeaf(), active, _x, _y, _s, _mx, _my, _snx, _sny, _spr); + return preview_overlay_vector(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _spr); case VALUE_DISPLAY.gradient_range : var _dim = argument[arc]; if(mappedJunc.attributes.mapped) - return preview_overlay_gradient_range(isLeaf(), active, _x, _y, _s, _mx, _my, _snx, _sny, _dim); + return preview_overlay_gradient_range(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _dim); break; case VALUE_DISPLAY.area : var _flag = argument_count > arc + 0? argument[arc + 0] : 0b0011; - return preview_overlay_area(isLeaf(), active, _x, _y, _s, _mx, _my, _snx, _sny, _flag, struct_try_get(display_data, "onSurfaceSize")); + return preview_overlay_area(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag, struct_try_get(display_data, "onSurfaceSize")); case VALUE_DISPLAY.puppet_control : - return preview_overlay_puppet(isLeaf(), active, _x, _y, _s, _mx, _my, _snx, _sny); + return preview_overlay_puppet(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny); } return -1; @@ -2422,7 +2419,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } #endregion static drawConnections = function(params = {}) { #region - if(isLeaf()) return noone; + if(value_from == noone) return noone; if(!value_from.node.active) return noone; if(!isVisible()) return noone; @@ -2563,7 +2560,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru for(var i = 0; i < array_length(value_to); i++) { var _to = value_to[i]; - if(!_to.node.active || _to.isLeaf()) continue; + if(!_to.node.active || _to.value_from == noone) continue; if(_to.value_from != self) continue; array_push(_junc_to, _to); diff --git a/scripts/node_vector2/node_vector2.gml b/scripts/node_vector2/node_vector2.gml index eed91051c..9b83a68b4 100644 --- a/scripts/node_vector2/node_vector2.gml +++ b/scripts/node_vector2/node_vector2.gml @@ -116,7 +116,7 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c setDimension(96, 80, false); - if(disp == 1 && inputs[| 0].isLeaf() && inputs[| 1].isLeaf()) + if(disp == 1 && inputs[| 0].value_from == noone && inputs[| 1].value_from == noone) setDimension(160, 160, false); } #endregion diff --git a/scripts/node_vector_split/node_vector_split.gml b/scripts/node_vector_split/node_vector_split.gml index 69ab20926..5be41c65d 100644 --- a/scripts/node_vector_split/node_vector_split.gml +++ b/scripts/node_vector_split/node_vector_split.gml @@ -15,7 +15,7 @@ function Node_Vector_Split(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro outputs[| 3] = nodeValue("w", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0); static step = function() { #region - if(inputs[| 0].isLeaf()) return; + if(inputs[| 0].value_from == noone) return; var type = VALUE_TYPE.float; if(inputs[| 0].value_from.type == VALUE_TYPE.integer) type = VALUE_TYPE.integer; diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index ac872e51a..a8af3859b 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -631,7 +631,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { for( var j = 0, m = ds_list_size(_node.inputs); j < m; j++ ) { var _input = _node.inputs[| j]; - if(_input.isLeaf()) continue; + if(_input.value_from == noone) continue; _input.setColor(color); } } @@ -1423,7 +1423,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { PANEL_INSPECTOR.attribute_hovering(value_dragging); } else if(target != noone) { var _addInput = false; - if(target.isLeaf() && target.connect_type == JUNCTION_CONNECT.input && target.node.auto_input) + if(target.value_from == noone && target.connect_type == JUNCTION_CONNECT.input && target.node.auto_input) _addInput = true; if(value_dragging.connect_type == JUNCTION_CONNECT.input) { @@ -2344,7 +2344,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } - if(!key_mod_press(SHIFT) && node && struct_has(DRAGGING, "from") && DRAGGING.from.isLeaf()) { + if(!key_mod_press(SHIFT) && node && struct_has(DRAGGING, "from") && DRAGGING.from.value_from == noone) { for( var i = 0; i < ds_list_size(node.outputs); i++ ) if(DRAGGING.from.setFrom(node.outputs[| i])) break; } diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index 1cb1fd32a..14157f0ac 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -15,24 +15,6 @@ enum RENDER_TYPE { #macro RENDER_PARTIAL UPDATE |= RENDER_TYPE.partial; #endregion -function __nodeLeafList(_list) { #region - var nodes = []; - var nodeNames = []; - - for( var i = 0, n = ds_list_size(_list); i < n; i++ ) { - var _node = _list[| i]; - if(!_node.active) { LOG_LINE_IF(global.FLAG.render == 1, $"Reject {_node.internalName} [inactive]"); continue; } - if(!_node.isLeafList(_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; } - - array_push(nodes, _node); - array_push(nodeNames, _node.internalName); - } - - LOG_LINE_IF(global.FLAG.render == 1, $"Push node {nodeNames} to queue"); - return nodes; -} #endregion - function ResetAllNodesRender() { #region LOG_IF(global.FLAG.render == 1, $"XXXXXXXXXXXXXXXXXXXX RESETTING ALL NODES [frame {CURRENT_FRAME}] XXXXXXXXXXXXXXXXXXXX"); @@ -148,6 +130,25 @@ function __topoSort(_list, _nodeList) { #region } } #endregion +function __nodeLeafList(_list) { #region + var nodes = []; + var nodeNames = []; + + for( var i = 0, n = ds_list_size(_list); i < n; i++ ) { + var _node = _list[| i]; + + if(!_node.active) { LOG_LINE_IF(global.FLAG.render == 1, $"Reject {_node.internalName} [inactive]"); continue; } + if(!_node.isLeafList(_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; } + + array_push(nodes, _node); + array_push(nodeNames, _node.internalName); + } + + LOG_LINE_IF(global.FLAG.render == 1, $"Push node {nodeNames} to queue"); + return nodes; +} #endregion + 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; }