From c9b4e2d18b2a7f62cd6bc3699669dfbc5fb4e471 Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:54:55 +0200 Subject: [PATCH] 1.15.2 update --- scripts/__bone/__bone.gml | 8 +-- scripts/__vec2/__vec2.gml | 33 +++++++++++ scripts/d3d_cube/d3d_cube.gml | 72 +++++++++++------------ scripts/d3d_cube_faces/d3d_cube_faces.gml | 72 +++++++++++------------ scripts/d3d_scene/d3d_scene.gml | 3 +- scripts/dynaSurf/dynaSurf.gml | 4 +- scripts/node_equation/node_equation.gml | 3 +- scripts/node_isosurf/node_isosurf.gml | 4 +- scripts/node_processor/node_processor.gml | 10 +++- scripts/node_value/node_value.gml | 56 ++++++++++-------- 10 files changed, 157 insertions(+), 108 deletions(-) diff --git a/scripts/__bone/__bone.gml b/scripts/__bone/__bone.gml index 8b7e87969..4a161632c 100644 --- a/scripts/__bone/__bone.gml +++ b/scripts/__bone/__bone.gml @@ -106,17 +106,17 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = if(parent == noone) return new __vec2(lengthdir_x(distance, direction), lengthdir_y(distance, direction)) - .add(lengthdir_x(len, _ang), lengthdir_y(len, _ang)); + .addElement(lengthdir_x(len, _ang), lengthdir_y(len, _ang)); if(parent_anchor) { var p = parent.getPoint(1, pose) - .add(lengthdir_x(len, _ang), lengthdir_y(len, _ang)) + .addElement(lengthdir_x(len, _ang), lengthdir_y(len, _ang)) return p; } var p = parent.getPoint(0, pose) - .add(lengthdir_x(distance, direction), lengthdir_y(distance, direction)) - .add(lengthdir_x(len, _ang), lengthdir_y(len, _ang)) + .addElement(lengthdir_x(distance, direction), lengthdir_y(distance, direction)) + .addElement(lengthdir_x(len, _ang), lengthdir_y(len, _ang)) return p; } #endregion diff --git a/scripts/__vec2/__vec2.gml b/scripts/__vec2/__vec2.gml index aa933b5e6..3220152a9 100644 --- a/scripts/__vec2/__vec2.gml +++ b/scripts/__vec2/__vec2.gml @@ -61,6 +61,17 @@ function __vec2(_x = 0, _y = _x) constructor { y += _vec2.y; return self; } #endregion + + static addElement = function(_x, _y) { #region + gml_pragma("forceinline"); + return new __vec2(x + _x, y + _y); + } #endregion + static _addElement = function(_x, _y) { #region + gml_pragma("forceinline"); + x += _x; + y += _y; + return self; + } #endregion static subtract = function(_vec2) { #region gml_pragma("forceinline"); @@ -73,6 +84,17 @@ function __vec2(_x = 0, _y = _x) constructor { return self; } #endregion + static subtractElement = function(_x, _y) { #region + gml_pragma("forceinline"); + return new __vec2(x - _x, y - _y); + } #endregion + static _subtractElement = function(_x, _y) { #region + gml_pragma("forceinline"); + x -= _x; + y -= _y; + return self; + } #endregion + static multiply = function(_scalar) { #region gml_pragma("forceinline"); return new __vec2(x * _scalar, y * _scalar); @@ -95,6 +117,17 @@ function __vec2(_x = 0, _y = _x) constructor { return self; } #endregion + static multiplyElement = function(_x, _y) { #region + gml_pragma("forceinline"); + return new __vec2(x * _x, y * _y); + } #endregion + static _multiplyElement = function(_x, _y) { #region + gml_pragma("forceinline"); + x *= _x; + y *= _y; + return self; + } #endregion + static divide = function(_scalar) { #region gml_pragma("forceinline"); if (_scalar != 0) diff --git a/scripts/d3d_cube/d3d_cube.gml b/scripts/d3d_cube/d3d_cube.gml index a428070b9..8d1deca37 100644 --- a/scripts/d3d_cube/d3d_cube.gml +++ b/scripts/d3d_cube/d3d_cube.gml @@ -6,58 +6,58 @@ function __3dCube() : __3dObject() constructor { size /= 2; vertex = [[ - new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(0, 1), - new __vertex( size, size, size).setNormal(0, 0, 1).setUV(1, 0), - new __vertex( size, -size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex( size, size, size).setNormal(0, 0, 1).setUV(0, 0), + new __vertex( size, -size, size).setNormal(0, 0, 1).setUV(0, 1), - new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(0, 1), - new __vertex(-size, size, size).setNormal(0, 0, 1).setUV(0, 0), - new __vertex( size, size, size).setNormal(0, 0, 1).setUV(1, 0), + new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex(-size, size, size).setNormal(0, 0, 1).setUV(1, 0), + new __vertex( size, size, size).setNormal(0, 0, 1).setUV(0, 0), - new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 1), - new __vertex( size, -size, -size).setNormal(0, 0, -1).setUV(1, 1), - new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(1, 0), + new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(1, 1), + new __vertex( size, -size, -size).setNormal(0, 0, -1).setUV(0, 1), + new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(0, 0), - new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 1), - new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(1, 0), - new __vertex(-size, size, -size).setNormal(0, 0, -1).setUV(0, 0), + new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(1, 1), + new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(0, 0), + new __vertex(-size, size, -size).setNormal(0, 0, -1).setUV(1, 0), - new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), - new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 1), - new __vertex(-size, size, size).setNormal(-1, 0, 0).setUV(1, 0), + new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(1, 0), + new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1), + new __vertex(-size, size, size).setNormal(-1, 0, 0).setUV(0, 0), - new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), - new __vertex(-size, -size, -size).setNormal(-1, 0, 0).setUV(0, 1), - new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(1, 0), + new __vertex(-size, -size, -size).setNormal(-1, 0, 0).setUV(1, 1), + new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1), - new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(1, 0), - new __vertex( size, size, size).setNormal(1, 0, 0).setUV(0, 0), - new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(0, 1), + new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), + new __vertex( size, size, size).setNormal(1, 0, 0).setUV(1, 0), + new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), - new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(1, 0), - new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(0, 1), - new __vertex( size, -size, -size).setNormal(1, 0, 0).setUV(1, 1), + new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), + new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), + new __vertex( size, -size, -size).setNormal(1, 0, 0).setUV(0, 1), - new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), - new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(1, 1), - new __vertex( size, size, size).setNormal(0, 1, 0).setUV(1, 0), + new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(1, 0), + new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(0, 1), + new __vertex( size, size, size).setNormal(0, 1, 0).setUV(0, 0), - new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), - new __vertex(-size, size, -size).setNormal(0, 1, 0).setUV(0, 1), - new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(1, 1), + new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(1, 0), + new __vertex(-size, size, -size).setNormal(0, 1, 0).setUV(1, 1), + new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(0, 1), - new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(1, 0), - new __vertex( size, -size, size).setNormal(0, -1, 0).setUV(0, 0), - new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), + new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), + new __vertex( size, -size, size).setNormal(0, -1, 0).setUV(1, 0), + new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), - new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(1, 0), - new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), - new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), + new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), + new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), ]]; VB = build(); diff --git a/scripts/d3d_cube_faces/d3d_cube_faces.gml b/scripts/d3d_cube_faces/d3d_cube_faces.gml index df63b50af..241693012 100644 --- a/scripts/d3d_cube_faces/d3d_cube_faces.gml +++ b/scripts/d3d_cube_faces/d3d_cube_faces.gml @@ -8,58 +8,58 @@ function __3dCubeFaces() : __3dObject() constructor { vertex = [ [ - new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(0, 1), - new __vertex( size, size, size).setNormal(0, 0, 1).setUV(1, 0), - new __vertex( size, -size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex( size, size, size).setNormal(0, 0, 1).setUV(0, 0), + new __vertex( size, -size, size).setNormal(0, 0, 1).setUV(0, 1), - new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(0, 1), - new __vertex(-size, size, size).setNormal(0, 0, 1).setUV(0, 0), - new __vertex( size, size, size).setNormal(0, 0, 1).setUV(1, 0), + new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex(-size, size, size).setNormal(0, 0, 1).setUV(1, 0), + new __vertex( size, size, size).setNormal(0, 0, 1).setUV(0, 0), ], [ - new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 1), - new __vertex( size, -size, -size).setNormal(0, 0, -1).setUV(1, 1), - new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(1, 0), + new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(1, 1), + new __vertex( size, -size, -size).setNormal(0, 0, -1).setUV(0, 1), + new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(0, 0), - new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 1), - new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(1, 0), - new __vertex(-size, size, -size).setNormal(0, 0, -1).setUV(0, 0), + new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(1, 1), + new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(0, 0), + new __vertex(-size, size, -size).setNormal(0, 0, -1).setUV(1, 0), ], [ - new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), - new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 1), - new __vertex(-size, size, size).setNormal(-1, 0, 0).setUV(1, 0), + new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(1, 0), + new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1), + new __vertex(-size, size, size).setNormal(-1, 0, 0).setUV(0, 0), - new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), - new __vertex(-size, -size, -size).setNormal(-1, 0, 0).setUV(0, 1), - new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(1, 0), + new __vertex(-size, -size, -size).setNormal(-1, 0, 0).setUV(1, 1), + new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1), ], [ - new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(1, 0), - new __vertex( size, size, size).setNormal(1, 0, 0).setUV(0, 0), - new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(0, 1), + new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), + new __vertex( size, size, size).setNormal(1, 0, 0).setUV(1, 0), + new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), - new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(1, 0), - new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(0, 1), - new __vertex( size, -size, -size).setNormal(1, 0, 0).setUV(1, 1), + new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), + new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), + new __vertex( size, -size, -size).setNormal(1, 0, 0).setUV(0, 1), ], [ - new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), - new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(1, 1), - new __vertex( size, size, size).setNormal(0, 1, 0).setUV(1, 0), + new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(1, 0), + new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(0, 1), + new __vertex( size, size, size).setNormal(0, 1, 0).setUV(0, 0), - new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), - new __vertex(-size, size, -size).setNormal(0, 1, 0).setUV(0, 1), - new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(1, 1), + new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(1, 0), + new __vertex(-size, size, -size).setNormal(0, 1, 0).setUV(1, 1), + new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(0, 1), ], [ - new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(1, 0), - new __vertex( size, -size, size).setNormal(0, -1, 0).setUV(0, 0), - new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), + new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), + new __vertex( size, -size, size).setNormal(0, -1, 0).setUV(1, 0), + new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), - new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(1, 0), - new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), - new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), + new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), + new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), ] ]; diff --git a/scripts/d3d_scene/d3d_scene.gml b/scripts/d3d_scene/d3d_scene.gml index 1e5169049..e88c48ad6 100644 --- a/scripts/d3d_scene/d3d_scene.gml +++ b/scripts/d3d_scene/d3d_scene.gml @@ -86,7 +86,8 @@ function __3dScene(camera) constructor { } reset(); #endregion static _submit = function(callback, object = noone, shader = noone) { - if(object == noone) return; + if(object == noone) return; + if(!is_struct(object)) return; matrix_stack_clear(); if(apply_transform) custom_transform.submitMatrix(); diff --git a/scripts/dynaSurf/dynaSurf.gml b/scripts/dynaSurf/dynaSurf.gml index 248a47b4b..4d4e90e91 100644 --- a/scripts/dynaSurf/dynaSurf.gml +++ b/scripts/dynaSurf/dynaSurf.gml @@ -9,8 +9,8 @@ function dynaSurf() constructor { return [ _x - _px[0], _y - _px[1] ]; } - static getWidth = function() { return is_surface(surfaces[0])? surface_get_width(surfaces[0]) : 1; } - static getHeight = function() { return is_surface(surfaces[0])? surface_get_height(surfaces[0]) : 1; } + static getWidth = function() { return is_surface(array_safe_get(surfaces, 0))? surface_get_width(surfaces[0]) : 1; } + static getHeight = function() { return is_surface(array_safe_get(surfaces, 0))? surface_get_height(surfaces[0]) : 1; } static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {} static drawStretch = function(_x = 0, _y = 0, _w = 1, _h = 1, _ang = 0, _col = c_white, _alp = 1) { diff --git a/scripts/node_equation/node_equation.gml b/scripts/node_equation/node_equation.gml index a34c7e71b..c36204568 100644 --- a/scripts/node_equation/node_equation.gml +++ b/scripts/node_equation/node_equation.gml @@ -148,7 +148,8 @@ function Node_Equation(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _pName = _data[i + 0]; var _pVal = _data[i + 1]; - variable_struct_set(params, _pName, _pVal); + if(_pName != "") + params[$ _pName] = _pVal; } var _tree = array_safe_get(ast, _array_index, noone); diff --git a/scripts/node_isosurf/node_isosurf.gml b/scripts/node_isosurf/node_isosurf.gml index b9d6db6a6..37a88ae64 100644 --- a/scripts/node_isosurf/node_isosurf.gml +++ b/scripts/node_isosurf/node_isosurf.gml @@ -11,6 +11,7 @@ function Node_IsoSurf(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c .setDisplay(VALUE_DISPLAY.rotation); inputs[| 3] = nodeValue("Angle Split", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0 * 90, 1 * 90, 2 * 90, 3 * 90 ]) + .setArrayDynamic() .setArrayDepth(1); outputs[| 0] = nodeValue("IsoSurf", self, JUNCTION_CONNECT.output, VALUE_TYPE.dynaSurface, noone); @@ -80,9 +81,8 @@ function Node_IsoSurf(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c if(inputs[| 3].setValue(_angle)) UNDO_HOLDING = true; - if(mouse_release(mb_left)) { + if(mouse_release(mb_left)) knob_dragging = noone; - } } return hh; diff --git a/scripts/node_processor/node_processor.gml b/scripts/node_processor/node_processor.gml index a84d8e493..b490d7fc9 100644 --- a/scripts/node_processor/node_processor.gml +++ b/scripts/node_processor/node_processor.gml @@ -177,7 +177,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct for(var i = 0; i < ds_list_size(inputs); i++) _data[i] = all_inputs[i][l]; - var data = processData(_data, inputs_data, 0, l); + var data = processData(0, _data, 0, l); for(var i = 0; i < ds_list_size(outputs); i++) { var _outp = array_safe_get(data, i, undefined); _outputs[i][l] = _outp; @@ -210,6 +210,10 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct var val = inputs[| i].getValue(); var amo = inputs[| i].arrayLength(val); + if(amo == 0) val = noone; //empty array + if(amo == 1) val = val[0]; //spread single array + amo = max(1, amo); + inputs_data[i] = val; inputs_is_array[i] = inputs[| i].isArray(val); @@ -221,11 +225,11 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct case ARRAY_PROCESS.expand : case ARRAY_PROCESS.expand_inv : - process_amount *= max(1, amo); + process_amount *= amo; break; } - process_length[i] = [max(1, amo), process_amount]; + process_length[i] = [amo, process_amount]; } var amoMax = process_amount; diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index c47880545..4986b80c3 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -268,15 +268,6 @@ function typeArray(_type) { #region return 0; } #endregion -function typeArrayDynamic(_type) { #region - switch(_type) { - case VALUE_DISPLAY.curve : - case VALUE_DISPLAY.palette : - return true; - } - return false; -} #endregion - function typeCompatible(fromType, toType, directional_cast = true) { #region if(value_bit(fromType) & value_bit(toType) != 0) return true; @@ -474,6 +465,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru use_cache = true; process_array = true; + dynamic_array = false; validateValue = true; fullUpdate = false; @@ -600,6 +592,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return self; } #endregion + static setArrayDynamic = function() { #region + dynamic_array = true; + return self; + } #endregion + static rejectConnect = function() { #region auto_connect = false; return self; @@ -1130,10 +1127,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(display_type == VALUE_DISPLAY.area) { #region var dispType = struct_try_get(nodeFrom.extra_data, "area_type"); var surfGet = nodeFrom.display_data; - if(!applyUnit || surfGet == -1) { - //print($" {value}"); + if(!applyUnit || surfGet == -1) return value; - } var surf = surfGet(); var ww = surf[0]; @@ -1258,17 +1253,19 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(!is_array(def_val)) return val; - if(typeArrayDynamic(display_type)) + if(isDynamicArray(display_type)) return val; if(isArray(val)) return val; - + if(!is_array(val)) - val = array_create(def_length, val); + return array_create(def_length, val); else if(array_length(val) < def_length) { - for( var i = array_length(val); i < def_length; i++ ) - val[i] = 0; + var _val = array_create(def_length); + for( var i = 0; i < def_length; i++ ) + _val[i] = array_safe_get(val, i, 0); + return _val; } return val; @@ -1311,13 +1308,14 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru val = arrayBalance(val); - if(isArray(val) && array_length(val) < 128) { //Process data + if(isArray(val) && array_length(val) < 1024) { //Process data + var _val = array_create(array_length(val)); for( var i = 0, n = array_length(val); i < n; i++ ) - val[i] = valueProcess(val[i], nod, applyUnit, arrIndex); - } else - val = valueProcess(val, nod, applyUnit, arrIndex); + _val[i] = valueProcess(val[i], nod, applyUnit, arrIndex); + return _val; + } - return val; + return valueProcess(val, nod, applyUnit, arrIndex); } #endregion static getValueRecursive = function(_time = PROJECT.animator.current_frame) { #region @@ -1410,6 +1408,18 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return val; } #endregion + static isDynamicArray = function() { #region + if(dynamic_array) return true; + + switch(display_type) { + case VALUE_DISPLAY.curve : + case VALUE_DISPLAY.palette : + return true; + } + + return false; + } #endregion + static isArray = function(val = undefined) { #region if(val == undefined) { if(cache_array[0]) @@ -1448,7 +1458,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru val = getValue(); if(!isArray(val)) - return 1; + return -1; if(array_depth == 0 && !typeArray(display_type)) return array_length(val);