mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-23 21:46:17 +01:00
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.
This commit is contained in:
parent
d1f67dd676
commit
a581d4fbe1
45 changed files with 164 additions and 117 deletions
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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, "/", "\\");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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++;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue