mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
1.15.2 update
This commit is contained in:
parent
ec4a31d19f
commit
c9b4e2d18b
10 changed files with 157 additions and 108 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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),
|
||||
]
|
||||
];
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue