mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-26 06:56:45 +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)
|
if(parent == noone)
|
||||||
return new __vec2(lengthdir_x(distance, direction), lengthdir_y(distance, direction))
|
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) {
|
if(parent_anchor) {
|
||||||
var p = parent.getPoint(1, pose)
|
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;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
var p = parent.getPoint(0, pose)
|
var p = parent.getPoint(0, pose)
|
||||||
.add(lengthdir_x(distance, direction), lengthdir_y(distance, direction))
|
.addElement(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))
|
||||||
return p;
|
return p;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,17 @@ function __vec2(_x = 0, _y = _x) constructor {
|
||||||
return self;
|
return self;
|
||||||
} #endregion
|
} #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
|
static subtract = function(_vec2) { #region
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
return new __vec2(x - _vec2.x, y - _vec2.y);
|
return new __vec2(x - _vec2.x, y - _vec2.y);
|
||||||
|
@ -73,6 +84,17 @@ function __vec2(_x = 0, _y = _x) constructor {
|
||||||
return self;
|
return self;
|
||||||
} #endregion
|
} #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
|
static multiply = function(_scalar) { #region
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
return new __vec2(x * _scalar, y * _scalar);
|
return new __vec2(x * _scalar, y * _scalar);
|
||||||
|
@ -95,6 +117,17 @@ function __vec2(_x = 0, _y = _x) constructor {
|
||||||
return self;
|
return self;
|
||||||
} #endregion
|
} #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
|
static divide = function(_scalar) { #region
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
if (_scalar != 0)
|
if (_scalar != 0)
|
||||||
|
|
|
@ -6,58 +6,58 @@ function __3dCube() : __3dObject() constructor {
|
||||||
size /= 2;
|
size /= 2;
|
||||||
|
|
||||||
vertex = [[
|
vertex = [[
|
||||||
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(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, 1),
|
||||||
|
|
||||||
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(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, 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, 1),
|
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(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(0, 0),
|
||||||
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, 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, 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(1, 1),
|
||||||
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, 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(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, 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, 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, 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, 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(1, 1),
|
||||||
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, 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(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, 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, 1),
|
new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1),
|
||||||
]];
|
]];
|
||||||
|
|
||||||
VB = build();
|
VB = build();
|
||||||
|
|
|
@ -8,58 +8,58 @@ function __3dCubeFaces() : __3dObject() constructor {
|
||||||
|
|
||||||
vertex = [
|
vertex = [
|
||||||
[
|
[
|
||||||
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(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, 1),
|
||||||
|
|
||||||
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(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, 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, 1),
|
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(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(0, 0),
|
||||||
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, 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, 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(1, 1),
|
||||||
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, 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(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, 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, 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, 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, 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(1, 1),
|
||||||
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, 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(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, 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, 1),
|
new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1),
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ function __3dScene(camera) constructor {
|
||||||
|
|
||||||
static _submit = function(callback, object = noone, shader = noone) {
|
static _submit = function(callback, object = noone, shader = noone) {
|
||||||
if(object == noone) return;
|
if(object == noone) return;
|
||||||
|
if(!is_struct(object)) return;
|
||||||
|
|
||||||
matrix_stack_clear();
|
matrix_stack_clear();
|
||||||
if(apply_transform) custom_transform.submitMatrix();
|
if(apply_transform) custom_transform.submitMatrix();
|
||||||
|
|
|
@ -9,8 +9,8 @@ function dynaSurf() constructor {
|
||||||
return [ _x - _px[0], _y - _px[1] ];
|
return [ _x - _px[0], _y - _px[1] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
static getWidth = function() { return is_surface(surfaces[0])? surface_get_width(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(surfaces[0])? surface_get_height(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 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) {
|
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 _pName = _data[i + 0];
|
||||||
var _pVal = _data[i + 1];
|
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);
|
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);
|
.setDisplay(VALUE_DISPLAY.rotation);
|
||||||
|
|
||||||
inputs[| 3] = nodeValue("Angle Split", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0 * 90, 1 * 90, 2 * 90, 3 * 90 ])
|
inputs[| 3] = nodeValue("Angle Split", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0 * 90, 1 * 90, 2 * 90, 3 * 90 ])
|
||||||
|
.setArrayDynamic()
|
||||||
.setArrayDepth(1);
|
.setArrayDepth(1);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("IsoSurf", self, JUNCTION_CONNECT.output, VALUE_TYPE.dynaSurface, noone);
|
outputs[| 0] = nodeValue("IsoSurf", self, JUNCTION_CONNECT.output, VALUE_TYPE.dynaSurface, noone);
|
||||||
|
@ -80,10 +81,9 @@ function Node_IsoSurf(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
||||||
|
|
||||||
if(inputs[| 3].setValue(_angle)) UNDO_HOLDING = true;
|
if(inputs[| 3].setValue(_angle)) UNDO_HOLDING = true;
|
||||||
|
|
||||||
if(mouse_release(mb_left)) {
|
if(mouse_release(mb_left))
|
||||||
knob_dragging = noone;
|
knob_dragging = noone;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return hh;
|
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++)
|
for(var i = 0; i < ds_list_size(inputs); i++)
|
||||||
_data[i] = all_inputs[i][l];
|
_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++) {
|
for(var i = 0; i < ds_list_size(outputs); i++) {
|
||||||
var _outp = array_safe_get(data, i, undefined);
|
var _outp = array_safe_get(data, i, undefined);
|
||||||
_outputs[i][l] = _outp;
|
_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 val = inputs[| i].getValue();
|
||||||
var amo = inputs[| i].arrayLength(val);
|
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_data[i] = val;
|
||||||
inputs_is_array[i] = inputs[| i].isArray(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 :
|
||||||
case ARRAY_PROCESS.expand_inv :
|
case ARRAY_PROCESS.expand_inv :
|
||||||
process_amount *= max(1, amo);
|
process_amount *= amo;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
process_length[i] = [max(1, amo), process_amount];
|
process_length[i] = [amo, process_amount];
|
||||||
}
|
}
|
||||||
|
|
||||||
var amoMax = process_amount;
|
var amoMax = process_amount;
|
||||||
|
|
|
@ -268,15 +268,6 @@ function typeArray(_type) { #region
|
||||||
return 0;
|
return 0;
|
||||||
} #endregion
|
} #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
|
function typeCompatible(fromType, toType, directional_cast = true) { #region
|
||||||
if(value_bit(fromType) & value_bit(toType) != 0)
|
if(value_bit(fromType) & value_bit(toType) != 0)
|
||||||
return true;
|
return true;
|
||||||
|
@ -474,6 +465,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
use_cache = true;
|
use_cache = true;
|
||||||
|
|
||||||
process_array = true;
|
process_array = true;
|
||||||
|
dynamic_array = false;
|
||||||
validateValue = true;
|
validateValue = true;
|
||||||
|
|
||||||
fullUpdate = false;
|
fullUpdate = false;
|
||||||
|
@ -600,6 +592,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
return self;
|
return self;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
static setArrayDynamic = function() { #region
|
||||||
|
dynamic_array = true;
|
||||||
|
return self;
|
||||||
|
} #endregion
|
||||||
|
|
||||||
static rejectConnect = function() { #region
|
static rejectConnect = function() { #region
|
||||||
auto_connect = false;
|
auto_connect = false;
|
||||||
return self;
|
return self;
|
||||||
|
@ -1130,10 +1127,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
if(display_type == VALUE_DISPLAY.area) { #region
|
if(display_type == VALUE_DISPLAY.area) { #region
|
||||||
var dispType = struct_try_get(nodeFrom.extra_data, "area_type");
|
var dispType = struct_try_get(nodeFrom.extra_data, "area_type");
|
||||||
var surfGet = nodeFrom.display_data;
|
var surfGet = nodeFrom.display_data;
|
||||||
if(!applyUnit || surfGet == -1) {
|
if(!applyUnit || surfGet == -1)
|
||||||
//print($" {value}");
|
|
||||||
return value;
|
return value;
|
||||||
}
|
|
||||||
|
|
||||||
var surf = surfGet();
|
var surf = surfGet();
|
||||||
var ww = surf[0];
|
var ww = surf[0];
|
||||||
|
@ -1258,17 +1253,19 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
if(!is_array(def_val))
|
if(!is_array(def_val))
|
||||||
return val;
|
return val;
|
||||||
|
|
||||||
if(typeArrayDynamic(display_type))
|
if(isDynamicArray(display_type))
|
||||||
return val;
|
return val;
|
||||||
|
|
||||||
if(isArray(val))
|
if(isArray(val))
|
||||||
return val;
|
return val;
|
||||||
|
|
||||||
if(!is_array(val))
|
if(!is_array(val))
|
||||||
val = array_create(def_length, val);
|
return array_create(def_length, val);
|
||||||
else if(array_length(val) < def_length) {
|
else if(array_length(val) < def_length) {
|
||||||
for( var i = array_length(val); i < def_length; i++ )
|
var _val = array_create(def_length);
|
||||||
val[i] = 0;
|
for( var i = 0; i < def_length; i++ )
|
||||||
|
_val[i] = array_safe_get(val, i, 0);
|
||||||
|
return _val;
|
||||||
}
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
|
@ -1311,13 +1308,14 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
|
|
||||||
val = arrayBalance(val);
|
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++ )
|
for( var i = 0, n = array_length(val); i < n; i++ )
|
||||||
val[i] = valueProcess(val[i], nod, applyUnit, arrIndex);
|
_val[i] = valueProcess(val[i], nod, applyUnit, arrIndex);
|
||||||
} else
|
return _val;
|
||||||
val = valueProcess(val, nod, applyUnit, arrIndex);
|
}
|
||||||
|
|
||||||
return val;
|
return valueProcess(val, nod, applyUnit, arrIndex);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getValueRecursive = function(_time = PROJECT.animator.current_frame) { #region
|
static getValueRecursive = function(_time = PROJECT.animator.current_frame) { #region
|
||||||
|
@ -1410,6 +1408,18 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
return val;
|
return val;
|
||||||
} #endregion
|
} #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
|
static isArray = function(val = undefined) { #region
|
||||||
if(val == undefined) {
|
if(val == undefined) {
|
||||||
if(cache_array[0])
|
if(cache_array[0])
|
||||||
|
@ -1448,7 +1458,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
val = getValue();
|
val = getValue();
|
||||||
|
|
||||||
if(!isArray(val))
|
if(!isArray(val))
|
||||||
return 1;
|
return -1;
|
||||||
|
|
||||||
if(array_depth == 0 && !typeArray(display_type))
|
if(array_depth == 0 && !typeArray(display_type))
|
||||||
return array_length(val);
|
return array_length(val);
|
||||||
|
|
Loading…
Reference in a new issue