mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 19:38:05 +01:00
Group trigger
This commit is contained in:
parent
59a6d6d16c
commit
c561c756f1
110 changed files with 12411 additions and 11822 deletions
|
@ -722,6 +722,7 @@
|
||||||
{"name":"s_node_stack","order":37,"path":"sprites/s_node_stack/s_node_stack.yy",},
|
{"name":"s_node_stack","order":37,"path":"sprites/s_node_stack/s_node_stack.yy",},
|
||||||
{"name":"s_fade_up","order":3,"path":"sprites/s_fade_up/s_fade_up.yy",},
|
{"name":"s_fade_up","order":3,"path":"sprites/s_fade_up/s_fade_up.yy",},
|
||||||
{"name":"panel_globalvar","order":2,"path":"scripts/panel_globalvar/panel_globalvar.yy",},
|
{"name":"panel_globalvar","order":2,"path":"scripts/panel_globalvar/panel_globalvar.yy",},
|
||||||
|
{"name":"node_3d_render","order":20,"path":"scripts/node_3d_render/node_3d_render.yy",},
|
||||||
{"name":"node_guide","order":18,"path":"scripts/node_guide/node_guide.yy",},
|
{"name":"node_guide","order":18,"path":"scripts/node_guide/node_guide.yy",},
|
||||||
{"name":"fd_rectangle_get_velocity_surface","order":24,"path":"scripts/fd_rectangle_get_velocity_surface/fd_rectangle_get_velocity_surface.yy",},
|
{"name":"fd_rectangle_get_velocity_surface","order":24,"path":"scripts/fd_rectangle_get_velocity_surface/fd_rectangle_get_velocity_surface.yy",},
|
||||||
{"name":"s_node_text_char_get","order":2,"path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",},
|
{"name":"s_node_text_char_get","order":2,"path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",},
|
||||||
|
|
|
@ -494,6 +494,7 @@
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_label_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_label_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_fg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_tab.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_tab.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_scroll_bar.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_scroll_bar.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_selection.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_selection.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
|
@ -1252,6 +1253,7 @@
|
||||||
{"id":{"name":"s_node_stack","path":"sprites/s_node_stack/s_node_stack.yy",},},
|
{"id":{"name":"s_node_stack","path":"sprites/s_node_stack/s_node_stack.yy",},},
|
||||||
{"id":{"name":"s_fade_up","path":"sprites/s_fade_up/s_fade_up.yy",},},
|
{"id":{"name":"s_fade_up","path":"sprites/s_fade_up/s_fade_up.yy",},},
|
||||||
{"id":{"name":"panel_globalvar","path":"scripts/panel_globalvar/panel_globalvar.yy",},},
|
{"id":{"name":"panel_globalvar","path":"scripts/panel_globalvar/panel_globalvar.yy",},},
|
||||||
|
{"id":{"name":"node_3d_render","path":"scripts/node_3d_render/node_3d_render.yy",},},
|
||||||
{"id":{"name":"node_guide","path":"scripts/node_guide/node_guide.yy",},},
|
{"id":{"name":"node_guide","path":"scripts/node_guide/node_guide.yy",},},
|
||||||
{"id":{"name":"fd_rectangle_get_velocity_surface","path":"scripts/fd_rectangle_get_velocity_surface/fd_rectangle_get_velocity_surface.yy",},},
|
{"id":{"name":"fd_rectangle_get_velocity_surface","path":"scripts/fd_rectangle_get_velocity_surface/fd_rectangle_get_velocity_surface.yy",},},
|
||||||
{"id":{"name":"s_node_text_char_get","path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",},},
|
{"id":{"name":"s_node_text_char_get","path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",},},
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
@ -14,9 +14,9 @@ event_inherited();
|
||||||
tb_edit = new textBox(TEXTBOX_INPUT.text, function(str) {
|
tb_edit = new textBox(TEXTBOX_INPUT.text, function(str) {
|
||||||
if(sep_editing == -1) return;
|
if(sep_editing == -1) return;
|
||||||
|
|
||||||
var sep = node.attributes[? "Separator"];
|
var sep = node.attributes.separator;
|
||||||
sep[sep_editing][1] = str;
|
sep[sep_editing][1] = str;
|
||||||
node.attributes[? "Separator"] = sep;
|
node.attributes.separator = sep;
|
||||||
|
|
||||||
node.sortIO();
|
node.sortIO();
|
||||||
} );
|
} );
|
||||||
|
@ -59,7 +59,7 @@ event_inherited();
|
||||||
draw_sprite_ui(THEME.hamburger, 0, hg / 2, _y + hg / 2, 0.5, 0.5,, COLORS._main_icon_light);
|
draw_sprite_ui(THEME.hamburger, 0, hg / 2, _y + hg / 2, 0.5, 0.5,, COLORS._main_icon_light);
|
||||||
|
|
||||||
if(sep_editing == disp[2]) {
|
if(sep_editing == disp[2]) {
|
||||||
var sep = node.attributes[? "Separator"];
|
var sep = node.attributes.separator;
|
||||||
|
|
||||||
WIDGET_CURRENT = tb_edit;
|
WIDGET_CURRENT = tb_edit;
|
||||||
tb_edit.setActiveFocus(sFOCUS, sHOVER);
|
tb_edit.setActiveFocus(sFOCUS, sHOVER);
|
||||||
|
@ -106,9 +106,9 @@ event_inherited();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sep_dragging > -1 && mouse_release(mb_left)) {
|
if(sep_dragging > -1 && mouse_release(mb_left)) {
|
||||||
var sep = node.attributes[? "Separator"];
|
var sep = node.attributes.separator;
|
||||||
sep[sep_dragging][0] = hovr;
|
sep[sep_dragging][0] = hovr;
|
||||||
node.attributes[? "Separator"] = sep;
|
node.attributes.separator = sep;
|
||||||
node.sortIO();
|
node.sortIO();
|
||||||
|
|
||||||
sep_dragging = -1;
|
sep_dragging = -1;
|
||||||
|
|
|
@ -25,7 +25,7 @@ if !ready exit;
|
||||||
|
|
||||||
var _txt = __txtx("dialog_group_order_add", "Add separator");
|
var _txt = __txtx("dialog_group_order_add", "Add separator");
|
||||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, _txt, THEME.add, 1, COLORS._main_value_positive) == 2) {
|
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, _txt, THEME.add, 1, COLORS._main_value_positive) == 2) {
|
||||||
var sep = node.attributes[? "Separator"];
|
var sep = node.attributes.separator;
|
||||||
array_push(sep, [ds_list_size(node.inputs) - node.custom_input_index, ""]);
|
array_push(sep, [ds_list_size(node.inputs) - node.custom_input_index, ""]);
|
||||||
node.sortIO();
|
node.sortIO();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ if !ready exit;
|
||||||
draw_sprite_stretched(THEME.ui_panel_bg, 0, x0, y0, x1 - x0, y1 - y0);
|
draw_sprite_stretched(THEME.ui_panel_bg, 0, x0, y0, x1 - x0, y1 - y0);
|
||||||
sp_recent.setActiveFocus(sFOCUS, sHOVER);
|
sp_recent.setActiveFocus(sFOCUS, sHOVER);
|
||||||
sp_recent.draw(x0 + ui(6), y0);
|
sp_recent.draw(x0 + ui(6), y0);
|
||||||
|
draw_sprite_stretched(THEME.ui_panel_fg, 0, x0, y0, x1 - x0, y1 - y0);
|
||||||
|
|
||||||
var bx = x1 - ui(28);
|
var bx = x1 - ui(28);
|
||||||
var by = y0 - ui(28 + 4);
|
var by = y0 - ui(28 + 4);
|
||||||
|
@ -80,8 +81,9 @@ if !ready exit;
|
||||||
|
|
||||||
x0 = x1 + ui(16);
|
x0 = x1 + ui(16);
|
||||||
x1 = dialog_x + dialog_w - ui(16);
|
x1 = dialog_x + dialog_w - ui(16);
|
||||||
|
|
||||||
bx = x0;
|
bx = x0;
|
||||||
|
var tab_cover = noone;
|
||||||
|
var th = ui(36) + THEME_VALUE.panel_tab_extend;
|
||||||
|
|
||||||
for( var i = 0; i < array_length(pages); i++ ) {
|
for( var i = 0; i < array_length(pages); i++ ) {
|
||||||
draw_set_text(f_p0, fa_left, fa_bottom, project_page == i? COLORS._main_text : COLORS._main_text_sub);
|
draw_set_text(f_p0, fa_left, fa_bottom, project_page == i? COLORS._main_text : COLORS._main_text_sub);
|
||||||
|
@ -101,8 +103,11 @@ if !ready exit;
|
||||||
if(txt == "Contests")
|
if(txt == "Contests")
|
||||||
tw += ui(32);
|
tw += ui(32);
|
||||||
|
|
||||||
if(project_page != i && point_in_rectangle(mouse_mx, mouse_my, bx, y0 - ui(32), bx + tw, y0)) {
|
if(project_page == i) {
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, bx, y0 - ui(32), tw, ui(40), COLORS.panel_tab_hover, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 1, bx, y0 - ui(32), tw, th, COLORS.panel_tab, 1);
|
||||||
|
tab_cover = BBOX().fromWH(bx, y0, tw, THEME_VALUE.panel_tab_extend);
|
||||||
|
} else if(point_in_rectangle(mouse_mx, mouse_my, bx, y0 - ui(32), bx + tw, y0)) {
|
||||||
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, bx, y0 - ui(32), tw, th, COLORS.panel_tab_hover, 1);
|
||||||
|
|
||||||
if(mouse_click(mb_left, sFOCUS)) {
|
if(mouse_click(mb_left, sFOCUS)) {
|
||||||
project_page = i;
|
project_page = i;
|
||||||
|
@ -112,11 +117,8 @@ if !ready exit;
|
||||||
expandAction = true;
|
expandAction = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
var foc = project_page == i;
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, bx, y0 - ui(32), tw, th, COLORS.panel_tab_inactive, 1);
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_tab, foc, bx, y0 - ui(32), tw, ui(40),
|
|
||||||
foc? COLORS.panel_tab_active : COLORS.panel_tab_inactive, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
var _btx = bx + ui(8);
|
var _btx = bx + ui(8);
|
||||||
if(txt == "Contests") {
|
if(txt == "Contests") {
|
||||||
|
@ -124,9 +126,8 @@ if !ready exit;
|
||||||
_btx += ui(32);
|
_btx += ui(32);
|
||||||
}
|
}
|
||||||
|
|
||||||
var cc = COLORS._main_text;
|
var cc = COLORS._main_text_sub;
|
||||||
if(txt == "Contests") cc = project_page == i? CDEF.yellow : COLORS._main_text_sub;
|
if(project_page == i) cc = txt == "Contests"? CDEF.yellow : COLORS._main_text;
|
||||||
if(project_page == i) cc = COLORS._main_text_on_accent;
|
|
||||||
|
|
||||||
draw_set_color(cc);
|
draw_set_color(cc);
|
||||||
draw_text(_btx, y0 - ui(4), dtxt);
|
draw_text(_btx, y0 - ui(4), dtxt);
|
||||||
|
@ -147,6 +148,8 @@ if !ready exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.ui_panel_bg, 0, x0, y0, x1 - x0, y1 - y0);
|
draw_sprite_stretched(THEME.ui_panel_bg, 0, x0, y0, x1 - x0, y1 - y0);
|
||||||
|
draw_sprite_stretched(THEME.ui_panel_fg, 0, x0, y0, x1 - x0, y1 - y0);
|
||||||
|
draw_sprite_bbox(THEME.ui_panel_tab, 3, tab_cover);
|
||||||
|
|
||||||
switch(pages[project_page]) {
|
switch(pages[project_page]) {
|
||||||
case "Sample projects" :
|
case "Sample projects" :
|
||||||
|
|
|
@ -286,7 +286,7 @@ enum CAMERA_PROJ {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function _3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
function _3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
||||||
var _gpos = inputs[| global_pos].getValue();
|
var _gpos = inputs[| global_pos].getValue();
|
||||||
var _gsca = inputs[| global_sca].getValue();
|
var _gsca = inputs[| global_sca].getValue();
|
||||||
|
|
||||||
|
@ -485,6 +485,7 @@ enum CAMERA_PROJ {
|
||||||
}
|
}
|
||||||
|
|
||||||
inputs[| global_pos].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
inputs[| global_pos].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
function _3d_local_transform(_lpos, _lrot, _lsca) {
|
function _3d_local_transform(_lpos, _lrot, _lsca) {
|
||||||
|
@ -501,13 +502,52 @@ enum CAMERA_PROJ {
|
||||||
matrix_stack_pop();
|
matrix_stack_pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, _pass = "diff", _scale = noone) {
|
function __3d_transform(pos = 0, rot = 0, sca = 0, lpos = 0, lrot = 0, lsca = 0, apply_local = true, sdim = true) constructor {
|
||||||
|
self.pos = pos;
|
||||||
|
self.rot = rot;
|
||||||
|
self.sca = sca;
|
||||||
|
|
||||||
|
self.local_pos = lpos;
|
||||||
|
self.local_rot = lrot;
|
||||||
|
self.local_sca = lsca;
|
||||||
|
|
||||||
|
self.apply_local = apply_local;
|
||||||
|
self.scaleDimension = sdim;
|
||||||
|
}
|
||||||
|
|
||||||
|
function __3d_light(dir = 0, height = 0, intensity = 0, color = c_white, ambient = c_white) constructor {
|
||||||
|
self.dir = dir;
|
||||||
|
self.height = height;
|
||||||
|
self.intensity = intensity;
|
||||||
|
self.color = color;
|
||||||
|
self.ambient = ambient;
|
||||||
|
}
|
||||||
|
|
||||||
|
function __3d_camera(proj, fov) constructor {
|
||||||
|
self.projection = proj;
|
||||||
|
self.fov = fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, _pass = "diff") {
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||||
|
|
||||||
|
var _pos = _transform.pos;
|
||||||
|
var _sca = _transform.sca;
|
||||||
|
var _lpos = _transform.local_pos;
|
||||||
|
var _lrot = _transform.local_rot;
|
||||||
|
var _lsca = _transform.local_sca;
|
||||||
|
|
||||||
|
var _ldir = _light.dir;
|
||||||
|
var _lhgt = _light.height;
|
||||||
|
var _lint = _light.intensity;
|
||||||
|
var _lclr = _light.color;
|
||||||
|
var _aclr = _light.ambient;
|
||||||
|
|
||||||
var _proj = _cam.projection;
|
var _proj = _cam.projection;
|
||||||
var _fov = _cam.fov;
|
var _fov = _cam.fov;
|
||||||
var _applyLocal = _scale == noone? true : _scale.local;
|
|
||||||
var scaleDimension = _scale == noone? true : _scale.dimension;
|
var _applyLocal = _transform.apply_local;
|
||||||
|
var scaleDimension = _transform.scaleDimension;
|
||||||
|
|
||||||
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
|
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ function BoundingBox(minx = noone, miny = noone, maxx = noone, maxy = noone) con
|
||||||
self.maxx = maxx;
|
self.maxx = maxx;
|
||||||
self.maxy = maxy;
|
self.maxy = maxy;
|
||||||
|
|
||||||
self.width = 0;
|
self.width = maxx - minx;
|
||||||
self.height = 0;
|
self.height = maxy - miny;
|
||||||
|
|
||||||
static addPoint = function(px, py) {
|
static addPoint = function(px, py) {
|
||||||
minx = minx == noone? px : min(minx, px);
|
minx = minx == noone? px : min(minx, px);
|
||||||
|
@ -30,7 +30,15 @@ function BoundingBox(minx = noone, miny = noone, maxx = noone, maxy = noone) con
|
||||||
static clone = function() { return new BoundingBox(minx, miny, maxx, maxy); }
|
static clone = function() { return new BoundingBox(minx, miny, maxx, maxy); }
|
||||||
}
|
}
|
||||||
|
|
||||||
function node_bbox(x0, y0, x1, y1) constructor {
|
function BBOX() { return new __BBOX(); }
|
||||||
|
function __BBOX() constructor {
|
||||||
|
x0 = 0; x1 = 0;
|
||||||
|
y0 = 0; y1 = 0;
|
||||||
|
|
||||||
|
xc = 0; yc = 0;
|
||||||
|
w = 0; h = 0;
|
||||||
|
|
||||||
|
static fromPoints = function(x0, y0, x1, y1) {
|
||||||
self.x0 = x0;
|
self.x0 = x0;
|
||||||
self.x1 = x1;
|
self.x1 = x1;
|
||||||
self.y0 = y0;
|
self.y0 = y0;
|
||||||
|
@ -41,5 +49,22 @@ function node_bbox(x0, y0, x1, y1) constructor {
|
||||||
w = x1 - x0;
|
w = x1 - x0;
|
||||||
h = y1 - y0;
|
h = y1 - y0;
|
||||||
|
|
||||||
static clone = function() { return node_bbox(x0, y0, x1, y1); };
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
static fromWH = function(x0, y0, w, h) {
|
||||||
|
self.x0 = x0;
|
||||||
|
self.x1 = x0 + w;
|
||||||
|
self.y0 = y0;
|
||||||
|
self.y1 = y0 + h;
|
||||||
|
|
||||||
|
self.xc = (x0 + x1) / 2;
|
||||||
|
self.yc = (y0 + y1) / 2;
|
||||||
|
self.w = w;
|
||||||
|
self.h = h;
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
static clone = function() { return BBOX().fromPoints(x0, y0, x1, y1); };
|
||||||
}
|
}
|
|
@ -111,11 +111,11 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
["Render", true], 21
|
["Render", true], 21
|
||||||
];
|
];
|
||||||
|
|
||||||
attributes[? "part_amount"] = 512;
|
attributes.part_amount = 512;
|
||||||
array_push(attributeEditors, ["Maximum particles", "part_amount",
|
array_push(attributeEditors, ["Maximum particles", "part_amount",
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) { attributes[? "part_amount"] = val; }) ]);
|
new textBox(TEXTBOX_INPUT.number, function(val) { attributes.part_amount = val; }) ]);
|
||||||
|
|
||||||
parts = array_create(attributes[? "part_amount"]);
|
parts = array_create(attributes.part_amount);
|
||||||
parts_runner = 0;
|
parts_runner = 0;
|
||||||
|
|
||||||
seed = 0;
|
seed = 0;
|
||||||
|
@ -125,7 +125,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
|
|
||||||
current_data = [];
|
current_data = [];
|
||||||
|
|
||||||
for(var i = 0; i < attributes[? "part_amount"]; i++)
|
for(var i = 0; i < attributes.part_amount; i++)
|
||||||
parts[i] = new __part(self);
|
parts[i] = new __part(self);
|
||||||
|
|
||||||
static spawn = function(_time = ANIMATOR.current_frame, _pos = -1) {
|
static spawn = function(_time = ANIMATOR.current_frame, _pos = -1) {
|
||||||
|
@ -270,10 +270,10 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
part.setPhysic(_vx, _vy, _acc, _grav, _gvDir, _wigg, _trn, _turnSc);
|
part.setPhysic(_vx, _vy, _acc, _grav, _gvDir, _wigg, _trn, _turnSc);
|
||||||
part.setTransform(_scx, _scy, _scale_time, _rot, _rot_spd, _follow);
|
part.setTransform(_scx, _scy, _scale_time, _rot, _rot_spd, _follow);
|
||||||
part.setDraw(_color, _bld, _alp, _fade);
|
part.setDraw(_color, _bld, _alp, _fade);
|
||||||
spawn_index = safe_mod(spawn_index + 1, attributes[? "part_amount"]);
|
spawn_index = safe_mod(spawn_index + 1, attributes.part_amount);
|
||||||
onSpawn(_time, part);
|
onSpawn(_time, part);
|
||||||
|
|
||||||
parts_runner = safe_mod(parts_runner + 1, attributes[? "part_amount"]);
|
parts_runner = safe_mod(parts_runner + 1, attributes.part_amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkPartPool() {
|
function checkPartPool() {
|
||||||
var _part_amo = attributes[? "part_amount"];
|
var _part_amo = attributes.part_amount;
|
||||||
var _curr_amo = array_length(parts);
|
var _curr_amo = array_length(parts);
|
||||||
|
|
||||||
if(_part_amo > _curr_amo) {
|
if(_part_amo > _curr_amo) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
function APPEND(_path, context = PANEL_GRAPH.getCurrentContext()) {
|
function APPEND(_path, context = PANEL_GRAPH.getCurrentContext()) {
|
||||||
if(_path == "") return noone;
|
if(_path == "") return noone;
|
||||||
var _map = json_load(_path);
|
var _map = json_load_struct(_path);
|
||||||
|
|
||||||
if(_map == -1) {
|
if(_map == -1) {
|
||||||
printlog("Decode error");
|
printlog("Decode error");
|
||||||
|
@ -19,8 +19,8 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
|
||||||
APPENDING = true;
|
APPENDING = true;
|
||||||
UNDO_HOLDING = true;
|
UNDO_HOLDING = true;
|
||||||
|
|
||||||
if(ds_map_exists(_map, "version")) {
|
if(struct_has(_map, "version")) {
|
||||||
var _v = _map[? "version"];
|
var _v = _map.version;
|
||||||
LOADING_VERSION = _v;
|
LOADING_VERSION = _v;
|
||||||
if(_v != SAVEFILE_VERSION) {
|
if(_v != SAVEFILE_VERSION) {
|
||||||
var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION);
|
var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION);
|
||||||
|
@ -28,8 +28,8 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ds_map_exists(_map, "nodes")) return noone;
|
if(!struct_has(_map, "nodes")) return noone;
|
||||||
var _node_list = _map[? "nodes"];
|
var _node_list = _map.nodes;
|
||||||
var appended_list = ds_list_create();
|
var appended_list = ds_list_create();
|
||||||
var node_create = ds_list_create();
|
var node_create = ds_list_create();
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
|
||||||
ds_map_clear(APPEND_MAP);
|
ds_map_clear(APPEND_MAP);
|
||||||
var t = current_time;
|
var t = current_time;
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(_node_list); i++) {
|
for(var i = 0; i < array_length(_node_list); i++) {
|
||||||
var _node = nodeLoad(_node_list[| i], true, context);
|
var _node = nodeLoad(_node_list[i], true, context);
|
||||||
if(_node) ds_list_add(appended_list, _node);
|
if(_node) ds_list_add(appended_list, _node);
|
||||||
}
|
}
|
||||||
printlog("Load time: " + string(current_time - t)); t = current_time;
|
printlog("Load time: " + string(current_time - t)); t = current_time;
|
||||||
|
@ -98,12 +98,12 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
|
||||||
try {
|
try {
|
||||||
while(++pass < 3 && !ds_queue_empty(CONNECTION_CONFLICT)) {
|
while(++pass < 3 && !ds_queue_empty(CONNECTION_CONFLICT)) {
|
||||||
var size = ds_queue_size(CONNECTION_CONFLICT);
|
var size = ds_queue_size(CONNECTION_CONFLICT);
|
||||||
log_message("APPEND", "[Connect] " + string(size) + " Connection conflict(s) detected ( pass: " + string(pass) + " )");
|
log_message("APPEND", $"[Connect] {size} Connection conflict(s) detected (pass: {pass})");
|
||||||
repeat(size) {
|
repeat(size) {
|
||||||
var junc = ds_queue_dequeue(CONNECTION_CONFLICT);
|
var junc = ds_queue_dequeue(CONNECTION_CONFLICT);
|
||||||
var res = junc.connect(true);
|
var res = junc.connect(true);
|
||||||
|
|
||||||
log_message("APPEND", "[Connect] Reconnecting " + string(junc.name) + " " + (res? "SUCCESS" : "FAILED"));
|
log_message("APPEND", $"[Connect] Reconnecting {junc.name} {res? "SUCCESS" : "FAILED"}");
|
||||||
}
|
}
|
||||||
Render(true);
|
Render(true);
|
||||||
}
|
}
|
||||||
|
@ -131,8 +131,8 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
|
||||||
PANEL_ANIMATION.updatePropertyList();
|
PANEL_ANIMATION.updatePropertyList();
|
||||||
UPDATE |= RENDER_TYPE.full;
|
UPDATE |= RENDER_TYPE.full;
|
||||||
|
|
||||||
if(ds_map_exists(_map, "metadata")) {
|
if(struct_has(_map, "metadata")) {
|
||||||
var meta = _map[? "metadata"];
|
var meta = _map.metadata;
|
||||||
for( var i = 0; i < ds_list_size(node_create); i++ ) {
|
for( var i = 0; i < ds_list_size(node_create); i++ ) {
|
||||||
var _node = node_create[| i];
|
var _node = node_create[| i];
|
||||||
if(!struct_has(_node, "metadata")) continue;
|
if(!struct_has(_node, "metadata")) continue;
|
||||||
|
@ -141,7 +141,6 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ds_map_destroy(_map);
|
|
||||||
refreshNodeMap();
|
refreshNodeMap();
|
||||||
|
|
||||||
return node_create;
|
return node_create;
|
||||||
|
|
|
@ -127,7 +127,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
|
||||||
y = _y;
|
y = _y;
|
||||||
w = 0;
|
w = 0;
|
||||||
h = ui(204);
|
h = ui(204);
|
||||||
mode = ds_list_get(_extra_data, 0);
|
mode = _extra_data[0];
|
||||||
|
|
||||||
if(buttonInstant(THEME.button_hide, _x - ui(48), _y + ui(64 - 48), ui(96), ui(96), _m, adjust_shape && active, adjust_shape && hover,
|
if(buttonInstant(THEME.button_hide, _x - ui(48), _y + ui(64 - 48), ui(96), ui(96), _m, adjust_shape && active, adjust_shape && hover,
|
||||||
"", THEME.inspector_area, array_safe_get(_data, 4), c_white) == 2) {
|
"", THEME.inspector_area, array_safe_get(_data, 4), c_white) == 2) {
|
||||||
|
@ -213,7 +213,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_extra_data[| 0] = (mode + 1) % 3;
|
_extra_data[0] = (mode + 1) % 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,11 @@ function draw_sprite_stretched_points(spr, ind, _x0, _y0, _x1, _y1) {
|
||||||
__draw_sprite_stretched(spr, ind, _xs, _ys, _w, _h);
|
__draw_sprite_stretched(spr, ind, _xs, _ys, _w, _h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function draw_sprite_bbox(spr, ind, _bbox) {
|
||||||
|
if(_bbox == noone) return;
|
||||||
|
__draw_sprite_stretched(spr, ind, _bbox.x0, _bbox.y0, _bbox.w, _bbox.h);
|
||||||
|
}
|
||||||
|
|
||||||
function draw_sprite_uniform(spr, ind, _x, _y, scale, color = c_white) {
|
function draw_sprite_uniform(spr, ind, _x, _y, scale, color = c_white) {
|
||||||
draw_sprite_ext(spr, ind, round(_x), round(_y), scale, scale, 0, color, 1);
|
draw_sprite_ext(spr, ind, round(_x), round(_y), scale, scale, 0, color, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
function draw_surface_align(surface, _x, _y, _s, _halign = fa_left, _valign = fa_top) {
|
function draw_surface_align(surface, _x, _y, _s, _halign = fa_left, _valign = fa_top) {
|
||||||
|
if(!is_surface(surface)) return;
|
||||||
|
|
||||||
var w = surface_get_width(surface) * _s;
|
var w = surface_get_width(surface) * _s;
|
||||||
var h = surface_get_height(surface) * _s;
|
var h = surface_get_height(surface) * _s;
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,7 @@ function gradientKey(time, value) constructor {
|
||||||
|
|
||||||
static clone = function() { return new gradientKey(time, value); }
|
static clone = function() { return new gradientKey(time, value); }
|
||||||
|
|
||||||
static serialize = function() {
|
static serialize = function() { return self; }
|
||||||
var m = ds_map_create();
|
|
||||||
m[? "time"] = time;
|
|
||||||
m[? "value"] = value;
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function gradientObject(color = c_black) constructor {
|
function gradientObject(color = c_black) constructor {
|
||||||
|
@ -142,14 +137,10 @@ function gradientObject(color = c_black) constructor {
|
||||||
s = json_try_parse(str);
|
s = json_try_parse(str);
|
||||||
else if(is_struct(str))
|
else if(is_struct(str))
|
||||||
s = str;
|
s = str;
|
||||||
else if(ds_exists(str, ds_type_list)) {
|
else if(is_array(str)) {
|
||||||
|
|
||||||
keys = [];
|
keys = [];
|
||||||
for( var i = 0; i < ds_list_size(str); i++ ) {
|
for( var i = 0; i < array_length(str); i++ )
|
||||||
if(!ds_exists(str[| i], ds_type_map)) continue;
|
keys[i] = new gradientKey(str[i].time, str[i].value);
|
||||||
|
|
||||||
keys[i] = new gradientKey(str[| i][? "time"], str[| i][? "value"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
function histogramInit() {
|
function histogramInit() {
|
||||||
attributes[? "preview_resolution"] = 64;
|
attributes.preview_resolution = 64;
|
||||||
array_push(attributeEditors, ["Preview resolution", "preview_resolution",
|
array_push(attributeEditors, ["Preview resolution", "preview_resolution",
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) { attributes[? "preview_resolution"] = val; })]);
|
new textBox(TEXTBOX_INPUT.number, function(val) { attributes.preview_resolution = val; })]);
|
||||||
|
|
||||||
attributes[? "preview_sample"] = 32;
|
attributes.preview_sample = 32;
|
||||||
array_push(attributeEditors, ["Preview sample", "preview_sample",
|
array_push(attributeEditors, ["Preview sample", "preview_sample",
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) { attributes[? "preview_sample"] = val; })]);
|
new textBox(TEXTBOX_INPUT.number, function(val) { attributes.preview_sample = val; })]);
|
||||||
|
|
||||||
for( var i = 0; i < 4; i++ ) {
|
for( var i = 0; i < 4; i++ ) {
|
||||||
hist[i] = array_create(attributes[? "preview_resolution"] + 1);
|
hist[i] = array_create(attributes.preview_resolution + 1);
|
||||||
histShow[i] = true;
|
histShow[i] = true;
|
||||||
}
|
}
|
||||||
histMax = 0;
|
histMax = 0;
|
||||||
|
@ -50,7 +50,7 @@ function histogramDraw(_x, _y, _w, _h) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function histogramUpdate(surface) {
|
function histogramUpdate(surface) {
|
||||||
if(array_length(hist[0]) != attributes[? "preview_resolution"] + 1)
|
if(array_length(hist[0]) != attributes.preview_resolution + 1)
|
||||||
histogramInit();
|
histogramInit();
|
||||||
|
|
||||||
if(!is_surface(surface)) return;
|
if(!is_surface(surface)) return;
|
||||||
|
@ -58,8 +58,8 @@ function histogramUpdate(surface) {
|
||||||
histMax = 0;
|
histMax = 0;
|
||||||
var sw = surface_get_width(surface);
|
var sw = surface_get_width(surface);
|
||||||
var sh = surface_get_height(surface);
|
var sh = surface_get_height(surface);
|
||||||
var stw = max(1, sw / attributes[? "preview_sample"]);
|
var stw = max(1, sw / attributes.preview_sample);
|
||||||
var sth = max(1, sh / attributes[? "preview_sample"]);
|
var sth = max(1, sh / attributes.preview_sample);
|
||||||
|
|
||||||
for( var j = 0; j < 4; j++ )
|
for( var j = 0; j < 4; j++ )
|
||||||
for( var i = 0; i < array_length(hist[0]); i++ ) {
|
for( var i = 0; i < array_length(hist[0]); i++ ) {
|
||||||
|
@ -73,9 +73,9 @@ function histogramUpdate(surface) {
|
||||||
for( var j = 0; j < sh; j += sth ) {
|
for( var j = 0; j < sh; j += sth ) {
|
||||||
var col = buffer_get_color(surface_buffer, i, j, sw, sh);
|
var col = buffer_get_color(surface_buffer, i, j, sw, sh);
|
||||||
var colA = [];
|
var colA = [];
|
||||||
colA[0] = round(color_get_red(col) / 256 * attributes[? "preview_resolution"]);
|
colA[0] = round(color_get_red(col) / 256 * attributes.preview_resolution);
|
||||||
colA[1] = round(color_get_green(col) / 256 * attributes[? "preview_resolution"]);
|
colA[1] = round(color_get_green(col) / 256 * attributes.preview_resolution);
|
||||||
colA[2] = round(color_get_blue(col) / 256 * attributes[? "preview_resolution"]);
|
colA[2] = round(color_get_blue(col) / 256 * attributes.preview_resolution);
|
||||||
colA[3] = round((colA[0] + colA[1] + colA[2]) / 3);
|
colA[3] = round((colA[0] + colA[1] + colA[2]) / 3);
|
||||||
|
|
||||||
for( var k = 0; k < 4; k++ ) {
|
for( var k = 0; k < 4; k++ ) {
|
||||||
|
|
|
@ -56,16 +56,10 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false) {
|
||||||
READONLY = readonly;
|
READONLY = readonly;
|
||||||
SET_PATH(path);
|
SET_PATH(path);
|
||||||
|
|
||||||
var file = file_text_open_read(temp_path);
|
var _load_content = json_load_struct(temp_path);
|
||||||
var load_str = "";
|
|
||||||
|
|
||||||
while(!file_text_eof(file))
|
if(struct_has(_load_content, "version")) {
|
||||||
load_str += file_text_readln(file);
|
var _v = _load_content.version;
|
||||||
file_text_close(file);
|
|
||||||
|
|
||||||
var _map = json_decode(load_str);
|
|
||||||
if(ds_map_exists(_map, "version")) {
|
|
||||||
var _v = _map[? "version"];
|
|
||||||
LOADING_VERSION = _v;
|
LOADING_VERSION = _v;
|
||||||
if(_v != SAVEFILE_VERSION) {
|
if(_v != SAVEFILE_VERSION) {
|
||||||
var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION);
|
var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION);
|
||||||
|
@ -79,11 +73,11 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false) {
|
||||||
nodeCleanUp();
|
nodeCleanUp();
|
||||||
|
|
||||||
var create_list = ds_list_create();
|
var create_list = ds_list_create();
|
||||||
if(ds_map_exists(_map, "nodes")) {
|
if(struct_has(_load_content, "nodes")) {
|
||||||
try {
|
try {
|
||||||
var _node_list = _map[? "nodes"];
|
var _node_list = _load_content.nodes;
|
||||||
for(var i = 0; i < ds_list_size(_node_list); i++) {
|
for(var i = 0; i < array_length(_node_list); i++) {
|
||||||
var _node = nodeLoad(_node_list[| i]);
|
var _node = nodeLoad(_node_list[i]);
|
||||||
if(_node) ds_list_add(create_list, _node);
|
if(_node) ds_list_add(create_list, _node);
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
@ -92,37 +86,37 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(ds_map_exists(_map, "animator")) {
|
if(struct_has(_load_content, "animator")) {
|
||||||
var _anim_map = _map[? "animator"];
|
var _anim_map = _load_content.animator;
|
||||||
ANIMATOR.frames_total = ds_map_try_get(_anim_map, "frames_total");
|
ANIMATOR.frames_total = _anim_map.frames_total;
|
||||||
ANIMATOR.framerate = ds_map_try_get(_anim_map, "framerate");
|
ANIMATOR.framerate = _anim_map.framerate;
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
log_warning("LOAD, animator", exception_print(e));
|
log_warning("LOAD, animator", exception_print(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(ds_map_exists(_map, "metadata"))
|
if(struct_has(_load_content, "metadata"))
|
||||||
METADATA.deserialize(_map[? "metadata"]);
|
METADATA.deserialize(_load_content.metadata);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
log_warning("LOAD, metadata", exception_print(e));
|
log_warning("LOAD, metadata", exception_print(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL = new Node_Global();
|
GLOBAL = new Node_Global();
|
||||||
try {
|
try {
|
||||||
if(ds_map_exists(_map, "global"))
|
if(struct_has(_load_content, "global"))
|
||||||
GLOBAL.deserialize(_map[? "global"]);
|
GLOBAL.deserialize(_load_content.global);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
log_warning("LOAD, global", exception_print(e));
|
log_warning("LOAD, global", exception_print(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(ds_map_exists(_map, "addon")) {
|
if(struct_has(_load_content, "addon")) {
|
||||||
var _addon = _map[? "addon"];
|
var _addon = _load_content.addon;
|
||||||
|
|
||||||
with(addon) {
|
with(addon) {
|
||||||
if(!ds_map_exists(_addon, name)) continue;
|
if(!struct_has(_addon, name)) continue;
|
||||||
var _mp = json_parse(_addon[? name]);
|
var _mp = json_parse(_addon.name);
|
||||||
|
|
||||||
lua_call(thread, "deserialize", _mp);
|
lua_call(thread, "deserialize", _mp);
|
||||||
}
|
}
|
||||||
|
@ -178,7 +172,7 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false) {
|
||||||
try {
|
try {
|
||||||
while(++pass < 4 && !ds_queue_empty(CONNECTION_CONFLICT)) {
|
while(++pass < 4 && !ds_queue_empty(CONNECTION_CONFLICT)) {
|
||||||
var size = ds_queue_size(CONNECTION_CONFLICT);
|
var size = ds_queue_size(CONNECTION_CONFLICT);
|
||||||
log_message("LOAD", "[Connect] " + string(size) + " Connection conflict(s) detected ( pass: " + string(pass) + " )");
|
log_message("LOAD", $"[Connect] {size} Connection conflict(s) detected (pass: {pass})");
|
||||||
repeat(size)
|
repeat(size)
|
||||||
ds_queue_dequeue(CONNECTION_CONFLICT).connect();
|
ds_queue_dequeue(CONNECTION_CONFLICT).connect();
|
||||||
Render();
|
Render();
|
||||||
|
@ -208,7 +202,6 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false) {
|
||||||
log_message("FILE", "load " + path, THEME.noti_icon_file_load);
|
log_message("FILE", "load " + path, THEME.noti_icon_file_load);
|
||||||
PANEL_MENU.setNotiIcon(THEME.noti_icon_file_load);
|
PANEL_MENU.setNotiIcon(THEME.noti_icon_file_load);
|
||||||
|
|
||||||
ds_map_destroy(_map);
|
|
||||||
refreshNodeMap();
|
refreshNodeMap();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -31,29 +31,26 @@ function MetaDataManager() constructor {
|
||||||
];
|
];
|
||||||
|
|
||||||
static serialize = function() {
|
static serialize = function() {
|
||||||
var m = ds_map_create();
|
var m = {};
|
||||||
m[? "description"] = description;
|
m.description = description;
|
||||||
m[? "author"] = author;
|
m.author = author;
|
||||||
m[? "contact"] = contact;
|
m.contact = contact;
|
||||||
m[? "alias"] = alias;
|
m.alias = alias;
|
||||||
m[? "aut_id"] = author_steam_id;
|
m.aut_id = author_steam_id;
|
||||||
m[? "file_id"] = file_id;
|
m.file_id = file_id;
|
||||||
|
m.tags = tags;
|
||||||
ds_map_add_list(m, "tags", ds_list_create_from_array(tags));
|
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
static deserialize = function(m, readonly = false) {
|
static deserialize = function(m, readonly = false) {
|
||||||
description = ds_map_try_get(m, "description", description);
|
description = struct_try_get(m, "description", description);
|
||||||
author = ds_map_try_get(m, "author", author);
|
author = struct_try_get(m, "author", author);
|
||||||
contact = ds_map_try_get(m, "contact", contact);
|
contact = struct_try_get(m, "contact", contact);
|
||||||
alias = ds_map_try_get(m, "alias", alias);
|
alias = struct_try_get(m, "alias", alias);
|
||||||
author_steam_id = ds_map_try_get(m, "aut_id", author_steam_id);
|
author_steam_id = struct_try_get(m, "aut_id", author_steam_id);
|
||||||
file_id = ds_map_try_get(m, "file_id", file_id);
|
file_id = struct_try_get(m, "file_id", file_id);
|
||||||
|
tags = struct_try_get(m, "tags", tags);
|
||||||
if(ds_map_exists(m, "tags"))
|
|
||||||
tags = array_create_from_list(m[? "tags"]);
|
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,19 +179,20 @@ function Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, false, _dimS );
|
||||||
var _scale = { local: false, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
submit_vertex();
|
submit_vertex();
|
||||||
_3d_post_setup();
|
_3d_post_setup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -70,7 +70,7 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
0, 2, 1, 3,
|
0, 2, 1, 3,
|
||||||
]
|
]
|
||||||
|
|
||||||
attributes[? "auto_update"] = true;
|
attributes.auto_update = true;
|
||||||
|
|
||||||
array_push(attributeEditors, ["Auto Update", "auto_update", new checkBox(function() { attribute[? "auto_update"] = !attribute[? "auto_update"]; }, false)]);
|
array_push(attributeEditors, ["Auto Update", "auto_update", new checkBox(function() { attribute[? "auto_update"] = !attribute[? "auto_update"]; }, false)]);
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
var _dspTex = _data[15];
|
var _dspTex = _data[15];
|
||||||
var _dspStr = _data[16];
|
var _dspStr = _data[16];
|
||||||
|
|
||||||
if(_output_index == 0 && attributes[? "auto_update"]) {
|
if(_output_index == 0 && attributes.auto_update) {
|
||||||
var _vert = _data[11];
|
var _vert = _data[11];
|
||||||
|
|
||||||
for( var i = 0; i < array_length(vertexObjects); i++ )
|
for( var i = 0; i < array_length(vertexObjects); i++ )
|
||||||
|
@ -167,10 +167,11 @@ function Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, true, _dimS );
|
||||||
var _scale = { local: true, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
for( var i = 0; i < array_length(vertexObjects); i++ )
|
for( var i = 0; i < array_length(vertexObjects); i++ )
|
||||||
vertexObjects[i].submit();
|
vertexObjects[i].submit();
|
||||||
_3d_post_setup();
|
_3d_post_setup();
|
||||||
|
|
|
@ -313,10 +313,11 @@ function Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
||||||
if(_upda && ANIMATOR.frame_progress)
|
if(_upda && ANIMATOR.frame_progress)
|
||||||
generateMesh();
|
generateMesh();
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, false, _dimS );
|
||||||
var _scale = { local: false, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
submit_vertex(_array_index);
|
submit_vertex(_array_index);
|
||||||
_3d_post_setup();
|
_3d_post_setup();
|
||||||
|
|
||||||
|
|
|
@ -235,9 +235,6 @@ function Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
|
|
||||||
inputs[| 16].setVisible(_proj == 1);
|
inputs[| 16].setVisible(_proj == 1);
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
|
||||||
var _scale = { local: true, dimension: _dimS };
|
|
||||||
|
|
||||||
for( var i = 0; i < array_length(output_display_list) - 1; i++ ) {
|
for( var i = 0; i < array_length(output_display_list) - 1; i++ ) {
|
||||||
var ind = output_display_list[i];
|
var ind = output_display_list[i];
|
||||||
var _outSurf = outputs[| ind].getValue();
|
var _outSurf = outputs[| ind].getValue();
|
||||||
|
@ -248,7 +245,11 @@ function Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, true, _dimS );
|
||||||
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
for(var i = 0; i < array_length(VB); i++) {
|
for(var i = 0; i < array_length(VB); i++) {
|
||||||
if(i >= array_length(materialIndex)) continue;
|
if(i >= array_length(materialIndex)) continue;
|
||||||
|
|
||||||
|
|
|
@ -184,10 +184,11 @@ function Node_3D_Cone(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, true, _dimS );
|
||||||
var _scale = { local: true, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
|
|
||||||
matrix_set(matrix_world, matrix_stack_top());
|
matrix_set(matrix_world, matrix_stack_top());
|
||||||
vertexObjects[0].submit(face_bas);
|
vertexObjects[0].submit(face_bas);
|
||||||
|
|
|
@ -139,10 +139,11 @@ function Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, true, _dimS );
|
||||||
var _scale = { local: true, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
|
|
||||||
for(var i = 0; i < array_length(vertexObjects); i++) {
|
for(var i = 0; i < array_length(vertexObjects); i++) {
|
||||||
var _surf = _usetex? _data[6 + i] : _inSurf;
|
var _surf = _usetex? _data[6 + i] : _inSurf;
|
||||||
|
|
|
@ -210,10 +210,11 @@ function Node_3D_Cylinder(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, true, _dimS );
|
||||||
var _scale = { local: true, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
|
|
||||||
matrix_set(matrix_world, matrix_stack_top());
|
matrix_set(matrix_world, matrix_stack_top());
|
||||||
vertexObjects[0].submit(face_top);
|
vertexObjects[0].submit(face_top);
|
||||||
|
|
|
@ -196,10 +196,11 @@ function Node_3D_Sphere(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, true, _dimS );
|
||||||
var _scale = { local: true, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
vertexObjects[0].submit(texture);
|
vertexObjects[0].submit(texture);
|
||||||
_3d_post_setup();
|
_3d_post_setup();
|
||||||
|
|
||||||
|
|
241
scripts/node_3d_render/node_3d_render.gml
Normal file
241
scripts/node_3d_render/node_3d_render.gml
Normal file
|
@ -0,0 +1,241 @@
|
||||||
|
//function Node_3D_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
// name = "3D Render";
|
||||||
|
|
||||||
|
// inputs[| 2] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||||
|
// .setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
|
// inputs[| 3] = nodeValue("Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0.5, 0.5 ])
|
||||||
|
// .setDisplay(VALUE_DISPLAY.vector)
|
||||||
|
// .setUnitRef( function() { return inputs[| 2].getValue(); }, VALUE_UNIT.reference);
|
||||||
|
|
||||||
|
// inputs[| 4] = nodeValue("Render rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||||
|
// .setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
|
// inputs[| 5] = nodeValue("Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||||
|
// .setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
|
// inputs[| 6] = nodeValue("Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||||
|
// .setDisplay(VALUE_DISPLAY.rotation)
|
||||||
|
// .rejectArray();
|
||||||
|
|
||||||
|
// inputs[| 7] = nodeValue("Light height", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||||
|
// .setDisplay(VALUE_DISPLAY.slider, [-1, 1, 0.01])
|
||||||
|
// .rejectArray();
|
||||||
|
|
||||||
|
// inputs[| 8] = nodeValue("Light intensity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||||
|
// .setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01])
|
||||||
|
// .rejectArray();
|
||||||
|
|
||||||
|
// inputs[| 9] = nodeValue("Light color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white)
|
||||||
|
// .rejectArray();
|
||||||
|
|
||||||
|
// inputs[| 10] = nodeValue("Ambient color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_grey)
|
||||||
|
// .rejectArray();
|
||||||
|
|
||||||
|
// inputs[| 15] = nodeValue("Projection", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
|
// .setDisplay(VALUE_DISPLAY.enum_button, [ "Orthographic", "Perspective" ])
|
||||||
|
// .rejectArray();
|
||||||
|
|
||||||
|
// inputs[| 16] = nodeValue("Field of view", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 60)
|
||||||
|
// .setDisplay(VALUE_DISPLAY.slider, [ 0, 90, 1 ])
|
||||||
|
// .rejectArray();
|
||||||
|
|
||||||
|
// inputs[| 17] = nodeValue("Scale view with dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
|
||||||
|
|
||||||
|
// input_display_list = [
|
||||||
|
// ["Output", false], 2, 17,
|
||||||
|
// ["Geometry", false], 0, 1,
|
||||||
|
// ["Object transform", false], 14, 13, 11,
|
||||||
|
// ["Camera", false], 15, 16, 3, 5,
|
||||||
|
// ["Light", false], 6, 7, 8, 9, 10,
|
||||||
|
// ["Textures", true], 12,
|
||||||
|
// ];
|
||||||
|
// input_length = ds_list_size(inputs);
|
||||||
|
// input_display_len = array_length(input_display_list);
|
||||||
|
|
||||||
|
// outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
|
// outputs[| 1] = nodeValue("3D scene", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||||
|
|
||||||
|
// outputs[| 2] = nodeValue("Normal pass", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
|
// output_display_list = [
|
||||||
|
// 0, 2, 1
|
||||||
|
// ]
|
||||||
|
|
||||||
|
// _3d_node_init(2, /*Transform*/ 3, 5, 14, 13, 11);
|
||||||
|
|
||||||
|
// tex_surface = surface_create(1, 1);
|
||||||
|
|
||||||
|
// function reset_tex() {
|
||||||
|
// tex_surface = surface_verify(tex_surface, 1, 1);
|
||||||
|
// surface_set_target(tex_surface);
|
||||||
|
// draw_clear(c_black);
|
||||||
|
// surface_reset_target();
|
||||||
|
// }
|
||||||
|
// reset_tex();
|
||||||
|
|
||||||
|
// static onValueUpdate = function(index = 0) {
|
||||||
|
// if(index == 12) updateObj(false);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function setPath(path) {
|
||||||
|
// inputs[| 0].setValue(path);
|
||||||
|
// updateObj();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function createMaterial(m_index) {
|
||||||
|
// var index = ds_list_size(inputs);
|
||||||
|
// inputs[| index] = nodeValue(materialNames[m_index] + " texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, tex_surface);
|
||||||
|
// inputs[| index].setVisible(true);
|
||||||
|
|
||||||
|
// input_display_list[input_display_len + m_index] = index;
|
||||||
|
|
||||||
|
// if(m_index >= array_length(materials)) return;
|
||||||
|
|
||||||
|
// var matY = y - (array_length(materials) - 1) / 2 * (128 + 32);
|
||||||
|
// var mat = materials[m_index];
|
||||||
|
|
||||||
|
// if(file_exists(mat.diff_path)) {
|
||||||
|
// var sol = Node_create_Image_path(x - (w + 64), matY + m_index * (128 + 32), mat.diff_path);
|
||||||
|
// sol.name = mat.name + " texture";
|
||||||
|
|
||||||
|
// inputs[| index].setFrom(sol.outputs[| 0]);
|
||||||
|
// } else {
|
||||||
|
// var sol = nodeBuild("Node_Solid", x - (w + 64), matY + m_index * (128 + 32));
|
||||||
|
// sol.name = mat.name + " texture";
|
||||||
|
// sol.inputs[| 1].setValue(mat.diff);
|
||||||
|
|
||||||
|
// inputs[| index].setFrom(sol.outputs[| 0]);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// materialNames = [];
|
||||||
|
// materialIndex = [];
|
||||||
|
// materials = [];
|
||||||
|
|
||||||
|
// static updateObj = function(updateMat = true) {
|
||||||
|
// var _path = inputs[| 0].getValue();
|
||||||
|
// var _flip = inputs[| 12].getValue();
|
||||||
|
// var _dir = filename_dir(_path);
|
||||||
|
// var _pathMtl = string_copy(_path, 1, string_length(_path) - 4) + ".mtl";
|
||||||
|
|
||||||
|
// var _v = readObj(_path, _flip);
|
||||||
|
|
||||||
|
// if(_v != noone) {
|
||||||
|
// VB = _v.vertex_groups;
|
||||||
|
// materialNames = _v.materials;
|
||||||
|
// materialIndex = _v.material_index;
|
||||||
|
// use_normal = _v.use_normal;
|
||||||
|
// if(_v.mtl_path != "")
|
||||||
|
// _pathMtl = _dir + "/" + _v.mtl_path;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if(updateMat) {
|
||||||
|
// if(array_length(materialNames))
|
||||||
|
// materials = readMtl(_pathMtl);
|
||||||
|
// else {
|
||||||
|
// materialNames = ["Material"];
|
||||||
|
// materialIndex = [0];
|
||||||
|
// materials = [ new MTLmaterial("Material") ];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// do_reset_material = true;
|
||||||
|
// }
|
||||||
|
// update();
|
||||||
|
// }
|
||||||
|
// do_reset_material = false;
|
||||||
|
|
||||||
|
// static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
|
// _3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// static submit_vertex = function() {
|
||||||
|
// var _lpos = inputs[| 14].getValue();
|
||||||
|
// var _lrot = inputs[| 13].getValue();
|
||||||
|
// var _lsca = inputs[| 11].getValue();
|
||||||
|
|
||||||
|
// _3d_local_transform(_lpos, _lrot, _lsca);
|
||||||
|
|
||||||
|
// for(var i = 0; i < array_length(VB); i++) {
|
||||||
|
// if(i >= array_length(materialIndex)) continue;
|
||||||
|
|
||||||
|
// var mIndex = materialIndex[i];
|
||||||
|
// var tex = inputs[| input_length + mIndex].getValue();
|
||||||
|
|
||||||
|
// if(!is_surface(tex)) continue;
|
||||||
|
// vertex_submit(VB[i], pr_trianglelist, surface_get_texture(tex));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// _3d_clear_local_transform();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// static update = function(frame = ANIMATOR.current_frame) {
|
||||||
|
// if(!surface_exists(tex_surface)) reset_tex();
|
||||||
|
|
||||||
|
// if(do_reset_material) {
|
||||||
|
// array_resize(input_display_list, input_display_len);
|
||||||
|
|
||||||
|
// while(ds_list_size(inputs) > input_length)
|
||||||
|
// ds_list_delete(inputs, input_length);
|
||||||
|
|
||||||
|
// for(var i = 0; i < array_length(materialNames); i++)
|
||||||
|
// createMaterial(i);
|
||||||
|
// do_reset_material = false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var _dim = inputs[| 2].getValue();
|
||||||
|
// var _pos = inputs[| 3].getValue();
|
||||||
|
// //var _rot = inputs[| 4].getValue();
|
||||||
|
// var _sca = inputs[| 5].getValue();
|
||||||
|
|
||||||
|
// var _ldir = inputs[| 6].getValue();
|
||||||
|
// var _lhgt = inputs[| 7].getValue();
|
||||||
|
// var _lint = inputs[| 8].getValue();
|
||||||
|
// var _lclr = inputs[| 9].getValue();
|
||||||
|
// var _aclr = inputs[| 10].getValue();
|
||||||
|
|
||||||
|
// var _lpos = inputs[| 14].getValue();
|
||||||
|
// var _lrot = inputs[| 13].getValue();
|
||||||
|
// var _lsca = inputs[| 11].getValue();
|
||||||
|
|
||||||
|
// var _proj = inputs[| 15].getValue();
|
||||||
|
// var _fov = inputs[| 16].getValue();
|
||||||
|
// var _dimS = inputs[| 17].getValue();
|
||||||
|
|
||||||
|
// inputs[| 16].setVisible(_proj == 1);
|
||||||
|
|
||||||
|
// for( var i = 0; i < array_length(output_display_list) - 1; i++ ) {
|
||||||
|
// var ind = output_display_list[i];
|
||||||
|
// var _outSurf = outputs[| ind].getValue();
|
||||||
|
|
||||||
|
// var pass = "diff";
|
||||||
|
// switch(ind) {
|
||||||
|
// case 0 : pass = "diff" break;
|
||||||
|
// case 2 : pass = "norm" break;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, true, _dimS );
|
||||||
|
// var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
// var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
|
// _outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
|
// for(var i = 0; i < array_length(VB); i++) {
|
||||||
|
// if(i >= array_length(materialIndex)) continue;
|
||||||
|
|
||||||
|
// var mIndex = materialIndex[i];
|
||||||
|
// var tex = inputs[| input_length + mIndex].getValue();
|
||||||
|
|
||||||
|
// if(!is_surface(tex)) continue;
|
||||||
|
// vertex_submit(VB[i], pr_trianglelist, surface_get_texture(tex));
|
||||||
|
// }
|
||||||
|
// _3d_post_setup();
|
||||||
|
|
||||||
|
// outputs[| ind].setValue(_outSurf);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// static onCleanUp = function() {
|
||||||
|
// surface_free(tex_surface);
|
||||||
|
// }
|
||||||
|
//}
|
11
scripts/node_3d_render/node_3d_render.yy
Normal file
11
scripts/node_3d_render/node_3d_render.yy
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_3d_render",
|
||||||
|
"isCompatibility": false,
|
||||||
|
"isDnD": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "3D",
|
||||||
|
"path": "folders/nodes/data/3D.yy",
|
||||||
|
},
|
||||||
|
}
|
|
@ -193,10 +193,11 @@ function Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, false, _dimS );
|
||||||
var _scale = { local: false, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
submit_vertex();
|
submit_vertex();
|
||||||
_3d_post_setup();
|
_3d_post_setup();
|
||||||
|
|
||||||
|
|
|
@ -117,10 +117,11 @@ function Node_3D_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
||||||
case 2 : pass = "norm" break;
|
case 2 : pass = "norm" break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _cam = { projection: _proj, fov: _fov };
|
var _transform = new __3d_transform(_pos,, _sca, _lpos, _lrot, _lsca, false, _dimS );
|
||||||
var _scale = { local: false, dimension: _dimS };
|
var _light = new __3d_light(_ldir, _lhgt, _lint, _lclr, _aclr);
|
||||||
|
var _cam = new __3d_camera(_proj, _fov);
|
||||||
|
|
||||||
_outSurf = _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _cam, pass, _scale);
|
_outSurf = _3d_pre_setup(_outSurf, _dim, _transform, _light, _cam, pass);
|
||||||
submit_vertex();
|
submit_vertex();
|
||||||
_3d_post_setup();
|
_3d_post_setup();
|
||||||
|
|
||||||
|
|
|
@ -115,9 +115,9 @@ function Node_VFX_Renderer(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
|
||||||
color = COLORS.node_blend_vfx;
|
color = COLORS.node_blend_vfx;
|
||||||
icon = THEME.vfx;
|
icon = THEME.vfx;
|
||||||
|
|
||||||
attributes[? "Output pool"] = false;
|
attributes.Output_pool = false;
|
||||||
|
|
||||||
inputs[| input_len + 0] = nodeValue("Spawn trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, false)
|
inputs[| input_len + 0] = nodeValue("Spawn trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, false)
|
||||||
.setVisible(true, true);
|
.setVisible(true, true);
|
||||||
|
@ -26,7 +26,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
|
||||||
reset();
|
reset();
|
||||||
runVFX(ANIMATOR.current_frame);
|
runVFX(ANIMATOR.current_frame);
|
||||||
|
|
||||||
if(attributes[? "Output pool"]) {
|
if(attributes.Output_pool) {
|
||||||
outputs[| 0].setValue(parts);
|
outputs[| 0].setValue(parts);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -25,7 +25,7 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var by = _y + ui(8);
|
var by = _y + ui(8);
|
||||||
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, _focus, _hover) == 2) {
|
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, _focus, _hover) == 2) {
|
||||||
var amo = ds_list_size(inputs) - input_fix_len;
|
var amo = ds_list_size(inputs) - input_fix_len;
|
||||||
attributes[? "size"] = amo + 1;
|
attributes.size = amo + 1;
|
||||||
refreshDynamicInput();
|
refreshDynamicInput();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,10 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
draw_text(bxc + ui(48), byc, __txt("Add"));
|
draw_text(bxc + ui(48), byc, __txt("Add"));
|
||||||
|
|
||||||
var bx = _x + bw + ui(8);
|
var bx = _x + bw + ui(8);
|
||||||
var amo = attributes[? "size"];
|
var amo = attributes.size;
|
||||||
if(amo > 1 && buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, _focus, _hover) == 2) {
|
if(amo > 1 && buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, _focus, _hover) == 2) {
|
||||||
var amo = ds_list_size(inputs) - input_fix_len;
|
var amo = ds_list_size(inputs) - input_fix_len;
|
||||||
attributes[? "size"] = max(amo - 1, 1);
|
attributes.size = max(amo - 1, 1);
|
||||||
refreshDynamicInput();
|
refreshDynamicInput();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,8 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, []);
|
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, []);
|
||||||
|
|
||||||
attributes[? "size"] = 1;
|
attributes.size = 1;
|
||||||
attributes[? "spread_value"] = false;
|
attributes.spread_value = false;
|
||||||
|
|
||||||
static getType = function() {
|
static getType = function() {
|
||||||
var _type = inputs[| 0].getValue();
|
var _type = inputs[| 0].getValue();
|
||||||
|
@ -93,7 +93,7 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
|
||||||
static refreshDynamicInput = function() {
|
static refreshDynamicInput = function() {
|
||||||
var _l = ds_list_create();
|
var _l = ds_list_create();
|
||||||
var amo = attributes[? "size"];
|
var amo = attributes.size;
|
||||||
var extra = true;
|
var extra = true;
|
||||||
var lastNode = noone;
|
var lastNode = noone;
|
||||||
|
|
||||||
|
@ -185,9 +185,9 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,9 +83,9 @@ function Node_Array_Add(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length )
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length )
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,9 +86,9 @@ function Node_Array_Zip(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length )
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length )
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
var amo = array_length(layers);
|
var amo = array_length(layers);
|
||||||
var hh = 28;
|
var hh = 28;
|
||||||
var _h = hh * amo + 16;
|
var _h = hh * amo + 16;
|
||||||
var _vis = attributes[? "layer_visible"];
|
var _vis = attributes.layer_visible;
|
||||||
|
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, _h, COLORS.node_composite_bg_blend, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, _h, COLORS.node_composite_bg_blend, 1);
|
||||||
for( var i = 0; i < array_length(layers); i++ ) {
|
for( var i = 0; i < array_length(layers); i++ ) {
|
||||||
|
@ -63,16 +63,16 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
draw_line(_x + 16, _yy - 2, _x + _w - 16, _yy - 2);
|
draw_line(_x + 16, _yy - 2, _x + _w - 16, _yy - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
var vis = ds_list_get(_vis, i, true);
|
var vis = array_safe_get(_vis, i, true);
|
||||||
var _bx = _x + 24;
|
var _bx = _x + 24;
|
||||||
if(point_in_circle(_m[0], _m[1], _bx, _yy + hh / 2, 12)) {
|
if(point_in_circle(_m[0], _m[1], _bx, _yy + hh / 2, 12)) {
|
||||||
draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _yy + hh / 2, 1, c_white);
|
draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _yy + hh / 2, 1, c_white);
|
||||||
|
|
||||||
if(mouse_press(mb_left, _focus))
|
if(mouse_press(mb_left, _focus))
|
||||||
hold_visibility = !_vis[| i];
|
hold_visibility = !_vis[i];
|
||||||
|
|
||||||
if(mouse_click(mb_left, _focus) && _vis[| i] != hold_visibility) {
|
if(mouse_click(mb_left, _focus) && _vis[i] != hold_visibility) {
|
||||||
_vis[| i] = hold_visibility;
|
_vis[i] = hold_visibility;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -159,7 +159,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
["Tags", false], 2, tag_renderer,
|
["Tags", false], 2, tag_renderer,
|
||||||
];
|
];
|
||||||
|
|
||||||
attributes[? "layer_visible"] = ds_list_create();
|
attributes.layer_visible = [];
|
||||||
|
|
||||||
content = ds_map_create();
|
content = ds_map_create();
|
||||||
layers = [];
|
layers = [];
|
||||||
|
@ -224,7 +224,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
read_ase(path, content);
|
read_ase(path, content);
|
||||||
|
|
||||||
layers = [];
|
layers = [];
|
||||||
var vis = attributes[? "layer_visible"];
|
var vis = attributes.layer_visible;
|
||||||
ds_list_clear(vis);
|
ds_list_clear(vis);
|
||||||
var frames = content[? "Frames"];
|
var frames = content[? "Frames"];
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
_tag_delay = kf.time;
|
_tag_delay = kf.time;
|
||||||
}
|
}
|
||||||
|
|
||||||
var vis = attributes[? "layer_visible"];
|
var vis = attributes.layer_visible;
|
||||||
var ww = content[? "Width"];
|
var ww = content[? "Width"];
|
||||||
var hh = content[? "Height"];
|
var hh = content[? "Height"];
|
||||||
|
|
||||||
|
@ -347,14 +347,14 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() {
|
||||||
var att = ds_map_create();
|
var att = {};
|
||||||
ds_map_add_list(att, "layer_visible", ds_list_clone(attributes[? "layer_visible"]));
|
att.layer_visible = attributes.layer_visible;
|
||||||
|
|
||||||
return att;
|
return att;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
if(ds_map_exists(attr, "layer_visible"))
|
if(struct_has(attr, "layer_visible"))
|
||||||
attributes[? "layer_visible"] = ds_list_clone(attr[? "layer_visible"], true);
|
attributes.layer_visible = attr.layer_visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -28,8 +28,8 @@ function Node_Base_Convert(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
||||||
var baseTo = current_data[2];
|
var baseTo = current_data[2];
|
||||||
|
|
||||||
var bbox = drawGetBbox(xx, yy, _s);
|
var bbox = drawGetBbox(xx, yy, _s);
|
||||||
var b1 = new node_bbox(bbox.x0, bbox.y0, bbox.xc - _s * 8, bbox.y1);
|
var b1 = BBOX().fromPoints(bbox.x0, bbox.y0, bbox.xc - _s * 8, bbox.y1);
|
||||||
var b2 = new node_bbox(bbox.xc + _s * 8, bbox.y0, bbox.x1, bbox.y1);
|
var b2 = BBOX().fromPoints(bbox.xc + _s * 8, bbox.y0, bbox.x1, bbox.y1);
|
||||||
|
|
||||||
draw_sprite_ext(THEME.arrow, 0, bbox.xc, bbox.yc + 1 * _s, .5 * _s, .5 * _s, 0, COLORS._main_icon, 1);
|
draw_sprite_ext(THEME.arrow, 0, bbox.xc, bbox.yc + 1 * _s, .5 * _s, .5 * _s, 0, COLORS._main_icon, 1);
|
||||||
draw_text_bbox(b1, baseFrom);
|
draw_text_bbox(b1, baseFrom);
|
||||||
|
|
|
@ -60,7 +60,7 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
var _shf = _data[2];
|
var _shf = _data[2];
|
||||||
var _sca = _data[3];
|
var _sca = _data[3];
|
||||||
var _slp = _data[4];
|
var _slp = _data[4];
|
||||||
var _sam = ds_map_try_get(attributes, "oversample");
|
var _sam = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
surface_set_shader(_outSurf, shader);
|
surface_set_shader(_outSurf, shader);
|
||||||
shader_set_uniform_f(uniform_hei, _hei);
|
shader_set_uniform_f(uniform_hei, _hei);
|
||||||
|
|
|
@ -33,7 +33,7 @@ function Node_Blur(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
|
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _size = _data[1];
|
var _size = _data[1];
|
||||||
var _clamp = ds_map_try_get(attributes, "oversample");
|
var _clamp = struct_try_get(attributes, "oversample");
|
||||||
var _isovr = _data[3];
|
var _isovr = _data[3];
|
||||||
var _mask = _data[5];
|
var _mask = _data[5];
|
||||||
var _mix = _data[6];
|
var _mix = _data[6];
|
||||||
|
|
|
@ -44,7 +44,7 @@ function Node_Blur_Radial(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _str = _data[1];
|
var _str = _data[1];
|
||||||
var _cen = _data[2];
|
var _cen = _data[2];
|
||||||
var _sam = ds_map_try_get(attributes, "oversample");
|
var _sam = struct_try_get(attributes, "oversample");
|
||||||
var _mask = _data[4];
|
var _mask = _data[4];
|
||||||
var _mix = _data[5];
|
var _mix = _data[5];
|
||||||
_cen[0] /= surface_get_width(_outSurf);
|
_cen[0] /= surface_get_width(_outSurf);
|
||||||
|
|
|
@ -45,7 +45,7 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
if(!is_surface(_data[0])) return _outSurf;
|
if(!is_surface(_data[0])) return _outSurf;
|
||||||
var _size = _data[1];
|
var _size = _data[1];
|
||||||
var _samp = ds_map_try_get(attributes, "oversample");
|
var _samp = struct_try_get(attributes, "oversample");
|
||||||
var _mask = _data[3];
|
var _mask = _data[3];
|
||||||
var _isovr = _data[4];
|
var _isovr = _data[4];
|
||||||
var _overc = _data[5];
|
var _overc = _data[5];
|
||||||
|
|
|
@ -56,7 +56,7 @@ function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _str = _data[1];
|
var _str = _data[1];
|
||||||
var _cen = _data[2];
|
var _cen = _data[2];
|
||||||
var _sam = ds_map_try_get(attributes, "oversample");
|
var _sam = struct_try_get(attributes, "oversample");
|
||||||
var _blr = _data[4];
|
var _blr = _data[4];
|
||||||
var _msk = _data[5];
|
var _msk = _data[5];
|
||||||
var _mask = _data[6];
|
var _mask = _data[6];
|
||||||
|
|
|
@ -33,7 +33,7 @@ function Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
if(recoverCache() || !ANIMATOR.is_playing) return;
|
if(recoverCache()) return;
|
||||||
if(!inputs[| 0].value_from) return;
|
if(!inputs[| 0].value_from) return;
|
||||||
|
|
||||||
var _surf = inputs[| 0].getValue();
|
var _surf = inputs[| 0].getValue();
|
||||||
|
@ -50,8 +50,8 @@ function Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
if(!ds_map_exists(load_map, "cache")) return;
|
if(!struct_has(load_map, "cache")) return;
|
||||||
cache_content = load_map[? "cache"];
|
cache_content = load_map.cache;
|
||||||
cache_loading_progress = 0;
|
cache_loading_progress = 0;
|
||||||
cache_loading = true;
|
cache_loading = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ function Node_Cache_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
|
if(recoverCache()) return;
|
||||||
|
|
||||||
var ss = [];
|
var ss = [];
|
||||||
var str = inputs[| 1].getValue();
|
var str = inputs[| 1].getValue();
|
||||||
var lst = inputs[| 2].getValue();
|
var lst = inputs[| 2].getValue();
|
||||||
|
@ -72,8 +74,8 @@ function Node_Cache_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
if(!ds_map_exists(load_map, "cache")) return;
|
if(!struct_has(load_map, "cache")) return;
|
||||||
cache_content = load_map[? "cache"];
|
cache_content = load_map.cache;
|
||||||
cache_loading_progress = 0;
|
cache_loading_progress = 0;
|
||||||
cache_loading = true;
|
cache_loading = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ function Node_Camera(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
if(!is_surface(_data[0])) return;
|
if(!is_surface(_data[0])) return;
|
||||||
var _area = _data[1];
|
var _area = _data[1];
|
||||||
var _zoom = _data[2];
|
var _zoom = _data[2];
|
||||||
var _samp = ds_map_try_get(attributes, "oversample");
|
var _samp = struct_try_get(attributes, "oversample");
|
||||||
var _fix = _data[4];
|
var _fix = _data[4];
|
||||||
var cDep = attrDepth();
|
var cDep = attrDepth();
|
||||||
|
|
||||||
|
@ -208,9 +208,9 @@ function Node_Camera(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -623,8 +623,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
static doApplyDeserialize = function() {
|
static doApplyDeserialize = function() {
|
||||||
if(!ds_map_exists(load_map, "surface")) return;
|
if(!struct_has(load_map, "surface")) return;
|
||||||
var buff = buffer_base64_decode(load_map[? "surface"]);
|
var buff = buffer_base64_decode(load_map.surface);
|
||||||
surface_buffer = buffer_decompress(buff);
|
surface_buffer = buffer_decompress(buff);
|
||||||
|
|
||||||
var _dim = inputs[| 0].getValue();
|
var _dim = inputs[| 0].getValue();
|
||||||
|
|
|
@ -74,11 +74,11 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
metadata = new MetaDataManager();
|
metadata = new MetaDataManager();
|
||||||
|
|
||||||
attributes[? "Separator"] = [];
|
attributes.separator = [];
|
||||||
attributes[? "w"] = 128;
|
attributes.w = 128;
|
||||||
attributes[? "h"] = 128;
|
attributes.h = 128;
|
||||||
|
|
||||||
array_push(attributeEditors, ["Edit separator", "Separator",
|
array_push(attributeEditors, ["Edit separator", "separator",
|
||||||
button(function() {
|
button(function() {
|
||||||
var dia = dialogCall(o_dialog_group_input_order);
|
var dia = dialogCall(o_dialog_group_input_order);
|
||||||
dia.node = self;
|
dia.node = self;
|
||||||
|
@ -136,10 +136,26 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getOutputNodes = function() {
|
||||||
|
var nodes = [];
|
||||||
|
for( var i = custom_output_index; i < ds_list_size(outputs); i++ ) {
|
||||||
|
var _junc = outputs[| i];
|
||||||
|
|
||||||
|
for( var j = 0; j < ds_list_size(_junc.value_to); j++ ) {
|
||||||
|
var _to = _junc.value_to[| j];
|
||||||
|
if(_to.value_from != _junc) continue;
|
||||||
|
array_push_unique(nodes, _to.node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nodes;
|
||||||
|
}
|
||||||
|
|
||||||
static getNextNodes = function() { //get node inside the group
|
static getNextNodes = function() { //get node inside the group
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $"→→→→→ Call get next node from group");
|
LOG_IF(global.FLAG.render, $"→→→→→ Call get next node from group");
|
||||||
|
|
||||||
|
var nodes = [];
|
||||||
|
if(renderActive) {
|
||||||
var allReady = true;
|
var allReady = true;
|
||||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||||
var _in = inputs[| i].from;
|
var _in = inputs[| i].from;
|
||||||
|
@ -152,7 +168,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var nodes = __nodeLeafList(getNodeList());
|
nodes = __nodeLeafList(getNodeList());
|
||||||
|
}
|
||||||
|
|
||||||
LOG_BLOCK_END();
|
LOG_BLOCK_END();
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
@ -186,7 +204,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
var siz = ds_list_size(outputs);
|
var siz = ds_list_size(outputs);
|
||||||
for( var i = custom_output_index; i < siz; i++ ) {
|
for( var i = custom_output_index; i < siz; i++ ) {
|
||||||
var _o = outputs[| i];
|
var _o = outputs[| i];
|
||||||
if(_o.node.rendered) continue;
|
if(_o.from.rendered) continue;
|
||||||
|
|
||||||
rendered = false;
|
rendered = false;
|
||||||
break;
|
break;
|
||||||
|
@ -282,11 +300,18 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
render_time += node_list[| i].render_time;
|
render_time += node_list[| i].render_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
w = attributes[? "w"];
|
w = attributes.w;
|
||||||
|
|
||||||
onStep();
|
onStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static triggerCheck = function() {
|
||||||
|
_triggerCheck();
|
||||||
|
var node_list = getNodeList();
|
||||||
|
for(var i = 0; i < ds_list_size(node_list); i++)
|
||||||
|
node_list[| i].triggerCheck();
|
||||||
|
}
|
||||||
|
|
||||||
static onStep = function() {}
|
static onStep = function() {}
|
||||||
|
|
||||||
PATCH_STATIC
|
PATCH_STATIC
|
||||||
|
@ -306,7 +331,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
static sortIO = function() {
|
static sortIO = function() {
|
||||||
input_display_list = [];
|
input_display_list = [];
|
||||||
|
|
||||||
var sep = attributes[? "Separator"];
|
var sep = attributes.separator;
|
||||||
array_sort(sep, function(a0, a1) { return a0[0] - a1[0]; });
|
array_sort(sep, function(a0, a1) { return a0[0] - a1[0]; });
|
||||||
var siz = ds_list_size(inputs);
|
var siz = ds_list_size(inputs);
|
||||||
var ar = ds_priority_create();
|
var ar = ds_priority_create();
|
||||||
|
@ -427,25 +452,25 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
}
|
}
|
||||||
|
|
||||||
static preConnect = function() {
|
static preConnect = function() {
|
||||||
instanceBase = GetAppendID(ds_map_try_get(load_map, "instance_base", noone));
|
instanceBase = GetAppendID(struct_try_get(load_map, "instance_base", noone));
|
||||||
|
|
||||||
sortIO();
|
sortIO();
|
||||||
applyDeserialize();
|
applyDeserialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() {
|
||||||
var att = ds_map_create();
|
var att = {};
|
||||||
att[? "Separator"] = json_stringify(attributes[? "Separator"]);
|
att.separator = json_stringify(attributes.separator);
|
||||||
att[? "w"] = attributes[? "w"];
|
att.w = attributes.w;
|
||||||
att[? "h"] = attributes[? "h"];
|
att.h = attributes.h;
|
||||||
return att;
|
return att;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
if(ds_map_exists(attr, "Separator"))
|
if(struct_has(attr, "separator"))
|
||||||
attributes[? "Separator"] = json_parse(attr[? "Separator"]);
|
attributes.separator = json_parse(attr.separator);
|
||||||
attributes[? "w"] = ds_map_try_get(attr, "w", 128);
|
attributes.w = attr.w;
|
||||||
attributes[? "h"] = ds_map_try_get(attr, "h", 128);
|
attributes.h = attr.h;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -36,8 +36,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
input_fix_len = ds_list_size(inputs);
|
input_fix_len = ds_list_size(inputs);
|
||||||
data_length = 4;
|
data_length = 4;
|
||||||
|
|
||||||
attributes[? "layer_visible"] = ds_list_create();
|
attributes.layer_visible = [];
|
||||||
attributes[? "layer_selectable"] = ds_list_create();
|
attributes.layer_selectable = [];
|
||||||
|
|
||||||
hold_visibility = true;
|
hold_visibility = true;
|
||||||
hold_select = true;
|
hold_select = true;
|
||||||
|
@ -52,8 +52,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
layer_renderer.h = _h;
|
layer_renderer.h = _h;
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, _h, COLORS.node_composite_bg_blend, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, _h, COLORS.node_composite_bg_blend, 1);
|
||||||
|
|
||||||
var _vis = attributes[? "layer_visible"];
|
var _vis = attributes.layer_visible;
|
||||||
var _sel = attributes[? "layer_selectable"];
|
var _sel = attributes.layer_selectable;
|
||||||
var ly = _y + 8;
|
var ly = _y + 8;
|
||||||
var ssh = lh - 6;
|
var ssh = lh - 6;
|
||||||
var hoverIndex = noone;
|
var hoverIndex = noone;
|
||||||
|
@ -81,8 +81,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
if(!is_surface(_surf)) continue;
|
if(!is_surface(_surf)) continue;
|
||||||
|
|
||||||
var aa = (ind != layer_dragging || layer_dragging == noone)? 1 : 0.5;
|
var aa = (ind != layer_dragging || layer_dragging == noone)? 1 : 0.5;
|
||||||
var vis = _vis[| ind];
|
var vis = _vis[ind];
|
||||||
var sel = _sel[| ind];
|
var sel = _sel[ind];
|
||||||
var hover = point_in_rectangle(_m[0], _m[1], _x, _cy, _x + _w, _cy + lh);
|
var hover = point_in_rectangle(_m[0], _m[1], _x, _cy, _x + _w, _cy + lh);
|
||||||
|
|
||||||
draw_set_color(COLORS.node_composite_separator);
|
draw_set_color(COLORS.node_composite_separator);
|
||||||
|
@ -93,10 +93,10 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _cy + lh / 2, 1, c_white);
|
draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _cy + lh / 2, 1, c_white);
|
||||||
|
|
||||||
if(mouse_press(mb_left, _focus))
|
if(mouse_press(mb_left, _focus))
|
||||||
hold_visibility = !_vis[| ind];
|
hold_visibility = !_vis[ind];
|
||||||
|
|
||||||
if(mouse_click(mb_left, _focus) && _vis[| ind] != hold_visibility) {
|
if(mouse_click(mb_left, _focus) && _vis[ind] != hold_visibility) {
|
||||||
_vis[| ind] = hold_visibility;
|
_vis[@ ind] = hold_visibility;
|
||||||
doUpdate();
|
doUpdate();
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -107,10 +107,10 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
draw_sprite_ui_uniform(THEME.cursor_select, sel, _bx, _cy + lh / 2, 1, c_white);
|
draw_sprite_ui_uniform(THEME.cursor_select, sel, _bx, _cy + lh / 2, 1, c_white);
|
||||||
|
|
||||||
if(mouse_press(mb_left, _focus))
|
if(mouse_press(mb_left, _focus))
|
||||||
hold_select = !_sel[| ind];
|
hold_select = !_sel[ind];
|
||||||
|
|
||||||
if(mouse_click(mb_left, _focus) && _sel[| ind] != hold_select)
|
if(mouse_click(mb_left, _focus) && _sel[ind] != hold_select)
|
||||||
_sel[| ind] = hold_select;
|
_sel[@ ind] = hold_select;
|
||||||
} else
|
} else
|
||||||
draw_sprite_ui_uniform(THEME.cursor_select, sel, _bx, _cy + lh / 2, 1, COLORS._main_icon, 0.5 + 0.5 * sel);
|
draw_sprite_ui_uniform(THEME.cursor_select, sel, _bx, _cy + lh / 2, 1, COLORS._main_icon, 0.5 + 0.5 * sel);
|
||||||
|
|
||||||
|
@ -158,17 +158,17 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
if(layer_dragging != hoverIndex && hoverIndex != noone) {
|
if(layer_dragging != hoverIndex && hoverIndex != noone) {
|
||||||
var index = input_fix_len + layer_dragging * data_length;
|
var index = input_fix_len + layer_dragging * data_length;
|
||||||
var targt = input_fix_len + hoverIndex * data_length;
|
var targt = input_fix_len + hoverIndex * data_length;
|
||||||
var _vis = attributes[? "layer_visible"];
|
var _vis = attributes.layer_visible;
|
||||||
var _sel = attributes[? "layer_selectable"];
|
var _sel = attributes.layer_selectable;
|
||||||
|
|
||||||
var ext = [];
|
var ext = [];
|
||||||
var vis = _vis[| layer_dragging];
|
var vis = _vis[layer_dragging];
|
||||||
ds_list_delete(_vis, layer_dragging);
|
array_delete(_vis, layer_dragging, 1);
|
||||||
ds_list_insert(_vis, hoverIndex, vis);
|
array_insert(_vis, hoverIndex, vis);
|
||||||
|
|
||||||
var sel = _sel[| layer_dragging];
|
var sel = _sel[layer_dragging];
|
||||||
ds_list_delete(_sel, layer_dragging);
|
array_delete(_sel, layer_dragging, 1);
|
||||||
ds_list_insert(_sel, hoverIndex, sel);
|
array_insert(_sel, hoverIndex, sel);
|
||||||
|
|
||||||
for( var i = 0; i < data_length; i++ ) {
|
for( var i = 0; i < data_length; i++ ) {
|
||||||
ext[i] = inputs[| index];
|
ext[i] = inputs[| index];
|
||||||
|
@ -181,6 +181,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
doUpdate();
|
doUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
layer_dragging = noone;
|
layer_dragging = noone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,10 +234,10 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
array_push(input_display_list, index + 2);
|
array_push(input_display_list, index + 2);
|
||||||
array_push(input_display_list, index + 3);
|
array_push(input_display_list, index + 3);
|
||||||
|
|
||||||
while(_s >= ds_list_size(attributes[? "layer_visible"]))
|
while(_s >= array_length(attributes.layer_visible))
|
||||||
ds_list_add(attributes[? "layer_visible"], true);
|
array_push(attributes.layer_visible, true);
|
||||||
while(_s >= ds_list_size(attributes[? "layer_selectable"]))
|
while(_s >= array_length(attributes.layer_selectable))
|
||||||
ds_list_add(attributes[? "layer_selectable"], true);
|
array_push(attributes.layer_selectable, true);
|
||||||
}
|
}
|
||||||
if(!LOADING && !APPENDING) createNewSurface();
|
if(!LOADING && !APPENDING) createNewSurface();
|
||||||
|
|
||||||
|
@ -572,16 +573,16 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
var hovering = -1;
|
var hovering = -1;
|
||||||
var hovering_type = 0;
|
var hovering_type = 0;
|
||||||
var _vis = attributes[? "layer_visible"];
|
var _vis = attributes.layer_visible;
|
||||||
var _sel = attributes[? "layer_selectable"];
|
var _sel = attributes.layer_selectable;
|
||||||
|
|
||||||
var amo = (ds_list_size(inputs) - input_fix_len) / data_length;
|
var amo = (ds_list_size(inputs) - input_fix_len) / data_length;
|
||||||
if(array_length(current_data) < input_fix_len + amo * data_length)
|
if(array_length(current_data) < input_fix_len + amo * data_length)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for(var i = 0; i < amo; i++) {
|
for(var i = 0; i < amo; i++) {
|
||||||
var vis = _vis[| i];
|
var vis = _vis[i];
|
||||||
var sel = _sel[| i];
|
var sel = _sel[i];
|
||||||
if(!vis) continue;
|
if(!vis) continue;
|
||||||
|
|
||||||
var index = input_fix_len + i * data_length;
|
var index = input_fix_len + i * data_length;
|
||||||
|
@ -770,12 +771,12 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
var res_index = 0, bg = 0;
|
var res_index = 0, bg = 0;
|
||||||
var imageAmo = (ds_list_size(inputs) - input_fix_len) / data_length;
|
var imageAmo = (ds_list_size(inputs) - input_fix_len) / data_length;
|
||||||
var _vis = attributes[? "layer_visible"];
|
var _vis = attributes.layer_visible;
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_sample, true, BLEND.alphamulp);
|
surface_set_shader(_outSurf, sh_sample, true, BLEND.alphamulp);
|
||||||
|
|
||||||
for(var i = 0; i < imageAmo; i++) {
|
for(var i = 0; i < imageAmo; i++) {
|
||||||
var vis = _vis[| i];
|
var vis = _vis[i];
|
||||||
if(!vis) continue;
|
if(!vis) continue;
|
||||||
|
|
||||||
var startDataIndex = input_fix_len + i * data_length;
|
var startDataIndex = input_fix_len + i * data_length;
|
||||||
|
@ -807,26 +808,26 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewSurface();
|
createNewSurface();
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() {
|
||||||
var att = ds_map_create();
|
var att = {};
|
||||||
ds_map_add_list(att, "layer_visible", ds_list_clone(attributes[? "layer_visible"]));
|
att.layer_visible = attributes.layer_visible;
|
||||||
ds_map_add_list(att, "layer_selectable", ds_list_clone(attributes[? "layer_selectable"]));
|
att.layer_selectable = attributes.layer_selectable;
|
||||||
|
|
||||||
return att;
|
return att;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
if(ds_map_exists(attr, "layer_visible"))
|
if(struct_has(attr, "layer_visible"))
|
||||||
attributes[? "layer_visible"] = ds_list_clone(attr[? "layer_visible"], true);
|
attributes.layer_visible = attr.layer_visible;
|
||||||
|
|
||||||
if(ds_map_exists(attr, "layer_selectable"))
|
if(struct_has(attr, "layer_selectable"))
|
||||||
attributes[? "layer_selectable"] = ds_list_clone(attr[? "layer_selectable"], true);
|
attributes.layer_selectable = attr.layer_selectable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _ker = _data[1];
|
var _ker = _data[1];
|
||||||
var _sam = ds_map_try_get(attributes, "oversample");
|
var _sam = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
|
|
@ -25,69 +25,69 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
drag_my = 0;
|
drag_my = 0;
|
||||||
drag_sv = 0;
|
drag_sv = 0;
|
||||||
|
|
||||||
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
|
temp_surface = [ surface_create(1, 1, surface_r32float) ];
|
||||||
|
|
||||||
static findBoundary = function(surface) {
|
//static findBoundary = function(surface) {
|
||||||
if(!is_surface(surface)) return [ 0, 0, 0, 0 ];
|
// if(!is_surface(surface)) return [ 0, 0, 0, 0 ];
|
||||||
|
|
||||||
var _w = surface_get_width(surface);
|
// var _w = surface_get_width(surface);
|
||||||
var _h = surface_get_height(surface);
|
// var _h = surface_get_height(surface);
|
||||||
|
|
||||||
var s = surface_create(_w, _h, surface_r8unorm);
|
// var s = surface_create(_w, _h, surface_r8unorm);
|
||||||
surface_set_target(s);
|
// surface_set_target(s);
|
||||||
DRAW_CLEAR
|
// DRAW_CLEAR
|
||||||
draw_surface_safe(surface, 0, 0);
|
// draw_surface_safe(surface, 0, 0);
|
||||||
surface_reset_target();
|
// surface_reset_target();
|
||||||
|
|
||||||
var buff = buffer_create(_w * _h, buffer_fast, 1);
|
// var buff = buffer_create(_w * _h, buffer_fast, 1);
|
||||||
buffer_get_surface(buff, s, 0);
|
// buffer_get_surface(buff, s, 0);
|
||||||
|
|
||||||
var top = 0;
|
// var top = 0;
|
||||||
for( var i = top; i < _h; i++ )
|
// for( var i = top; i < _h; i++ )
|
||||||
for( var j = 0; j < _w; j++ ) {
|
// for( var j = 0; j < _w; j++ ) {
|
||||||
var col = buffer_read_at(buff, i * _w + j, buffer_u8);
|
// var col = buffer_read_at(buff, i * _w + j, buffer_u8);
|
||||||
if(col > 0) {
|
// if(col > 0) {
|
||||||
top = i;
|
// top = i;
|
||||||
i = _h;
|
// i = _h;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
var bottom = _h;
|
// var bottom = _h;
|
||||||
for( var i = bottom; i >= top; i-- )
|
// for( var i = bottom; i >= top; i-- )
|
||||||
for( var j = 0; j < _w; j++ ) {
|
// for( var j = 0; j < _w; j++ ) {
|
||||||
var col = buffer_read_at(buff, i * _w + j, buffer_u8);
|
// var col = buffer_read_at(buff, i * _w + j, buffer_u8);
|
||||||
if(col > 0) {
|
// if(col > 0) {
|
||||||
bottom = i;
|
// bottom = i;
|
||||||
i = 0;
|
// i = 0;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
var left = 0;
|
// var left = 0;
|
||||||
for( var j = 0; j < _w; j++ )
|
// for( var j = 0; j < _w; j++ )
|
||||||
for( var i = top; i < bottom; i++ ) {
|
// for( var i = top; i < bottom; i++ ) {
|
||||||
var col = buffer_read_at(buff, i * _w + j, buffer_u8);
|
// var col = buffer_read_at(buff, i * _w + j, buffer_u8);
|
||||||
if(col > 0) {
|
// if(col > 0) {
|
||||||
left = j;
|
// left = j;
|
||||||
j = _w;
|
// j = _w;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
var right = 0;
|
// var right = 0;
|
||||||
for( var j = _w; j >= left; j-- )
|
// for( var j = _w; j >= left; j-- )
|
||||||
for( var i = top; i < bottom; i++ ) {
|
// for( var i = top; i < bottom; i++ ) {
|
||||||
var col = buffer_read_at(buff, i * _w + j, buffer_u8);
|
// var col = buffer_read_at(buff, i * _w + j, buffer_u8);
|
||||||
if(col > 0) {
|
// if(col > 0) {
|
||||||
right = j;
|
// right = j;
|
||||||
j = 0;
|
// j = 0;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return [ left, top, right + 1, bottom + 1 ];
|
// return [ left, top, right + 1, bottom + 1 ];
|
||||||
}
|
//}
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
var _inSurf = inputs[| 0].getValue();
|
var _inSurf = inputs[| 0].getValue();
|
||||||
|
@ -124,38 +124,35 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
draw_surface_safe(_surf, 0, 0);
|
draw_surface_safe(_surf, 0, 0);
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
var _minx, _miny, _maxx, _maxy;
|
var _minx = 0, _miny = 0, _maxx = _dim[0], _maxy = _dim[1];
|
||||||
|
temp_surface[0] = surface_verify(temp_surface[0], 1, 1, surface_r32float);
|
||||||
for( var i = 0; i < array_length(temp_surface); i++ ) {
|
|
||||||
temp_surface[i] = surface_verify(temp_surface[i], 1, 1, cDep);
|
|
||||||
|
|
||||||
shader_set(sh_find_boundary);
|
shader_set(sh_find_boundary);
|
||||||
shader_set_f("dimension", _dim);
|
shader_set_f("dimension", _dim);
|
||||||
shader_set_i("mode", i);
|
|
||||||
if(i) shader_set_f("minn", [ _minx, _miny ]);
|
|
||||||
shader_set_surface("texture", s);
|
shader_set_surface("texture", s);
|
||||||
|
|
||||||
surface_set_target(temp_surface[i]);
|
for( var i = 0; i < 4; i++ ) {
|
||||||
|
shader_set_i("mode", i);
|
||||||
|
shader_set_f("bbox", [ _minx, _miny, _maxx, _maxy ]);
|
||||||
|
|
||||||
|
surface_set_target(temp_surface[0]);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
BLEND_OVERRIDE;
|
BLEND_OVERRIDE;
|
||||||
draw_surface(s, 0, 0);
|
draw_surface(s, 0, 0);
|
||||||
BLEND_NORMAL;
|
BLEND_NORMAL;
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
|
switch(i) {
|
||||||
|
case 0 : _minx = round(surface_get_pixel_ext(temp_surface[0], 0, 0) / 255); break;
|
||||||
|
case 1 : _miny = round(surface_get_pixel_ext(temp_surface[0], 0, 0) / 255); break;
|
||||||
|
case 2 : _maxx = round(surface_get_pixel_ext(temp_surface[0], 0, 0) / 255) + 1; break;
|
||||||
|
case 3 : _maxy = round(surface_get_pixel_ext(temp_surface[0], 0, 0) / 255) + 1; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
shader_reset();
|
shader_reset();
|
||||||
|
|
||||||
if(i == 0) {
|
|
||||||
var minBox = surface_get_pixel_ext(temp_surface[0] , 0, 0);
|
|
||||||
_minx = max(0, color_get_red(minBox) * 256 + color_get_green(minBox));
|
|
||||||
_miny = max(0, color_get_blue(minBox) * 256 + color_get_alpha(minBox));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
surface_free(s);
|
surface_free(s);
|
||||||
|
|
||||||
var maxBox = surface_get_pixel_ext(temp_surface[1], 0, 0);
|
|
||||||
_maxx = color_get_red(maxBox) * 256 + color_get_green(maxBox) + 1;
|
|
||||||
_maxy = color_get_blue(maxBox) * 256 + color_get_alpha(maxBox) + 1;
|
|
||||||
|
|
||||||
if(_array == 0) {
|
if(_array == 0) {
|
||||||
minx = min(minx, _minx);
|
minx = min(minx, _minx);
|
||||||
miny = min(miny, _miny);
|
miny = min(miny, _miny);
|
||||||
|
|
|
@ -59,7 +59,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
inspector_display_list = -1;
|
inspector_display_list = -1;
|
||||||
is_dynamic_output = false;
|
is_dynamic_output = false;
|
||||||
|
|
||||||
attributes = ds_map_create();
|
attributes = {};
|
||||||
attributeEditors = [];
|
attributeEditors = [];
|
||||||
|
|
||||||
inspectInput1 = nodeValue("Toggle execution", self, JUNCTION_CONNECT.input, VALUE_TYPE.action, false).setVisible(true, true);
|
inspectInput1 = nodeValue("Toggle execution", self, JUNCTION_CONNECT.input, VALUE_TYPE.action, false).setVisible(true, true);
|
||||||
|
@ -188,11 +188,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
h = max(min_h, (preview_surface && previewable)? 128 : 0, _hi, _ho);
|
h = max(min_h, (preview_surface && previewable)? 128 : 0, _hi, _ho);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSetDisplayName = noone;
|
||||||
static setDisplayName = function(_name) {
|
static setDisplayName = function(_name) {
|
||||||
display_name = _name;
|
display_name = _name;
|
||||||
internalName = string_replace_all(display_name, " ", "_");
|
internalName = string_replace_all(display_name, " ", "_");
|
||||||
|
|
||||||
refreshNodeMap();
|
refreshNodeMap();
|
||||||
|
|
||||||
|
if(onSetDisplayName != noone)
|
||||||
|
onSetDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
static getOutput = function(junc = noone) {
|
static getOutput = function(junc = noone) {
|
||||||
|
@ -292,12 +295,35 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
static doStepBegin = function() {}
|
static doStepBegin = function() {}
|
||||||
|
|
||||||
static triggerCheck = function() {
|
static triggerCheck = function() {
|
||||||
|
_triggerCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
static _triggerCheck = function() {
|
||||||
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
||||||
if(inputs[| i].type != VALUE_TYPE.trigger) continue;
|
if(inputs[| i].type != VALUE_TYPE.trigger) continue;
|
||||||
if(!is_instanceof(inputs[| i].editWidget, buttonClass)) continue;
|
if(!is_instanceof(inputs[| i].editWidget, buttonClass)) continue;
|
||||||
|
|
||||||
var trig = inputs[| i].getValue();
|
var trig = inputs[| i].getValue();
|
||||||
if(trig) inputs[| i].editWidget.onClick();
|
if(trig) {
|
||||||
|
inputs[| i].editWidget.onClick();
|
||||||
|
inputs[| i].setValue(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hasInspector1Update()) {
|
||||||
|
var trig = inspectInput1.getValue();
|
||||||
|
if(trig) {
|
||||||
|
inspectInput1.editWidget.onClick();
|
||||||
|
inspectInput1.setValue(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hasInspector2Update()) {
|
||||||
|
var trig = inspectInput2.getValue();
|
||||||
|
if(trig) {
|
||||||
|
inspectInput2.editWidget.onClick();
|
||||||
|
inspectInput2.setValue(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,14 +338,6 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $">>>>>>>>>> DoUpdate called from {internalName} <<<<<<<<<<");
|
LOG_IF(global.FLAG.render, $">>>>>>>>>> DoUpdate called from {internalName} <<<<<<<<<<");
|
||||||
|
|
||||||
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
|
||||||
if(inputs[| i].type != VALUE_TYPE.trigger) continue;
|
|
||||||
if(inputs[| i].editWidget == noone) continue;
|
|
||||||
|
|
||||||
var trg = inputs[| i].getValue();
|
|
||||||
if(trg) inputs[| i].editWidget.onClick();
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var t = get_timer();
|
var t = get_timer();
|
||||||
|
|
||||||
|
@ -512,7 +530,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
var y0 = yy + 20 * draw_name + draw_padding * _s;
|
var y0 = yy + 20 * draw_name + draw_padding * _s;
|
||||||
var y1 = yy + (h - draw_padding) * _s;
|
var y1 = yy + (h - draw_padding) * _s;
|
||||||
|
|
||||||
return new node_bbox(x0, y0, x1, y1);
|
return BBOX().fromPoints(x0, y0, x1, y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static drawNodeName = function(xx, yy, _s) {
|
static drawNodeName = function(xx, yy, _s) {
|
||||||
|
@ -1242,48 +1260,44 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
}
|
}
|
||||||
|
|
||||||
static serialize = function(scale = false, preset = false) {
|
static serialize = function(scale = false, preset = false) {
|
||||||
var _map = ds_map_create();
|
var _map = {};
|
||||||
//print(" > Serializing: " + name);
|
//print(" > Serializing: " + name);
|
||||||
|
|
||||||
if(!preset) {
|
if(!preset) {
|
||||||
_map[? "id"] = node_id;
|
_map.id = node_id;
|
||||||
_map[? "render"] = renderActive;
|
_map.render = renderActive;
|
||||||
_map[? "name"] = display_name;
|
_map.name = display_name;
|
||||||
_map[? "iname"] = internalName;
|
_map.iname = internalName;
|
||||||
_map[? "x"] = x;
|
_map.x = x;
|
||||||
_map[? "y"] = y;
|
_map.y = y;
|
||||||
_map[? "type"] = instanceof(self);
|
_map.type = instanceof(self);
|
||||||
_map[? "group"] = group == noone? group : group.node_id;
|
_map.group = group == noone? group : group.node_id;
|
||||||
_map[? "preview"] = previewable;
|
_map.preview = previewable;
|
||||||
}
|
}
|
||||||
|
|
||||||
ds_map_add_map(_map, "attri", attributeSerialize());
|
_map.attri = attributeSerialize();
|
||||||
|
|
||||||
var _inputs = ds_list_create();
|
var _inputs = [];
|
||||||
for(var i = 0; i < ds_list_size(inputs); i++)
|
for(var i = 0; i < ds_list_size(inputs); i++)
|
||||||
ds_list_add_map(_inputs, inputs[| i].serialize(scale, preset));
|
array_push(_inputs, inputs[| i].serialize(scale, preset));
|
||||||
ds_map_add_list(_map, "inputs", _inputs);
|
_map.inputs = _inputs;
|
||||||
|
|
||||||
var _outputs = ds_list_create();
|
var _outputs = [];
|
||||||
for(var i = 0; i < ds_list_size(outputs); i++)
|
for(var i = 0; i < ds_list_size(outputs); i++)
|
||||||
ds_list_add_map(_outputs, outputs[| i].serialize(scale, preset));
|
array_push(_outputs, outputs[| i].serialize(scale, preset));
|
||||||
ds_map_add_list(_map, "outputs", _outputs);
|
_map.outputs = _outputs;
|
||||||
|
|
||||||
var _trigger = ds_list_create();
|
var _trigger = [];
|
||||||
ds_list_add_map(_trigger, inspectInput1.serialize(scale, preset));
|
array_push(_trigger, inspectInput1.serialize(scale, preset));
|
||||||
ds_list_add_map(_trigger, inspectInput2.serialize(scale, preset));
|
array_push(_trigger, inspectInput2.serialize(scale, preset));
|
||||||
ds_map_add_list(_map, "inspectInputs", _trigger);
|
_map.inspectInputs = _trigger;
|
||||||
|
|
||||||
doSerialize(_map);
|
doSerialize(_map);
|
||||||
processSerialize(_map);
|
processSerialize(_map);
|
||||||
return _map;
|
return _map;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() { return attributes; }
|
||||||
var att = ds_map_create();
|
|
||||||
ds_map_override(att, attributes);
|
|
||||||
return att;
|
|
||||||
}
|
|
||||||
static doSerialize = function(_map) {}
|
static doSerialize = function(_map) {}
|
||||||
static processSerialize = function(_map) {}
|
static processSerialize = function(_map) {}
|
||||||
|
|
||||||
|
@ -1294,28 +1308,26 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
load_scale = scale;
|
load_scale = scale;
|
||||||
|
|
||||||
if(!preset) {
|
if(!preset) {
|
||||||
if(APPENDING)
|
if(APPENDING) APPEND_MAP[? load_map.id] = node_id;
|
||||||
APPEND_MAP[? load_map[? "id"]] = node_id;
|
else node_id = load_map.id;
|
||||||
else
|
|
||||||
node_id = ds_map_try_get(load_map, "id");
|
|
||||||
|
|
||||||
NODE_MAP[? node_id] = self;
|
NODE_MAP[? node_id] = self;
|
||||||
|
|
||||||
if(ds_map_exists(load_map, "name"))
|
if(struct_has(load_map, "name"))
|
||||||
setDisplayName(ds_map_try_get(load_map, "name", ""));
|
setDisplayName(load_map.name);
|
||||||
|
|
||||||
internalName = ds_map_try_get(load_map, "iname", internalName);
|
internalName = struct_try_get(load_map, "iname", internalName);
|
||||||
_group = ds_map_try_get(load_map, "group", noone);
|
_group = struct_try_get(load_map, "group", noone);
|
||||||
if(_group == -1) _group = noone;
|
if(_group == -1) _group = noone;
|
||||||
|
|
||||||
x = ds_map_try_get(load_map, "x");
|
x = struct_try_get(load_map, "x");
|
||||||
y = ds_map_try_get(load_map, "y");
|
y = struct_try_get(load_map, "y");
|
||||||
renderActive = ds_map_try_get(load_map, "render", true);
|
renderActive = struct_try_get(load_map, "render", true);
|
||||||
previewable = ds_map_try_get(load_map, "preview", previewable);
|
previewable = struct_try_get(load_map, "preview", previewable);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ds_map_exists(load_map, "attri"))
|
if(struct_has(load_map, "attri"))
|
||||||
attributeDeserialize(load_map[? "attri"]);
|
attributeDeserialize(load_map.attri);
|
||||||
|
|
||||||
doDeserialize();
|
doDeserialize();
|
||||||
processDeserialize();
|
processDeserialize();
|
||||||
|
@ -1331,33 +1343,33 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
static doDeserialize = function() {}
|
static doDeserialize = function() {}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
ds_map_override(attributes, attr);
|
struct_override(attributes, attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {}
|
static postDeserialize = function() {}
|
||||||
static processDeserialize = function() {}
|
static processDeserialize = function() {}
|
||||||
|
|
||||||
static applyDeserialize = function(preset = false) {
|
static applyDeserialize = function(preset = false) {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
var amo = min(ds_list_size(inputs), ds_list_size(_inputs));
|
var amo = min(ds_list_size(inputs), array_length(_inputs));
|
||||||
|
|
||||||
for(var i = 0; i < amo; i++) {
|
for(var i = 0; i < amo; i++) {
|
||||||
if(inputs[| i] == noone) continue;
|
if(inputs[| i] == noone) continue;
|
||||||
inputs[| i].applyDeserialize(_inputs[| i], load_scale, preset);
|
inputs[| i].applyDeserialize(_inputs[i], load_scale, preset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ds_map_exists(load_map, "outputs")) {
|
if(struct_has(load_map, "outputs")) {
|
||||||
var _outputs = load_map[? "outputs"];
|
var _outputs = load_map.outputs;
|
||||||
for(var i = 0; i < ds_list_size(outputs); i++) {
|
for(var i = 0; i < ds_list_size(outputs); i++) {
|
||||||
if(outputs[| i] == noone) continue;
|
if(outputs[| i] == noone) continue;
|
||||||
outputs[| i].applyDeserialize(_outputs[| i], load_scale, preset);
|
outputs[| i].applyDeserialize(_outputs[i], load_scale, preset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ds_map_exists(load_map, "inspectInputs")) {
|
if(struct_has(load_map, "inspectInputs")) {
|
||||||
var insInp = load_map[? "inspectInputs"];
|
var insInp = load_map.inspectInputs;
|
||||||
inspectInput1.applyDeserialize(insInp[| 0], load_scale, preset);
|
inspectInput1.applyDeserialize(insInp[0], load_scale, preset);
|
||||||
inspectInput2.applyDeserialize(insInp[| 1], load_scale, preset);
|
inspectInput2.applyDeserialize(insInp[1], load_scale, preset);
|
||||||
}
|
}
|
||||||
|
|
||||||
doApplyDeserialize();
|
doApplyDeserialize();
|
||||||
|
@ -1386,7 +1398,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
for(var i = 0; i < ds_list_size(inputs); i++)
|
for(var i = 0; i < ds_list_size(inputs); i++)
|
||||||
connected &= inputs[| i].connect(log);
|
connected &= inputs[| i].connect(log);
|
||||||
|
|
||||||
if(ds_map_exists(load_map, "inspectInputs")) {
|
if(struct_has(load_map, "inspectInputs")) {
|
||||||
inspectInput1.connect(log);
|
inspectInput1.connect(log);
|
||||||
inspectInput2.connect(log);
|
inspectInput2.connect(log);
|
||||||
}
|
}
|
||||||
|
@ -1413,8 +1425,6 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
ds_map_destroy(inputMap);
|
ds_map_destroy(inputMap);
|
||||||
ds_map_destroy(outputMap);
|
ds_map_destroy(outputMap);
|
||||||
|
|
||||||
ds_map_destroy(attributes);
|
|
||||||
|
|
||||||
for( var i = 0; i < array_length(temp_surface); i++ )
|
for( var i = 0; i < array_length(temp_surface); i++ )
|
||||||
surface_free(temp_surface[i]);
|
surface_free(temp_surface[i]);
|
||||||
|
|
||||||
|
@ -1425,8 +1435,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
|
|
||||||
// helper function
|
// helper function
|
||||||
static attrDepth = function() {
|
static attrDepth = function() {
|
||||||
if(ds_map_exists(attributes, "color_depth")) {
|
if(struct_has(attributes, "color_depth")) {
|
||||||
var form = attributes[? "color_depth"];
|
var form = attributes.color_depth;
|
||||||
if(inputs[| 0].type == VALUE_TYPE.surface)
|
if(inputs[| 0].type == VALUE_TYPE.surface)
|
||||||
form--;
|
form--;
|
||||||
if(form >= 0)
|
if(form >= 0)
|
||||||
|
|
|
@ -55,7 +55,7 @@ function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
var center = _data[1];
|
var center = _data[1];
|
||||||
var stren = _data[2];
|
var stren = _data[2];
|
||||||
var rad = _data[3];
|
var rad = _data[3];
|
||||||
var sam = ds_map_try_get(attributes, "oversample");
|
var sam = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
surface_set_shader(_outSurf, shader);
|
surface_set_shader(_outSurf, shader);
|
||||||
shader_set_interpolation(_data[0]);
|
shader_set_interpolation(_data[0]);
|
||||||
|
|
|
@ -83,7 +83,7 @@ If set, then strength value control how many times the effect applies on itself.
|
||||||
shader_set_uniform_f(uniform_mid, _data[4]);
|
shader_set_uniform_f(uniform_mid, _data[4]);
|
||||||
shader_set_uniform_i(uniform_rg, _data[5]);
|
shader_set_uniform_i(uniform_rg, _data[5]);
|
||||||
shader_set_uniform_i(uniform_it, _data[6]);
|
shader_set_uniform_i(uniform_it, _data[6]);
|
||||||
shader_set_uniform_i(uniform_sam, ds_map_try_get(attributes, "oversample"));
|
shader_set_uniform_i(uniform_sam, struct_try_get(attributes, "oversample"));
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
draw_surface_safe(_data[0], 0, 0);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var ft = _data[1];
|
var ft = _data[1];
|
||||||
var ov = ds_map_try_get(attributes, "oversample");
|
var ov = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
|
|
@ -164,9 +164,9 @@ function Node_Equation(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
||||||
attributes[? "fill_iteration"] = -1;
|
attributes.fill_iteration = -1;
|
||||||
array_push(attributeEditors, "Algorithm");
|
array_push(attributeEditors, "Algorithm");
|
||||||
array_push(attributeEditors, ["Fill iteration", "fill_iteration",
|
array_push(attributeEditors, ["Fill iteration", "fill_iteration",
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||||
attributes[? "fill_iteration"] = val;
|
attributes.fill_iteration = val;
|
||||||
triggerRender();
|
triggerRender();
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
var ind = 0;
|
var ind = 0;
|
||||||
var it = attributes[? "fill_iteration"] == -1? sw + sh : attributes[? "fill_iteration"];
|
var it = attributes.fill_iteration == -1? sw + sh : attributes.fill_iteration;
|
||||||
repeat(it) {
|
repeat(it) {
|
||||||
ind = !ind;
|
ind = !ind;
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,9 @@ function Node_Fluid_Domain_Queue(_x, _y, _group = noone) : Node_Fluid(_x, _y, _g
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(_inputs); i++)
|
for(var i = 0; i < array_length(_inputs); i++)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region utilities
|
#region utilities
|
||||||
function previewWindow(node) {
|
function create_preview_window(node) {
|
||||||
if(node == noone) return;
|
if(node == noone) return;
|
||||||
var win = new Panel_Preview_Window();
|
var win = new Panel_Preview_Window();
|
||||||
win.node_target = node;
|
win.node_target = node;
|
||||||
|
|
|
@ -238,41 +238,39 @@ function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static serialize = function() {
|
static serialize = function() {
|
||||||
var _map = ds_map_create();
|
var _map = {};
|
||||||
|
|
||||||
var _inputs = ds_list_create();
|
var _inputs = [];
|
||||||
for(var i = 0; i < ds_list_size(inputs); i++) {
|
for(var i = 0; i < ds_list_size(inputs); i++) {
|
||||||
var _ser = inputs[| i].serialize();
|
var _ser = inputs[| i].serialize();
|
||||||
|
|
||||||
_ser[? "global_type"] = inputs[| i].editor.type_index;
|
_ser.global_type = inputs[| i].editor.type_index;
|
||||||
_ser[? "global_disp"] = inputs[| i].editor.disp_index;
|
_ser.global_disp = inputs[| i].editor.disp_index;
|
||||||
_ser[? "global_name"] = inputs[| i].editor.value_name;
|
_ser.global_name = inputs[| i].editor.value_name;
|
||||||
_ser[? "global_s_range"] = ds_list_create_from_array(inputs[| i].editor.slider_range);
|
_ser.global_s_range = inputs[| i].editor.slider_range;
|
||||||
_ser[? "global_s_step "] = inputs[| i].editor.slider_step;
|
_ser.global_s_step = inputs[| i].editor.slider_step;
|
||||||
|
|
||||||
ds_list_add(_inputs, _ser);
|
array_push(_inputs, _ser);
|
||||||
ds_list_mark_as_map(_inputs, i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ds_map_add_list(_map, "inputs", _inputs);
|
_map.inputs = _inputs;
|
||||||
|
|
||||||
return _map;
|
return _map;
|
||||||
}
|
}
|
||||||
|
|
||||||
static deserialize = function(_map) {
|
static deserialize = function(_map) {
|
||||||
var _inputs = _map[? "inputs"];
|
var _inputs = _map.inputs;
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(_inputs); i++) {
|
for(var i = 0; i < array_length(_inputs); i++) {
|
||||||
var _des = _inputs[| i];
|
var _des = _inputs[i];
|
||||||
var _in = createValue();
|
var _in = createValue();
|
||||||
|
|
||||||
_in.editor.type_index = ds_map_try_get(_des, "global_type", 0);
|
_in.editor.type_index = struct_try_get(_des, "global_type", 0);
|
||||||
_in.editor.disp_index = ds_map_try_get(_des, "global_disp", 0);
|
_in.editor.disp_index = struct_try_get(_des, "global_disp", 0);
|
||||||
_in.editor.disp_index = ds_map_try_get(_des, "global_disp", 0);
|
_in.editor.disp_index = struct_try_get(_des, "global_disp", 0);
|
||||||
_in.editor.value_name = ds_map_try_get(_des, "global_name", "");
|
_in.editor.value_name = struct_try_get(_des, "global_name", "");
|
||||||
|
|
||||||
_in.editor.slider_range = array_create_from_list(ds_map_try_get(_des, "global_s_range", [ 0, 0 ]));
|
_in.editor.slider_range = _des.global_s_range;
|
||||||
_in.editor.slider_step = ds_map_try_get(_des, "global_s_step", 0.01);
|
_in.editor.slider_step = struct_try_get(_des, "global_s_step", 0.01);
|
||||||
|
|
||||||
_in.editor.refreshInput();
|
_in.editor.refreshInput();
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,18 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
h = 32 + 24;
|
h = 32 + 24;
|
||||||
min_h = h;
|
min_h = h;
|
||||||
|
|
||||||
|
data_type_list = [ "Integer", "Float", "Boolean", "Color", "Surface",
|
||||||
|
"File Path", "Curve", "Text", "Object", "Node",
|
||||||
|
"3D object", "Any", "Path", "Particle", "Rigidbody Object",
|
||||||
|
"Fluid Domain", "Struct", "Strands", "Mesh", "Trigger"
|
||||||
|
];
|
||||||
|
|
||||||
|
data_type_map = [ VALUE_TYPE.integer, VALUE_TYPE.float, VALUE_TYPE.boolean, VALUE_TYPE.color, VALUE_TYPE.surface,
|
||||||
|
VALUE_TYPE.path, VALUE_TYPE.curve, VALUE_TYPE.text, VALUE_TYPE.object, VALUE_TYPE.node,
|
||||||
|
VALUE_TYPE.d3object, VALUE_TYPE.any, VALUE_TYPE.pathnode, VALUE_TYPE.particle, VALUE_TYPE.rigid,
|
||||||
|
VALUE_TYPE.fdomain, VALUE_TYPE.struct, VALUE_TYPE.strands, VALUE_TYPE.mesh, VALUE_TYPE.trigger
|
||||||
|
];
|
||||||
|
|
||||||
display_list = [
|
display_list = [
|
||||||
/*Integer*/ [ "Default", "Range", "Rotation", "Rotation range", "Slider", "Slider range", "Padding", "Vector", "Vector range", "Area", "Enum button", "Menu scroll" ],
|
/*Integer*/ [ "Default", "Range", "Rotation", "Rotation range", "Slider", "Slider range", "Padding", "Vector", "Vector range", "Area", "Enum button", "Menu scroll" ],
|
||||||
/*Float*/ [ "Default", "Range", "Rotation", "Rotation range", "Slider", "Slider range", "Padding", "Vector", "Vector range", "Area" ],
|
/*Float*/ [ "Default", "Range", "Rotation", "Rotation range", "Slider", "Slider range", "Padding", "Vector", "Vector range", "Area" ],
|
||||||
|
@ -32,6 +44,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
/*Struct*/ [ "Default", ],
|
/*Struct*/ [ "Default", ],
|
||||||
/*Strand*/ [ "Default", ],
|
/*Strand*/ [ "Default", ],
|
||||||
/*Mesh*/ [ "Default", ],
|
/*Mesh*/ [ "Default", ],
|
||||||
|
/*Trigger*/ [ "Default", ],
|
||||||
];
|
];
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Display type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 0] = nodeValue("Display type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
|
@ -45,8 +58,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
|
||||||
inputs[| 2] = nodeValue("Input type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 2] = nodeValue("Input type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Integer", "Float", "Boolean", "Color", "Surface", "File Path", "Curve", "Text", "Object", "Node",
|
.setDisplay(VALUE_DISPLAY.enum_scroll, data_type_list, { update_hover: false })
|
||||||
"3D object", "Any", "Path", "Particle", "Rigidbody Object", "Fluid Domain", "Struct", "Strands", "Mesh" ], { update_hover: false })
|
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
inputs[| 2].editWidget.update_hover = false;
|
inputs[| 2].editWidget.update_hover = false;
|
||||||
|
|
||||||
|
@ -69,13 +81,24 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
.setVisible(false)
|
.setVisible(false)
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
|
||||||
|
inputs[| 8] = nodeValue("Button Label", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "Trigger")
|
||||||
|
.setVisible(false)
|
||||||
|
.rejectArray();
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Display", false], 5, 6,
|
["Display", false], 5, 6,
|
||||||
["Data", false], 2, 0, 4, 1, 7, 3,
|
["Data", false], 2, 0, 4, 1, 7, 3, 8,
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
|
outputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
|
||||||
|
|
||||||
|
attributes.inherit_name = true;
|
||||||
|
doTrigger = 0;
|
||||||
|
|
||||||
|
_onSetDisplayName = function() {
|
||||||
|
attributes.inherit_name = false;
|
||||||
|
}
|
||||||
|
|
||||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
if(inParent.isArray()) return;
|
if(inParent.isArray()) return;
|
||||||
inParent.drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
inParent.drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||||
|
@ -86,7 +109,8 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
|
|
||||||
var _dtype = inputs[| 0].getValue();
|
var _dtype = inputs[| 0].getValue();
|
||||||
var _range = inputs[| 1].getValue();
|
var _range = inputs[| 1].getValue();
|
||||||
var _val_type = inputs[| 2].getValue();
|
var _type = inputs[| 2].getValue();
|
||||||
|
var _val_type = data_type_map[_type];
|
||||||
var _enum_label = inputs[| 3].getValue();
|
var _enum_label = inputs[| 3].getValue();
|
||||||
var _vec_size = inputs[| 4].getValue();
|
var _vec_size = inputs[| 4].getValue();
|
||||||
var _step = inputs[| 7].getValue();
|
var _step = inputs[| 7].getValue();
|
||||||
|
@ -183,7 +207,17 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
inParent.animator = new valueAnimator(new gradientObject(c_white), inParent);
|
inParent.animator = new valueAnimator(new gradientObject(c_white), inParent);
|
||||||
inParent.setDisplay(VALUE_DISPLAY._default);
|
inParent.setDisplay(VALUE_DISPLAY._default);
|
||||||
break;
|
break;
|
||||||
default: inParent.setDisplay(VALUE_DISPLAY._default); break;
|
|
||||||
|
default:
|
||||||
|
inParent.setDisplay(VALUE_DISPLAY._default);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(_val_type) {
|
||||||
|
case VALUE_TYPE.trigger :
|
||||||
|
var bname = inputs[| 8].getValue();
|
||||||
|
inParent.setDisplay(VALUE_DISPLAY.button, [ function() { doTrigger = 1; }, bname]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(index == 5)
|
if(index == 5)
|
||||||
|
@ -229,6 +263,27 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
inParent.name = display_name;
|
inParent.name = display_name;
|
||||||
group.inputMap[? string_replace_all(display_name, " ", "_")] = inParent;
|
group.inputMap[? string_replace_all(display_name, " ", "_")] = inParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _to_list = outputs[| 0].value_to;
|
||||||
|
onSetDisplayName = _onSetDisplayName;
|
||||||
|
if(attributes.inherit_name && !ds_list_empty(_to_list)) {
|
||||||
|
for( var i = 0; i < ds_list_size(_to_list); i++ ) {
|
||||||
|
if(_to_list[| i].value_from != outputs[| 0]) continue;
|
||||||
|
if(display_name == _to_list[| i].name) break;
|
||||||
|
onSetDisplayName = noone;
|
||||||
|
setDisplayName(_to_list[| i].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(inParent.type == VALUE_TYPE.trigger) {
|
||||||
|
if(doTrigger == 1) {
|
||||||
|
outputs[| 0].setValue(true);
|
||||||
|
doTrigger = -1;
|
||||||
|
} else if(doTrigger == -1) {
|
||||||
|
outputs[| 0].setValue(false);
|
||||||
|
doTrigger = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PATCH_STATIC
|
PATCH_STATIC
|
||||||
|
@ -236,16 +291,19 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
static update = function(frame = ANIMATOR.current_frame) {
|
static update = function(frame = ANIMATOR.current_frame) {
|
||||||
if(is_undefined(inParent)) return;
|
if(is_undefined(inParent)) return;
|
||||||
|
|
||||||
var _dtype = inputs[| 0].getValue();
|
var _dstype = inputs[| 0].getValue();
|
||||||
var _data = inputs[| 2].getValue();
|
var _data = inputs[| 2].getValue();
|
||||||
_dtype = display_list[_data][_dtype];
|
_dstype = display_list[_data][_dstype];
|
||||||
|
|
||||||
|
var _datype = data_type_map[_data];
|
||||||
|
|
||||||
inputs[| 1].setVisible(false);
|
inputs[| 1].setVisible(false);
|
||||||
inputs[| 3].setVisible(false);
|
inputs[| 3].setVisible(false);
|
||||||
inputs[| 4].setVisible(false);
|
inputs[| 4].setVisible(false);
|
||||||
inputs[| 7].setVisible(false);
|
inputs[| 7].setVisible(false);
|
||||||
|
inputs[| 8].setVisible(_datype == VALUE_TYPE.trigger);
|
||||||
|
|
||||||
switch(_dtype) {
|
switch(_dstype) {
|
||||||
case "Slider" :
|
case "Slider" :
|
||||||
case "Slider range" :
|
case "Slider range" :
|
||||||
inputs[| 7].setVisible(true);
|
inputs[| 7].setVisible(true);
|
||||||
|
@ -266,22 +324,21 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
createInput(false);
|
createInput(false);
|
||||||
|
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
inputs[| 5].applyDeserialize(_inputs[| 5], load_scale);
|
inputs[| 5].applyDeserialize(_inputs[5], load_scale);
|
||||||
group.sortIO();
|
group.sortIO();
|
||||||
|
|
||||||
inputs[| 2].applyDeserialize(_inputs[| 2], load_scale);
|
inputs[| 2].applyDeserialize(_inputs[2], load_scale);
|
||||||
onValueUpdate(2);
|
onValueUpdate(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static applyDeserialize = function() {
|
static applyDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
var amo = min(ds_list_size(_inputs), ds_list_size(inputs));
|
var amo = min(array_length(_inputs), ds_list_size(inputs));
|
||||||
|
|
||||||
for(var i = 0; i < amo; i++) {
|
for(var i = 0; i < amo; i++) {
|
||||||
if(i == 2 || i == 5) continue;
|
if(i == 2 || i == 5) continue;
|
||||||
inputs[| i].applyDeserialize(_inputs[| i], load_scale);
|
inputs[| i].applyDeserialize(_inputs[i], load_scale);
|
||||||
var raw_val = _inputs[| i][? "raw value"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inParent.name = name;
|
inParent.name = name;
|
||||||
|
|
|
@ -15,9 +15,14 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
inputs[| 1] = nodeValue("Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 1] = nodeValue("Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
|
||||||
|
attributes.inherit_name = true;
|
||||||
outParent = undefined;
|
outParent = undefined;
|
||||||
output_index = -1;
|
output_index = -1;
|
||||||
|
|
||||||
|
_onSetDisplayName = function() {
|
||||||
|
attributes.inherit_name = false;
|
||||||
|
}
|
||||||
|
|
||||||
static setRenderStatus = function(result) {
|
static setRenderStatus = function(result) {
|
||||||
LOG_LINE_IF(global.FLAG.render, $"Set render status for {internalName} : {result}");
|
LOG_LINE_IF(global.FLAG.render, $"Set render status for {internalName} : {result}");
|
||||||
|
|
||||||
|
@ -104,6 +109,14 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
|
|
||||||
outParent.type = inputs[| 0].type;
|
outParent.type = inputs[| 0].type;
|
||||||
outParent.display_type = inputs[| 0].display_type;
|
outParent.display_type = inputs[| 0].display_type;
|
||||||
|
|
||||||
|
onSetDisplayName = _onSetDisplayName;
|
||||||
|
if(attributes.inherit_name && inputs[| 0].value_from != noone) {
|
||||||
|
if(display_name != inputs[| 0].value_from.name) {
|
||||||
|
onSetDisplayName = noone;
|
||||||
|
setDisplayName(inputs[| 0].value_from.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//static triggerRender = function() {
|
//static triggerRender = function() {
|
||||||
|
@ -118,8 +131,8 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
createOutput(false);
|
createOutput(false);
|
||||||
|
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
inputs[| 1].applyDeserialize(_inputs[| 1], load_scale);
|
inputs[| 1].applyDeserialize(_inputs[1], load_scale);
|
||||||
group.sortIO();
|
group.sortIO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ function __generate_node_data() {
|
||||||
};
|
};
|
||||||
|
|
||||||
_lin[i] = {
|
_lin[i] = {
|
||||||
name: _b.inputs[| i].name,
|
name: _b.inputs[| i]._initName,
|
||||||
tooltip: _b.inputs[| i].tooltip,
|
tooltip: _b.inputs[| i].tooltip,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ function __generate_node_data() {
|
||||||
};
|
};
|
||||||
|
|
||||||
_lot[i] = {
|
_lot[i] = {
|
||||||
name: _b.outputs[| i].name,
|
name: _b.outputs[| i]._initName,
|
||||||
tooltip: _b.outputs[| i].tooltip,
|
tooltip: _b.outputs[| i].tooltip,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,9 +191,9 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,9 +127,9 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,12 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
||||||
|
|
||||||
static getValue = function(_time = ANIMATOR.current_frame) {
|
static getValue = function(_time = ANIMATOR.current_frame) {
|
||||||
if(prop.type == VALUE_TYPE.trigger) {
|
if(prop.type == VALUE_TYPE.trigger) {
|
||||||
|
if(ds_list_size(values) == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(!prop.is_anim)
|
||||||
|
return values[| 0].value;
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(values); i++) { //Find trigger
|
for(var i = 0; i < ds_list_size(values); i++) { //Find trigger
|
||||||
var _key = values[| i];
|
var _key = values[| i];
|
||||||
if(_key.time == _time)
|
if(_key.time == _time)
|
||||||
|
@ -278,6 +284,11 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
||||||
|
|
||||||
static setValue = function(_val = 0, _record = true, _time = ANIMATOR.current_frame, ease_in = 0, ease_out = 0) {
|
static setValue = function(_val = 0, _record = true, _time = ANIMATOR.current_frame, ease_in = 0, ease_out = 0) {
|
||||||
if(prop.type == VALUE_TYPE.trigger) {
|
if(prop.type == VALUE_TYPE.trigger) {
|
||||||
|
if(!prop.is_anim) {
|
||||||
|
values[| 0] = new valueKey(0, _val, self);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(values); i++) { //Find trigger
|
for(var i = 0; i < ds_list_size(values); i++) { //Find trigger
|
||||||
var _key = values[| i];
|
var _key = values[| i];
|
||||||
if(_key.time == _time) {
|
if(_key.time == _time) {
|
||||||
|
@ -344,60 +355,56 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static serialize = function(scale = false) {
|
static serialize = function(scale = false) {
|
||||||
var _list = ds_list_create();
|
var _data = [];
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(values); i++) {
|
for(var i = 0; i < ds_list_size(values); i++) {
|
||||||
var _value_list = ds_list_create();
|
var _value_list = [];
|
||||||
if(scale)
|
if(scale)
|
||||||
_value_list[| 0] = values[| i].time / (ANIMATOR.frames_total - 1);
|
_value_list[0] = values[| i].time / (ANIMATOR.frames_total - 1);
|
||||||
else
|
else
|
||||||
_value_list[| 0] = values[| i].time;
|
_value_list[0] = values[| i].time;
|
||||||
|
|
||||||
var val = values[| i].value;
|
var val = values[| i].value;
|
||||||
|
|
||||||
if(prop.type == VALUE_TYPE.struct)
|
if(prop.type == VALUE_TYPE.struct)
|
||||||
_value_list[| 1] = json_stringify(val);
|
_value_list[1] = json_stringify(val);
|
||||||
else if(is_struct(val))
|
else if(is_struct(val))
|
||||||
_value_list[| 1] = val.serialize();
|
_value_list[1] = val.serialize();
|
||||||
else if(!sep_axis && typeArray(prop.display_type) && is_array(val)) {
|
else if(!sep_axis && typeArray(prop.display_type) && is_array(val)) {
|
||||||
var __v = ds_list_create();
|
var __v = [];
|
||||||
for(var j = 0; j < array_length(val); j++) {
|
for(var j = 0; j < array_length(val); j++) {
|
||||||
if(is_struct(val[j]) && struct_has(val[j], "serialize"))
|
if(is_struct(val[j]) && struct_has(val[j], "serialize"))
|
||||||
ds_list_add_map(__v, val[j].serialize());
|
array_push(__v, val[j].serialize());
|
||||||
else
|
else
|
||||||
ds_list_add(__v, val[j]);
|
array_push(__v, val[j]);
|
||||||
}
|
}
|
||||||
_value_list[| 1] = __v;
|
_value_list[1] = __v;
|
||||||
ds_list_mark_as_list(_value_list, 1);
|
|
||||||
} else
|
} else
|
||||||
_value_list[| 1] = values[| i].value;
|
_value_list[1] = values[| i].value;
|
||||||
|
|
||||||
_value_list[| 2] = ds_list_create_from_array(values[| i].ease_in);
|
_value_list[2] = values[| i].ease_in;
|
||||||
ds_list_mark_as_list(_value_list, 2);
|
_value_list[3] = values[| i].ease_out;
|
||||||
_value_list[| 3] = ds_list_create_from_array(values[| i].ease_out);
|
_value_list[4] = values[| i].ease_in_type;
|
||||||
ds_list_mark_as_list(_value_list, 3);
|
_value_list[5] = values[| i].ease_out_type;
|
||||||
|
|
||||||
_value_list[| 4] = values[| i].ease_in_type;
|
array_push(_data, _value_list);
|
||||||
_value_list[| 5] = values[| i].ease_out_type;
|
|
||||||
|
|
||||||
ds_list_add_list(_list, _value_list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return _list;
|
return _data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static deserialize = function(_list, scale = false) {
|
static deserialize = function(_data, scale = false) {
|
||||||
ds_list_clear(values);
|
ds_list_clear(values);
|
||||||
|
|
||||||
if(prop.type == VALUE_TYPE.gradient && LOADING_VERSION < 1340 && !CLONING) { //backward compat: Gradient
|
if(prop.type == VALUE_TYPE.gradient && LOADING_VERSION < 1340 && !CLONING) { //backward compat: Gradient
|
||||||
var _val = [];
|
var _val = [];
|
||||||
var value = _list[| 0][| 1];
|
var value = _data[0][1];
|
||||||
|
|
||||||
if(ds_exists(value, ds_type_list))
|
if(is_array(value))
|
||||||
for(var i = 0; i < ds_list_size(value); i++) {
|
for(var i = 0; i < array_length(value); i++) {
|
||||||
var _keyframe = value[| i];
|
var _keyframe = value[i];
|
||||||
var _t = ds_map_try_get(_keyframe, "time");
|
var _t = struct_try_get(_keyframe, "time");
|
||||||
var _v = ds_map_try_get(_keyframe, "value");
|
var _v = struct_try_get(_keyframe, "value");
|
||||||
|
|
||||||
array_push(_val, new gradientKey(_t, _v));
|
array_push(_val, new gradientKey(_t, _v));
|
||||||
}
|
}
|
||||||
|
@ -410,36 +417,35 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
||||||
|
|
||||||
var base = getValue();
|
var base = getValue();
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(_list); i++) {
|
for(var i = 0; i < array_length(_data); i++) {
|
||||||
var _keyframe = _list[| i];
|
var _keyframe = _data[i];
|
||||||
var _time = _keyframe[| 0];
|
var _time = _keyframe[0];
|
||||||
|
|
||||||
if(scale && _time <= 1)
|
if(scale && _time <= 1)
|
||||||
_time = round(_time * (ANIMATOR.frames_total - 1));
|
_time = round(_time * (ANIMATOR.frames_total - 1));
|
||||||
|
|
||||||
var value = ds_list_get(_keyframe, 1);
|
var value = _keyframe[1];
|
||||||
var ease_in = array_create_from_list(ds_list_get(_keyframe, 2));
|
var ease_in = _keyframe[2];
|
||||||
var ease_out = array_create_from_list(ds_list_get(_keyframe, 3));
|
var ease_out = _keyframe[3];
|
||||||
|
var ease_in_type = _keyframe[4];
|
||||||
|
var ease_out_type = _keyframe[5];
|
||||||
|
|
||||||
var ease_in_type = ds_list_get(_keyframe, 4, CURVE_TYPE.bezier);
|
|
||||||
var ease_out_type = ds_list_get(_keyframe, 5, CURVE_TYPE.bezier);
|
|
||||||
var _val = value;
|
var _val = value;
|
||||||
|
|
||||||
if(prop.type == VALUE_TYPE.struct)
|
if(prop.type == VALUE_TYPE.struct)
|
||||||
_val = json_parse(value);
|
_val = json_parse(value);
|
||||||
else if(prop.type == VALUE_TYPE.path && prop.display_type == VALUE_DISPLAY.path_array) {
|
else if(prop.type == VALUE_TYPE.path && prop.display_type == VALUE_DISPLAY.path_array) {
|
||||||
for(var j = 0; j < ds_list_size(value); j++)
|
for(var j = 0; j < array_length(value); j++)
|
||||||
_val[j] = value[| j];
|
_val[j] = value[j];
|
||||||
} else if(prop.type == VALUE_TYPE.gradient) {
|
} else if(prop.type == VALUE_TYPE.gradient) {
|
||||||
var grad = new gradientObject();
|
var grad = new gradientObject();
|
||||||
_val = grad.deserialize(value);
|
_val = grad.deserialize(value);
|
||||||
} else if(!sep_axis && typeArray(prop.display_type)) {
|
} else if(!sep_axis && typeArray(prop.display_type)) {
|
||||||
_val = [];
|
_val = [];
|
||||||
|
|
||||||
if(ds_exists(value, ds_type_list)) {
|
if(is_array(value))
|
||||||
for(var j = 0; j < ds_list_size(value); j++)
|
for(var j = 0; j < array_length(value); j++)
|
||||||
_val[j] = processValue(value[| j]);
|
_val[j] = processValue(value[j]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//print($"Deserialize {prop.node.name}:{prop.name} = {_val} ");
|
//print($"Deserialize {prop.node.name}:{prop.name} = {_val} ");
|
||||||
|
|
|
@ -43,7 +43,7 @@ function Node_Local_Analyze(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _alg = _data[1];
|
var _alg = _data[1];
|
||||||
var _siz = _data[2];
|
var _siz = _data[2];
|
||||||
var _sam = ds_map_try_get(attributes, "oversample");
|
var _sam = struct_try_get(attributes, "oversample");
|
||||||
var _shp = _data[4];
|
var _shp = _data[4];
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
|
|
|
@ -236,12 +236,9 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
if(LOADING_VERSION < 1380 && !CLONING)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
ds_list_insert(_inputs, 4, noone);
|
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -234,12 +234,9 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
if(LOADING_VERSION < 1380 && !CLONING)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
ds_list_insert(_inputs, 4, noone);
|
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ function Node_Noise_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
var _pos = _data[2];
|
var _pos = _data[2];
|
||||||
var _sca = _data[3];
|
var _sca = _data[3];
|
||||||
var _sam = _data[4];
|
var _sam = _data[4];
|
||||||
var _samTyp = ds_map_try_get(attributes, "oversample");
|
var _samTyp = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ function Node_Noise_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
var _pos = _data[2];
|
var _pos = _data[2];
|
||||||
var _sca = _data[3];
|
var _sca = _data[3];
|
||||||
var _sam = _data[4];
|
var _sam = _data[4];
|
||||||
var _samTyp = ds_map_try_get(attributes, "oversample");
|
var _samTyp = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
||||||
var alpha = _data[4];
|
var alpha = _data[4];
|
||||||
var side = _data[5];
|
var side = _data[5];
|
||||||
var aa = _data[6];
|
var aa = _data[6];
|
||||||
var sam = ds_map_try_get(attributes, "oversample");
|
var sam = struct_try_get(attributes, "oversample");
|
||||||
var bst = _data[8];
|
var bst = _data[8];
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
|
|
|
@ -307,7 +307,7 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
||||||
static onValueFromUpdate = function() { extractPalettes(); }
|
static onValueFromUpdate = function() { extractPalettes(); }
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
if(attributes[? "auto_exe"])
|
if(attributes.auto_exe)
|
||||||
extractPalettes();
|
extractPalettes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _
|
||||||
var surf_w = surface_get_width(_outSurf);
|
var surf_w = surface_get_width(_outSurf);
|
||||||
var surf_h = surface_get_height(_outSurf);
|
var surf_h = surface_get_height(_outSurf);
|
||||||
|
|
||||||
for(var i = 0; i < attributes[? "part_amount"]; i++)
|
for(var i = 0; i < attributes.part_amount; i++)
|
||||||
parts[i].draw(_exact, surf_w, surf_h);
|
parts[i].draw(_exact, surf_w, surf_h);
|
||||||
|
|
||||||
BLEND_NORMAL;
|
BLEND_NORMAL;
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
enum _ANCHOR {
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
c1x,
|
||||||
|
c1y,
|
||||||
|
c2x,
|
||||||
|
c2y,
|
||||||
|
|
||||||
|
ind,
|
||||||
|
}
|
||||||
|
|
||||||
function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Path";
|
name = "Path";
|
||||||
previewable = false;
|
previewable = false;
|
||||||
|
@ -28,7 +39,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
function createAnchor(_x, _y, _dxx = 0, _dxy = 0, _dyx = 0, _dyy = 0) {
|
function createAnchor(_x, _y, _dxx = 0, _dxy = 0, _dyx = 0, _dyy = 0) {
|
||||||
var index = ds_list_size(inputs);
|
var index = ds_list_size(inputs);
|
||||||
|
|
||||||
inputs[| index] = nodeValue("Anchor", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ _x, _y, _dxx, _dxy, _dyx, _dyy ])
|
inputs[| index] = nodeValue("Anchor", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ _x, _y, _dxx, _dxy, _dyx, _dyy, false ])
|
||||||
.setDisplay(VALUE_DISPLAY.vector);
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
recordAction(ACTION_TYPE.var_modify, self, [ array_clone(input_display_list), "input_display_list" ]);
|
recordAction(ACTION_TYPE.var_modify, self, [ array_clone(input_display_list), "input_display_list" ]);
|
||||||
|
@ -73,12 +84,11 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
drag_point_sy = 0;
|
drag_point_sy = 0;
|
||||||
|
|
||||||
transform_type = 0;
|
transform_type = 0;
|
||||||
transform_minx = 0;
|
transform_minx = 0; transform_miny = 0;
|
||||||
transform_miny = 0;
|
transform_maxx = 0; transform_maxy = 0;
|
||||||
transform_maxx = 0;
|
transform_cx = 0; transform_cy = 0;
|
||||||
transform_maxy = 0;
|
transform_sx = 0; transform_sy = 0;
|
||||||
transform_mx = 0;
|
transform_mx = 0; transform_my = 0;
|
||||||
transform_my = 0;
|
|
||||||
|
|
||||||
static onValueUpdate = function(index = 0) {
|
static onValueUpdate = function(index = 0) {
|
||||||
if(index == 2) {
|
if(index == 2) {
|
||||||
|
@ -97,29 +107,33 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var _edited = false;
|
var _edited = false;
|
||||||
|
|
||||||
if(transform_type > 0) {
|
if(transform_type > 0) {
|
||||||
var dx = _mx - transform_mx;
|
|
||||||
var dy = _my - transform_my;
|
|
||||||
|
|
||||||
var _transform_minx = transform_minx;
|
var _transform_minx = transform_minx;
|
||||||
var _transform_miny = transform_miny;
|
var _transform_miny = transform_miny;
|
||||||
var _transform_maxx = transform_maxx;
|
var _transform_maxx = transform_maxx;
|
||||||
var _transform_maxy = transform_maxy;
|
var _transform_maxy = transform_maxy;
|
||||||
|
|
||||||
if(transform_type == 1) {
|
if(transform_type == 5) { #region move
|
||||||
transform_minx += dx / _s;
|
var mx = _mx, my = _my;
|
||||||
transform_miny += dy / _s;
|
|
||||||
} else if(transform_type == 2) {
|
if(key_mod_press(SHIFT)) {
|
||||||
transform_maxx += dx / _s;
|
var dirr = point_direction(transform_sx, transform_sy, _mx, _my) + 360;
|
||||||
transform_miny += dy / _s;
|
var diss = point_distance( transform_sx, transform_sy, _mx, _my);
|
||||||
} else if(transform_type == 3) {
|
var ang = round((dirr) / 45) * 45;
|
||||||
transform_minx += dx / _s;
|
mx = transform_sx + lengthdir_x(diss, ang);
|
||||||
transform_maxy += dy / _s;
|
my = transform_sy + lengthdir_y(diss, ang);
|
||||||
} else if(transform_type == 4) {
|
|
||||||
transform_maxx += dx / _s;
|
|
||||||
transform_maxy += dy / _s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(transform_type == 5) {
|
//var _tsx = transform_sx;
|
||||||
|
//var _tsy = transform_sy;
|
||||||
|
//draw_set_color(COLORS._main_accent);
|
||||||
|
//draw_line(_tsx, _tsy, _tsx + lengthdir_x(1000, 0), _tsy + lengthdir_y(1000, 0));
|
||||||
|
//draw_line(_tsx, _tsy, _tsx + lengthdir_x(1000, 90), _tsy + lengthdir_y(1000, 90));
|
||||||
|
//draw_line(_tsx, _tsy, _tsx + lengthdir_x(1000, 180), _tsy + lengthdir_y(1000, 180));
|
||||||
|
//draw_line(_tsx, _tsy, _tsx + lengthdir_x(1000, 270), _tsy + lengthdir_y(1000, 270));
|
||||||
|
|
||||||
|
var dx = mx - transform_mx;
|
||||||
|
var dy = my - transform_my;
|
||||||
|
|
||||||
for( var i = input_fix_len; i < ds_list_size(inputs); i++ ) {
|
for( var i = input_fix_len; i < ds_list_size(inputs); i++ ) {
|
||||||
var p = inputs[| i].getValue();
|
var p = inputs[| i].getValue();
|
||||||
|
|
||||||
|
@ -129,24 +143,124 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
if(inputs[| i].setValue(p))
|
if(inputs[| i].setValue(p))
|
||||||
_edited = true;
|
_edited = true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
transform_mx = mx;
|
||||||
|
transform_my = my;
|
||||||
|
#endregion
|
||||||
|
} else { #region scale
|
||||||
|
var mx = (_mx - _x) / _s;
|
||||||
|
var my = (_my - _y) / _s;
|
||||||
|
|
||||||
|
switch(transform_type) {
|
||||||
|
case 1 :
|
||||||
|
if(key_mod_press(SHIFT)) {
|
||||||
|
var _dx = mx - _transform_maxx;
|
||||||
|
var _dy = my - _transform_maxy;
|
||||||
|
var _dd = max(abs(_dx), abs(_dy));
|
||||||
|
|
||||||
|
mx = _transform_maxx + _dd * sign(_dx);
|
||||||
|
my = _transform_maxy + _dd * sign(_dy);
|
||||||
|
}
|
||||||
|
|
||||||
|
transform_minx = mx;
|
||||||
|
transform_miny = my;
|
||||||
|
|
||||||
|
if(key_mod_press(ALT)) {
|
||||||
|
transform_maxx = transform_cx - (mx - transform_cx);
|
||||||
|
transform_maxy = transform_cy - (my - transform_cy);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2 :
|
||||||
|
if(key_mod_press(SHIFT)) {
|
||||||
|
var _dx = mx - _transform_minx;
|
||||||
|
var _dy = my - _transform_maxy;
|
||||||
|
var _dd = max(abs(_dx), abs(_dy));
|
||||||
|
|
||||||
|
mx = _transform_minx + _dd * sign(_dx);
|
||||||
|
my = _transform_maxy + _dd * sign(_dy);
|
||||||
|
}
|
||||||
|
|
||||||
|
transform_maxx = mx;
|
||||||
|
transform_miny = my;
|
||||||
|
|
||||||
|
if(key_mod_press(ALT)) {
|
||||||
|
transform_minx = transform_cx - (mx - transform_cx);
|
||||||
|
transform_maxy = transform_cy - (my - transform_cy);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3 :
|
||||||
|
if(key_mod_press(SHIFT)) {
|
||||||
|
var _dx = mx - _transform_maxx;
|
||||||
|
var _dy = my - _transform_miny;
|
||||||
|
var _dd = max(abs(_dx), abs(_dy));
|
||||||
|
|
||||||
|
mx = _transform_maxx + _dd * sign(_dx);
|
||||||
|
my = _transform_miny + _dd * sign(_dy);
|
||||||
|
}
|
||||||
|
|
||||||
|
transform_minx = mx;
|
||||||
|
transform_maxy = my;
|
||||||
|
|
||||||
|
if(key_mod_press(ALT)) {
|
||||||
|
transform_maxx = transform_cx - (mx - transform_cx);
|
||||||
|
transform_miny = transform_cy - (my - transform_cy);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4 :
|
||||||
|
if(key_mod_press(SHIFT)) {
|
||||||
|
var _dx = mx - _transform_minx;
|
||||||
|
var _dy = my - _transform_miny;
|
||||||
|
var _dd = max(abs(_dx), abs(_dy));
|
||||||
|
|
||||||
|
mx = _transform_minx + _dd * sign(_dx);
|
||||||
|
my = _transform_miny + _dd * sign(_dy);
|
||||||
|
}
|
||||||
|
|
||||||
|
transform_maxx = mx;
|
||||||
|
transform_maxy = my;
|
||||||
|
|
||||||
|
if(key_mod_press(ALT)) {
|
||||||
|
transform_minx = transform_cx - (mx - transform_cx);
|
||||||
|
transform_miny = transform_cy - (my - transform_cy);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tr_rx = transform_maxx - transform_minx;
|
||||||
|
var tr_ry = transform_maxy - transform_miny;
|
||||||
|
var _tr_rx = _transform_maxx - _transform_minx;
|
||||||
|
var _tr_ry = _transform_maxy - _transform_miny;
|
||||||
|
|
||||||
for( var i = input_fix_len; i < ds_list_size(inputs); i++ ) {
|
for( var i = input_fix_len; i < ds_list_size(inputs); i++ ) {
|
||||||
var p = inputs[| i].getValue();
|
var p = inputs[| i].getValue();
|
||||||
|
|
||||||
p[0] = transform_minx + (p[0] - _transform_minx) / (_transform_maxx - _transform_minx) * (transform_maxx - transform_minx);
|
var _p2 = p[_ANCHOR.x] + p[_ANCHOR.c1x];
|
||||||
p[1] = transform_miny + (p[1] - _transform_miny) / (_transform_maxy - _transform_miny) * (transform_maxy - transform_miny);
|
var _p3 = p[_ANCHOR.y] + p[_ANCHOR.c1y];
|
||||||
|
var _p4 = p[_ANCHOR.x] + p[_ANCHOR.c2x];
|
||||||
|
var _p5 = p[_ANCHOR.y] + p[_ANCHOR.c2y];
|
||||||
|
|
||||||
|
p[_ANCHOR.x] = transform_minx + (p[_ANCHOR.x] - _transform_minx) / _tr_rx * tr_rx;
|
||||||
|
p[_ANCHOR.y] = transform_miny + (p[_ANCHOR.y] - _transform_miny) / _tr_ry * tr_ry;
|
||||||
|
|
||||||
|
_p2 = transform_minx + (_p2 - _transform_minx) / _tr_rx * tr_rx;
|
||||||
|
_p3 = transform_miny + (_p3 - _transform_miny) / _tr_ry * tr_ry;
|
||||||
|
_p4 = transform_minx + (_p4 - _transform_minx) / _tr_rx * tr_rx;
|
||||||
|
_p5 = transform_miny + (_p5 - _transform_miny) / _tr_ry * tr_ry;
|
||||||
|
|
||||||
|
p[_ANCHOR.c1x] = _p2 - p[_ANCHOR.x];
|
||||||
|
p[_ANCHOR.c1y] = _p3 - p[_ANCHOR.y];
|
||||||
|
p[_ANCHOR.c2x] = _p4 - p[_ANCHOR.x];
|
||||||
|
p[_ANCHOR.c2y] = _p5 - p[_ANCHOR.y];
|
||||||
|
|
||||||
if(inputs[| i].setValue(p))
|
if(inputs[| i].setValue(p))
|
||||||
_edited = true;
|
_edited = true;
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_edited)
|
if(_edited)
|
||||||
UNDO_HOLDING = true;
|
UNDO_HOLDING = true;
|
||||||
|
|
||||||
transform_mx = _mx;
|
|
||||||
transform_my = _my;
|
|
||||||
|
|
||||||
if(mouse_release(mb_left)) {
|
if(mouse_release(mb_left)) {
|
||||||
transform_type = 0;
|
transform_type = 0;
|
||||||
UPDATE |= RENDER_TYPE.full;
|
UPDATE |= RENDER_TYPE.full;
|
||||||
|
@ -156,58 +270,62 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var dx = value_snap(drag_point_sx + (_mx - drag_point_mx) / _s, _snx);
|
var dx = value_snap(drag_point_sx + (_mx - drag_point_mx) / _s, _snx);
|
||||||
var dy = value_snap(drag_point_sy + (_my - drag_point_my) / _s, _sny);
|
var dy = value_snap(drag_point_sy + (_my - drag_point_my) / _s, _sny);
|
||||||
|
|
||||||
if(drag_type < 2) {
|
if(drag_type < 2) { #region move points
|
||||||
var inp = inputs[| input_fix_len + drag_point];
|
var inp = inputs[| input_fix_len + drag_point];
|
||||||
var anc = inp.getValue();
|
var anc = inp.getValue();
|
||||||
|
|
||||||
|
if(drag_type != 0 && SHIFT == KEYBOARD_STATUS.down)
|
||||||
|
anc[_ANCHOR.ind] = !anc[_ANCHOR.ind];
|
||||||
|
|
||||||
if(drag_type == 0) { //drag anchor point
|
if(drag_type == 0) { //drag anchor point
|
||||||
anc[0] = dx;
|
anc[_ANCHOR.x] = dx;
|
||||||
anc[1] = dy;
|
anc[_ANCHOR.y] = dy;
|
||||||
if(key_mod_press(CTRL)) {
|
if(key_mod_press(CTRL)) {
|
||||||
anc[0] = round(anc[0]);
|
anc[_ANCHOR.x] = round(anc[0]);
|
||||||
anc[1] = round(anc[1]);
|
anc[_ANCHOR.y] = round(anc[1]);
|
||||||
}
|
}
|
||||||
} else if(drag_type == 1) { //drag control 1
|
} else if(drag_type == 1) { //drag control 1
|
||||||
anc[2] = dx - anc[0];
|
anc[_ANCHOR.c1x] = dx - anc[_ANCHOR.x];
|
||||||
anc[3] = dy - anc[1];
|
anc[_ANCHOR.c1y] = dy - anc[_ANCHOR.y];
|
||||||
|
|
||||||
if(!key_mod_press(SHIFT)) {
|
if(!anc[_ANCHOR.ind]) {
|
||||||
anc[4] = -anc[2];
|
anc[_ANCHOR.c2x] = -anc[_ANCHOR.c1x];
|
||||||
anc[5] = -anc[3];
|
anc[_ANCHOR.c2y] = -anc[_ANCHOR.c1y];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_mod_press(CTRL)) {
|
if(key_mod_press(CTRL)) {
|
||||||
anc[2] = round(anc[2]);
|
anc[_ANCHOR.c1x] = round(anc[_ANCHOR.c1x]);
|
||||||
anc[3] = round(anc[3]);
|
anc[_ANCHOR.c1y] = round(anc[_ANCHOR.c1y]);
|
||||||
|
|
||||||
if(key_mod_press(SHIFT)) {
|
if(!anc[_ANCHOR.ind]) {
|
||||||
anc[4] = round(anc[4]);
|
anc[_ANCHOR.c2x] = round(anc[_ANCHOR.c2x]);
|
||||||
anc[5] = round(anc[5]);
|
anc[_ANCHOR.c2y] = round(anc[_ANCHOR.c2y]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(drag_type == -1) { //drag control 2
|
} else if(drag_type == -1) { //drag control 2
|
||||||
anc[4] = dx - anc[0];
|
anc[_ANCHOR.c2x] = dx - anc[_ANCHOR.x];
|
||||||
anc[5] = dy - anc[1];
|
anc[_ANCHOR.c2y] = dy - anc[_ANCHOR.y];
|
||||||
|
|
||||||
if(!key_mod_press(SHIFT)) {
|
if(!anc[_ANCHOR.ind]) {
|
||||||
anc[2] = -anc[4];
|
anc[_ANCHOR.c1x] = -anc[4];
|
||||||
anc[3] = -anc[5];
|
anc[_ANCHOR.c1y] = -anc[5];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_mod_press(CTRL)) {
|
if(key_mod_press(CTRL)) {
|
||||||
anc[2] = round(anc[2]);
|
anc[_ANCHOR.c2x] = round(anc[_ANCHOR.c2x]);
|
||||||
anc[3] = round(anc[3]);
|
anc[_ANCHOR.c2y] = round(anc[_ANCHOR.c2y]);
|
||||||
|
|
||||||
if(!key_mod_press(SHIFT)) {
|
if(!anc[_ANCHOR.ind]) {
|
||||||
anc[4] = round(anc[4]);
|
anc[_ANCHOR.c1x] = round(anc[_ANCHOR.c1x]);
|
||||||
anc[5] = round(anc[5]);
|
anc[_ANCHOR.c1y] = round(anc[_ANCHOR.c1y]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(inp.setValue(anc))
|
if(inp.setValue(anc))
|
||||||
_edited = true;
|
_edited = true;
|
||||||
} else if(drag_type == 2) { //pen tools
|
#endregion
|
||||||
|
} else if(drag_type == 2) { #region pen tools
|
||||||
var ox, oy, nx, ny;
|
var ox, oy, nx, ny;
|
||||||
var pxx = (_mx - _x) / _s;
|
var pxx = (_mx - _x) / _s;
|
||||||
var pxy = (_my - _y) / _s;
|
var pxy = (_my - _y) / _s;
|
||||||
|
@ -215,11 +333,10 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
draw_set_color(COLORS._main_accent);
|
draw_set_color(COLORS._main_accent);
|
||||||
for( var i = 0; i < array_length(drag_points); i++ ) {
|
for( var i = 0; i < array_length(drag_points); i++ ) {
|
||||||
var _p = drag_points[i];
|
var _p = drag_points[i];
|
||||||
nx = _x + _p[0] * _s;
|
nx = _x + _p[_ANCHOR.x] * _s;
|
||||||
ny = _y + _p[1] * _s;
|
ny = _y + _p[_ANCHOR.y] * _s;
|
||||||
|
|
||||||
if(i)
|
if(i) draw_line(ox, oy, nx, ny);
|
||||||
draw_line(ox, oy, nx, ny);
|
|
||||||
|
|
||||||
ox = nx;
|
ox = nx;
|
||||||
oy = ny;
|
oy = ny;
|
||||||
|
@ -282,12 +399,12 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var _p0 = drag_points[points[i - 1]];
|
var _p0 = drag_points[points[i - 1]];
|
||||||
var _p1 = drag_points[points[i + 1]];
|
var _p1 = drag_points[points[i + 1]];
|
||||||
|
|
||||||
var d0 = point_direction(_p0[0], _p0[1], _p[0], _p[1]);
|
var d0 = point_direction(_p0[_ANCHOR.x], _p0[_ANCHOR.y], _p[_ANCHOR.x], _p[_ANCHOR.y]);
|
||||||
var d1 = point_direction(_p[0], _p[1], _p1[0], _p1[1]);
|
var d1 = point_direction( _p[_ANCHOR.x], _p[_ANCHOR.y], _p1[_ANCHOR.x], _p1[_ANCHOR.y]);
|
||||||
|
|
||||||
var dd = d0 + angle_difference(d1, d0) / 2;
|
var dd = d0 + angle_difference(d1, d0) / 2;
|
||||||
var ds0 = point_distance(_p0[0], _p0[1], _p[0], _p[1]);
|
var ds0 = point_distance(_p0[_ANCHOR.x], _p0[_ANCHOR.y], _p[_ANCHOR.x], _p[_ANCHOR.y]);
|
||||||
var ds1 = point_distance(_p[0], _p[1], _p1[0], _p1[1]);
|
var ds1 = point_distance( _p[_ANCHOR.x], _p[_ANCHOR.y], _p1[_ANCHOR.x], _p1[_ANCHOR.y]);
|
||||||
|
|
||||||
dxx = lengthdir_x(ds0 / 3, dd + 180);
|
dxx = lengthdir_x(ds0 / 3, dd + 180);
|
||||||
dxy = lengthdir_y(ds0 / 3, dd + 180);
|
dxy = lengthdir_y(ds0 / 3, dd + 180);
|
||||||
|
@ -295,9 +412,9 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
dyy = lengthdir_y(ds1 / 3, dd);
|
dyy = lengthdir_y(ds1 / 3, dd);
|
||||||
}
|
}
|
||||||
|
|
||||||
anc = [_p[0], _p[1], dxx, dxy, dyx, dyy];
|
anc = [_p[_ANCHOR.x], _p[_ANCHOR.y], dxx, dxy, dyx, dyy];
|
||||||
if(input_fix_len + i >= ds_list_size(inputs))
|
if(input_fix_len + i >= ds_list_size(inputs))
|
||||||
createAnchor(_p[0], _p[1], dxx, dxy, dyx, dyy);
|
createAnchor(_p[_ANCHOR.x], _p[_ANCHOR.y], dxx, dxy, dyx, dyy);
|
||||||
else
|
else
|
||||||
inputs[| input_fix_len + i].setValue(anc);
|
inputs[| input_fix_len + i].setValue(anc);
|
||||||
}
|
}
|
||||||
|
@ -307,7 +424,8 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
inputs[| input_fix_len + i].setValue(anc);
|
inputs[| input_fix_len + i].setValue(anc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(drag_type == 3) {
|
#endregion
|
||||||
|
} else if(drag_type == 3) { #region draw rectangle
|
||||||
var minx = min((_mx - _x) / _s, (drag_point_mx - _x) / _s);
|
var minx = min((_mx - _x) / _s, (drag_point_mx - _x) / _s);
|
||||||
var maxx = max((_mx - _x) / _s, (drag_point_mx - _x) / _s);
|
var maxx = max((_mx - _x) / _s, (drag_point_mx - _x) / _s);
|
||||||
var miny = min((_my - _y) / _s, (drag_point_my - _y) / _s);
|
var miny = min((_my - _y) / _s, (drag_point_my - _y) / _s);
|
||||||
|
@ -328,23 +446,24 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
for( var i = 0; i < 4; i++ )
|
for( var i = 0; i < 4; i++ )
|
||||||
a[i] = inputs[| input_fix_len + i].getValue();
|
a[i] = inputs[| input_fix_len + i].getValue();
|
||||||
|
|
||||||
a[0][0] = minx;
|
a[0][_ANCHOR.x] = minx;
|
||||||
a[0][1] = miny;
|
a[0][_ANCHOR.y] = miny;
|
||||||
|
|
||||||
a[1][0] = maxx;
|
a[1][_ANCHOR.x] = maxx;
|
||||||
a[1][1] = miny;
|
a[1][_ANCHOR.y] = miny;
|
||||||
|
|
||||||
a[2][0] = maxx;
|
a[2][_ANCHOR.x] = maxx;
|
||||||
a[2][1] = maxy;
|
a[2][_ANCHOR.y] = maxy;
|
||||||
|
|
||||||
a[3][0] = minx;
|
a[3][_ANCHOR.x] = minx;
|
||||||
a[3][1] = maxy;
|
a[3][_ANCHOR.y] = maxy;
|
||||||
|
|
||||||
for( var i = 0; i < 4; i++ ) {
|
for( var i = 0; i < 4; i++ ) {
|
||||||
if(inputs[| input_fix_len + i].setValue(a[i]))
|
if(inputs[| input_fix_len + i].setValue(a[i]))
|
||||||
_edited = true;
|
_edited = true;
|
||||||
}
|
}
|
||||||
} else if(drag_type == 4) {
|
#endregion
|
||||||
|
} else if(drag_type == 4) { #region draw circle
|
||||||
var minx = min((_mx - _x) / _s, (drag_point_mx - _x) / _s);
|
var minx = min((_mx - _x) / _s, (drag_point_mx - _x) / _s);
|
||||||
var maxx = max((_mx - _x) / _s, (drag_point_mx - _x) / _s);
|
var maxx = max((_mx - _x) / _s, (drag_point_mx - _x) / _s);
|
||||||
var miny = min((_my - _y) / _s, (drag_point_my - _y) / _s);
|
var miny = min((_my - _y) / _s, (drag_point_my - _y) / _s);
|
||||||
|
@ -365,38 +484,39 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
for( var i = 0; i < 4; i++ )
|
for( var i = 0; i < 4; i++ )
|
||||||
a[i] = inputs[| input_fix_len + i].getValue();
|
a[i] = inputs[| input_fix_len + i].getValue();
|
||||||
|
|
||||||
a[0][0] = (minx + maxx) / 2;
|
a[0][_ANCHOR.x ] = (minx + maxx) / 2;
|
||||||
a[0][1] = miny;
|
a[0][_ANCHOR.y ] = miny;
|
||||||
a[0][2] = -(maxx - minx) * 0.27614;
|
a[0][_ANCHOR.c1x] = -(maxx - minx) * 0.27614;
|
||||||
a[0][3] = 0;
|
a[0][_ANCHOR.c1y] = 0;
|
||||||
a[0][4] = (maxx - minx) * 0.27614;
|
a[0][_ANCHOR.c2x] = (maxx - minx) * 0.27614;
|
||||||
a[0][5] = 0;
|
a[0][_ANCHOR.c2y] = 0;
|
||||||
|
|
||||||
a[1][0] = maxx;
|
a[1][_ANCHOR.x ] = maxx;
|
||||||
a[1][1] = (miny + maxy) / 2;
|
a[1][_ANCHOR.y ] = (miny + maxy) / 2;
|
||||||
a[1][2] = 0;
|
a[1][_ANCHOR.c1x] = 0;
|
||||||
a[1][3] = -(maxy - miny) * 0.27614;
|
a[1][_ANCHOR.c1y] = -(maxy - miny) * 0.27614;
|
||||||
a[1][4] = 0;
|
a[1][_ANCHOR.c2x] = 0;
|
||||||
a[1][5] = (maxy - miny) * 0.27614;
|
a[1][_ANCHOR.c2y] = (maxy - miny) * 0.27614;
|
||||||
|
|
||||||
a[2][0] = (minx + maxx) / 2;
|
a[2][_ANCHOR.x ] = (minx + maxx) / 2;
|
||||||
a[2][1] = maxy;
|
a[2][_ANCHOR.y ] = maxy;
|
||||||
a[2][2] = (maxx - minx) * 0.27614;
|
a[2][_ANCHOR.c1x] = (maxx - minx) * 0.27614;
|
||||||
a[2][3] = 0;
|
a[2][_ANCHOR.c1y] = 0;
|
||||||
a[2][4] = -(maxx - minx) * 0.27614;
|
a[2][_ANCHOR.c2x] = -(maxx - minx) * 0.27614;
|
||||||
a[2][5] = 0;
|
a[2][_ANCHOR.c2y] = 0;
|
||||||
|
|
||||||
a[3][0] = minx;
|
a[3][_ANCHOR.x ] = minx;
|
||||||
a[3][1] = (miny + maxy) / 2;
|
a[3][_ANCHOR.y ] = (miny + maxy) / 2;
|
||||||
a[3][2] = 0;
|
a[3][_ANCHOR.c1x] = 0;
|
||||||
a[3][3] = (maxy - miny) * 0.27614;
|
a[3][_ANCHOR.c1y] = (maxy - miny) * 0.27614;
|
||||||
a[3][4] = 0;
|
a[3][_ANCHOR.c2x] = 0;
|
||||||
a[3][5] = -(maxy - miny) * 0.27614;
|
a[3][_ANCHOR.c2y] = -(maxy - miny) * 0.27614;
|
||||||
|
|
||||||
for( var i = 0; i < 4; i++ ) {
|
for( var i = 0; i < 4; i++ ) {
|
||||||
if(inputs[| input_fix_len + i].setValue(a[i]))
|
if(inputs[| input_fix_len + i].setValue(a[i]))
|
||||||
_edited = true;
|
_edited = true;
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_edited) UNDO_HOLDING = true;
|
if(_edited) UNDO_HOLDING = true;
|
||||||
|
@ -408,13 +528,13 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region draw control anchor
|
#region check line hover
|
||||||
var line_hover = -1;
|
var line_hover = -1;
|
||||||
var points = [];
|
var points = [];
|
||||||
var _a0, _a1;
|
var _a0, _a1;
|
||||||
|
|
||||||
var minx = 99999, miny = 99999;
|
var minx = 99999, miny = 99999;
|
||||||
var maxx = 0 , maxy = 0;
|
var maxx = -99999, maxy = -99999;
|
||||||
|
|
||||||
for(var i = loop? 0 : 1; i < ansize; i++) {
|
for(var i = loop? 0 : 1; i < ansize; i++) {
|
||||||
if(i) {
|
if(i) {
|
||||||
|
@ -429,12 +549,16 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
for(var j = 0; j < sample; j++) {
|
for(var j = 0; j < sample; j++) {
|
||||||
if(array_length(_a0) < 6) continue;
|
if(array_length(_a0) < 6) continue;
|
||||||
|
|
||||||
p = eval_bezier(j / (sample - 1), _a0[0], _a0[1], _a1[0], _a1[1], _a0[0] + _a0[4], _a0[1] + _a0[5], _a1[0] + _a1[2], _a1[1] + _a1[3]);
|
p = eval_bezier(j / (sample - 1), _a0[_ANCHOR.x], _a0[_ANCHOR.y],
|
||||||
|
_a1[_ANCHOR.x], _a1[_ANCHOR.y],
|
||||||
|
_a0[_ANCHOR.x] + _a0[_ANCHOR.c2x], _a0[_ANCHOR.y] + _a0[_ANCHOR.c2y],
|
||||||
|
_a1[_ANCHOR.x] + _a1[_ANCHOR.c1x], _a1[_ANCHOR.y] + _a1[_ANCHOR.c1y]);
|
||||||
_nx = _x + p[0] * _s;
|
_nx = _x + p[0] * _s;
|
||||||
_ny = _y + p[1] * _s;
|
_ny = _y + p[1] * _s;
|
||||||
|
|
||||||
minx = min(minx, _nx); miny = min(miny, _ny);
|
minx = min(minx, _nx); miny = min(miny, _ny);
|
||||||
maxx = max(maxx, _nx); maxy = max(maxy, _ny);
|
maxx = max(maxx, _nx); maxy = max(maxy, _ny);
|
||||||
|
|
||||||
array_push(pnt, [ _nx, _ny ]);
|
array_push(pnt, [ _nx, _ny ]);
|
||||||
|
|
||||||
if(j && (key_mod_press(CTRL) || isUsingTool(1)) && distance_to_line(_mx, _my, _ox, _oy, _nx, _ny) < 4)
|
if(j && (key_mod_press(CTRL) || isUsingTool(1)) && distance_to_line(_mx, _my, _ox, _oy, _nx, _ny) < 4)
|
||||||
|
@ -447,13 +571,13 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
array_push(points, pnt);
|
array_push(points, pnt);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
#region draw path
|
||||||
draw_set_color(isUsingTool(0)? c_white : COLORS._main_accent);
|
draw_set_color(isUsingTool(0)? c_white : COLORS._main_accent);
|
||||||
var ind = 0;
|
var ind = 0;
|
||||||
for(var i = loop? 0 : 1; i < ansize; i++) {
|
for(var i = loop? 0 : 1; i < ansize; i++) {
|
||||||
for(var j = 0; j < sample; j++) {
|
for(var j = 0; j < sample; j++) {
|
||||||
_nx = points[ind][j][0];
|
_nx = points[ind][j][_ANCHOR.x];
|
||||||
_ny = points[ind][j][1];
|
_ny = points[ind][j][_ANCHOR.y];
|
||||||
|
|
||||||
if(j) draw_line_width(_ox, _oy, _nx, _ny, 1 + 2 * (line_hover == i));
|
if(j) draw_line_width(_ox, _oy, _nx, _ny, 1 + 2 * (line_hover == i));
|
||||||
|
|
||||||
|
@ -511,8 +635,9 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
hover_type = -1;
|
hover_type = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
if(isUsingTool(0)) { //transform tools
|
if(isUsingTool(0)) { #region transform tools
|
||||||
var hov = 0;
|
var hov = 0;
|
||||||
if(point_in_circle(_mx, _my, minx, miny, 8)) hov = 1;
|
if(point_in_circle(_mx, _my, minx, miny, 8)) hov = 1;
|
||||||
else if(point_in_circle(_mx, _my, maxx, miny, 8)) hov = 2;
|
else if(point_in_circle(_mx, _my, maxx, miny, 8)) hov = 2;
|
||||||
|
@ -530,14 +655,16 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
|
||||||
if(hov && mouse_press(mb_left, active)) {
|
if(hov && mouse_press(mb_left, active)) {
|
||||||
transform_type = hov;
|
transform_type = hov;
|
||||||
transform_minx = (minx - _x) / _s;
|
transform_minx = (minx - _x) / _s; transform_maxx = (maxx - _x) / _s;
|
||||||
transform_maxx = (maxx - _x) / _s;
|
transform_miny = (miny - _y) / _s; transform_maxy = (maxy - _y) / _s;
|
||||||
transform_miny = (miny - _y) / _s;
|
transform_mx = _mx; transform_my = _my;
|
||||||
transform_maxy = (maxy - _y) / _s;
|
transform_sx = _mx; transform_sy = _my;
|
||||||
transform_mx = _mx;
|
|
||||||
transform_my = _my;
|
transform_cx = (transform_minx + transform_maxx) / 2;
|
||||||
|
transform_cy = (transform_miny + transform_maxy) / 2;
|
||||||
}
|
}
|
||||||
} else if(isUsingTool(3)) { //pen tools
|
#endregion
|
||||||
|
} else if(isUsingTool(3)) { #region pen tools
|
||||||
draw_sprite_ui_uniform(THEME.path_tools_draw, 0, _mx + 16, _my + 16);
|
draw_sprite_ui_uniform(THEME.path_tools_draw, 0, _mx + 16, _my + 16);
|
||||||
|
|
||||||
if(mouse_press(mb_left, active)) {
|
if(mouse_press(mb_left, active)) {
|
||||||
|
@ -554,7 +681,8 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
drag_point_mx = (_mx - _x) / _s;
|
drag_point_mx = (_mx - _x) / _s;
|
||||||
drag_point_my = (_my - _y) / _s;
|
drag_point_my = (_my - _y) / _s;
|
||||||
}
|
}
|
||||||
} else if(isUsingTool(4) || isUsingTool(5)) { //shape tools
|
#endregion
|
||||||
|
} else if(isUsingTool(4) || isUsingTool(5)) { #region shape tools
|
||||||
draw_sprite_ui_uniform(THEME.cursor_path_add, 0, _mx + 16, _my + 16);
|
draw_sprite_ui_uniform(THEME.cursor_path_add, 0, _mx + 16, _my + 16);
|
||||||
|
|
||||||
if(mouse_press(mb_left, active)) {
|
if(mouse_press(mb_left, active)) {
|
||||||
|
@ -571,9 +699,10 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
repeat(4)
|
repeat(4)
|
||||||
createAnchor(value_snap((_mx - _x) / _s, _snx), value_snap((_my - _y) / _s, _sny));
|
createAnchor(value_snap((_mx - _x) / _s, _snx), value_snap((_my - _y) / _s, _sny));
|
||||||
}
|
}
|
||||||
} else if(anchor_hover != -1) { //no tool, dragging existing point
|
#endregion
|
||||||
|
} else if(anchor_hover != -1) { #region no tool, dragging existing point
|
||||||
var _a = inputs[| input_fix_len + anchor_hover].getValue();
|
var _a = inputs[| input_fix_len + anchor_hover].getValue();
|
||||||
if(isUsingTool(2)) {
|
if(isUsingTool(2) && hover_type == 0) {
|
||||||
draw_sprite_ui_uniform(THEME.cursor_path_anchor, 0, _mx + 16, _my + 16);
|
draw_sprite_ui_uniform(THEME.cursor_path_anchor, 0, _mx + 16, _my + 16);
|
||||||
|
|
||||||
if(mouse_press(mb_left, active)) {
|
if(mouse_press(mb_left, active)) {
|
||||||
|
@ -582,12 +711,14 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
_a[3] = 0;
|
_a[3] = 0;
|
||||||
_a[4] = 0;
|
_a[4] = 0;
|
||||||
_a[5] = 0;
|
_a[5] = 0;
|
||||||
|
_a[6] = false;
|
||||||
inputs[| input_fix_len + anchor_hover].setValue(_a);
|
inputs[| input_fix_len + anchor_hover].setValue(_a);
|
||||||
} else {
|
} else {
|
||||||
_a[2] = -8;
|
_a[2] = -8;
|
||||||
_a[3] = 0;
|
_a[3] = 0;
|
||||||
_a[4] = 8;
|
_a[4] = 8;
|
||||||
_a[5] = 0;
|
_a[5] = 0;
|
||||||
|
_a[6] = false;
|
||||||
|
|
||||||
drag_point = anchor_hover;
|
drag_point = anchor_hover;
|
||||||
drag_type = 1;
|
drag_type = 1;
|
||||||
|
@ -612,6 +743,11 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
draw_sprite_ui_uniform(THEME.cursor_path_move, 0, _mx + 16, _my + 16);
|
draw_sprite_ui_uniform(THEME.cursor_path_move, 0, _mx + 16, _my + 16);
|
||||||
|
|
||||||
if(mouse_press(mb_left, active)) {
|
if(mouse_press(mb_left, active)) {
|
||||||
|
if(isUsingTool(2)) {
|
||||||
|
_a[_ANCHOR.ind] = true;
|
||||||
|
inputs[| input_fix_len + anchor_hover].setValue(_a);
|
||||||
|
}
|
||||||
|
|
||||||
drag_point = anchor_hover;
|
drag_point = anchor_hover;
|
||||||
drag_type = hover_type;
|
drag_type = hover_type;
|
||||||
drag_point_mx = _mx;
|
drag_point_mx = _mx;
|
||||||
|
@ -628,7 +764,8 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(key_mod_press(CTRL) || isUsingTool(1)) { //anchor edit
|
#endregion
|
||||||
|
} else if(key_mod_press(CTRL) || isUsingTool(1)) { #region anchor edit
|
||||||
draw_sprite_ui_uniform(THEME.cursor_path_add, 0, _mx + 16, _my + 16);
|
draw_sprite_ui_uniform(THEME.cursor_path_add, 0, _mx + 16, _my + 16);
|
||||||
|
|
||||||
if(mouse_press(mb_left, active)) {
|
if(mouse_press(mb_left, active)) {
|
||||||
|
@ -651,6 +788,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
|
||||||
UPDATE |= RENDER_TYPE.full;
|
UPDATE |= RENDER_TYPE.full;
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -832,12 +970,9 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
if(LOADING_VERSION < 1380 && !CLONING)
|
for(var i = input_fix_len; i < array_length(_inputs); i++)
|
||||||
ds_list_insert(_inputs, 3, noone);
|
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i++)
|
|
||||||
createAnchor(0, 0);
|
createAnchor(0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -133,9 +133,9 @@ function Node_Path_Array(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -286,9 +286,9 @@ function Node_Path_L_System(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -8,7 +8,7 @@ enum ARRAY_PROCESS {
|
||||||
#macro PROCESSOR_OVERLAY_CHECK if(array_length(current_data) != ds_list_size(inputs)) return;
|
#macro PROCESSOR_OVERLAY_CHECK if(array_length(current_data) != ds_list_size(inputs)) return;
|
||||||
|
|
||||||
function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
attributes[? "array_process"] = ARRAY_PROCESS.loop;
|
attributes.array_process = ARRAY_PROCESS.loop;
|
||||||
current_data = [];
|
current_data = [];
|
||||||
inputs_data = [];
|
inputs_data = [];
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
array_push(attributeEditors, [ "Array process type", "array_process",
|
array_push(attributeEditors, [ "Array process type", "array_process",
|
||||||
new scrollBox([ "Loop", "Hold", "Expand", "Expand inverse" ],
|
new scrollBox([ "Loop", "Hold", "Expand", "Expand inverse" ],
|
||||||
function(val) {
|
function(val) {
|
||||||
attributes[? "array_process"] = val;
|
attributes.array_process = val;
|
||||||
triggerRender();
|
triggerRender();
|
||||||
}, false) ]);
|
}, false) ]);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
|
|
||||||
if(!_n.isArray()) return _in;
|
if(!_n.isArray()) return _in;
|
||||||
|
|
||||||
switch(attributes[? "array_process"]) {
|
switch(attributes.array_process) {
|
||||||
case ARRAY_PROCESS.loop : _index = safe_mod(_arr, array_length(_in)); break;
|
case ARRAY_PROCESS.loop : _index = safe_mod(_arr, array_length(_in)); break;
|
||||||
case ARRAY_PROCESS.hold : _index = min(_arr, array_length(_in) - 1); break;
|
case ARRAY_PROCESS.hold : _index = min(_arr, array_length(_in) - 1); break;
|
||||||
case ARRAY_PROCESS.expand : _index = floor(_arr / process_length[_index][1]) % process_length[_index][0]; break;
|
case ARRAY_PROCESS.expand : _index = floor(_arr / process_length[_index][1]) % process_length[_index][0]; break;
|
||||||
|
@ -131,7 +131,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var _index = 0;
|
var _index = 0;
|
||||||
switch(attributes[? "array_process"]) {
|
switch(attributes.array_process) {
|
||||||
case ARRAY_PROCESS.loop : _index = safe_mod(l, array_length(_in)); break;
|
case ARRAY_PROCESS.loop : _index = safe_mod(l, array_length(_in)); break;
|
||||||
case ARRAY_PROCESS.hold : _index = min(l, array_length(_in) - 1); break;
|
case ARRAY_PROCESS.hold : _index = min(l, array_length(_in) - 1); break;
|
||||||
case ARRAY_PROCESS.expand : _index = floor(l / process_length[i][1]) % process_length[i][0]; break;
|
case ARRAY_PROCESS.expand : _index = floor(l / process_length[i][1]) % process_length[i][0]; break;
|
||||||
|
@ -184,7 +184,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
|
|
||||||
inputs_data[i] = val;
|
inputs_data[i] = val;
|
||||||
|
|
||||||
switch(attributes[? "array_process"]) {
|
switch(attributes.array_process) {
|
||||||
case ARRAY_PROCESS.loop :
|
case ARRAY_PROCESS.loop :
|
||||||
case ARRAY_PROCESS.hold :
|
case ARRAY_PROCESS.hold :
|
||||||
process_amount = max(process_amount, amo);
|
process_amount = max(process_amount, amo);
|
||||||
|
@ -218,10 +218,10 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
}
|
}
|
||||||
|
|
||||||
static processSerialize = function(_map) {
|
static processSerialize = function(_map) {
|
||||||
_map[? "array_process"] = attributes[? "array_process"];
|
_map.array_process = attributes.array_process;
|
||||||
}
|
}
|
||||||
|
|
||||||
static processDeserialize = function() {
|
static processDeserialize = function() {
|
||||||
attributes[? "array_process"] = ds_map_try_get(load_map, "array_process", ARRAY_PROCESS.loop);
|
attributes.array_process = struct_try_get(load_map, "array_process", ARRAY_PROCESS.loop);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -605,18 +605,12 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
||||||
|
|
||||||
#region node function
|
#region node function
|
||||||
function nodeLoad(_data, scale = false, _group = PANEL_GRAPH.getCurrentContext()) {
|
function nodeLoad(_data, scale = false, _group = PANEL_GRAPH.getCurrentContext()) {
|
||||||
if(!ds_exists(_data, ds_type_map)) return noone;
|
var _x = _data.x;
|
||||||
|
var _y = _data.y;
|
||||||
var _x = ds_map_try_get(_data, "x", 0);
|
var _type = _data.type;
|
||||||
var _y = ds_map_try_get(_data, "y", 0);
|
|
||||||
var _type = ds_map_try_get(_data, "type", 0);
|
|
||||||
|
|
||||||
var _node = nodeBuild(_type, _x, _y, _group);
|
var _node = nodeBuild(_type, _x, _y, _group);
|
||||||
|
if(_node) _node.deserialize(_data, scale);
|
||||||
if(_node) {
|
|
||||||
var map = ds_map_clone(_data);
|
|
||||||
_node.deserialize(map, scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _node;
|
return _node;
|
||||||
}
|
}
|
||||||
|
@ -767,44 +761,44 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
||||||
|
|
||||||
function attribute_surface_depth(label = true) {
|
function attribute_surface_depth(label = true) {
|
||||||
depth_array = inputs[| 0].type == VALUE_TYPE.surface? global.SURFACE_FORMAT_NAME_PROCESS : global.SURFACE_FORMAT_NAME;
|
depth_array = inputs[| 0].type == VALUE_TYPE.surface? global.SURFACE_FORMAT_NAME_PROCESS : global.SURFACE_FORMAT_NAME;
|
||||||
attributes[? "color_depth"] = array_find(depth_array, "8 bit RGBA");
|
attributes.color_depth = array_find(depth_array, "8 bit RGBA");
|
||||||
|
|
||||||
if(label) array_push(attributeEditors, "Surface");
|
if(label) array_push(attributeEditors, "Surface");
|
||||||
array_push(attributeEditors, ["Color depth", "color_depth",
|
array_push(attributeEditors, ["Color depth", "color_depth",
|
||||||
new scrollBox(depth_array, function(val) {
|
new scrollBox(depth_array, function(val) {
|
||||||
attributes[? "color_depth"] = val;
|
attributes.color_depth = val;
|
||||||
triggerRender();
|
triggerRender();
|
||||||
}, false)]);
|
}, false)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function attribute_interpolation(label = false) {
|
function attribute_interpolation(label = false) {
|
||||||
attributes[? "interpolation"] = 0;
|
attributes.interpolation = 0;
|
||||||
|
|
||||||
if(label) array_push(attributeEditors, "Surface");
|
if(label) array_push(attributeEditors, "Surface");
|
||||||
array_push(attributeEditors, ["Texture interpolation", "interpolation",
|
array_push(attributeEditors, ["Texture interpolation", "interpolation",
|
||||||
new scrollBox(global.SURFACE_INTERPOLATION, function(val) {
|
new scrollBox(global.SURFACE_INTERPOLATION, function(val) {
|
||||||
attributes[? "interpolation"] = val;
|
attributes.interpolation = val;
|
||||||
triggerRender();
|
triggerRender();
|
||||||
}, false)]);
|
}, false)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function attribute_oversample(label = false) {
|
function attribute_oversample(label = false) {
|
||||||
attributes[? "oversample"] = 0;
|
attributes.oversample = 0;
|
||||||
|
|
||||||
if(label) array_push(attributeEditors, "Surface");
|
if(label) array_push(attributeEditors, "Surface");
|
||||||
array_push(attributeEditors, ["Oversample", "oversample",
|
array_push(attributeEditors, ["Oversample", "oversample",
|
||||||
new scrollBox(global.SURFACE_OVERSAMPLE, function(val) {
|
new scrollBox(global.SURFACE_OVERSAMPLE, function(val) {
|
||||||
attributes[? "oversample"] = val;
|
attributes.oversample = val;
|
||||||
triggerRender();
|
triggerRender();
|
||||||
}, false)]);
|
}, false)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function attribute_auto_execute(label = false) {
|
function attribute_auto_execute(label = false) {
|
||||||
attributes[? "auto_exe"] = false;
|
attributes.auto_exe = false;
|
||||||
if(label) array_push(attributeEditors, "Node");
|
if(label) array_push(attributeEditors, "Node");
|
||||||
array_push(attributeEditors, ["Auto execute", "auto_exe",
|
array_push(attributeEditors, ["Auto execute", "auto_exe",
|
||||||
new checkBox(function() {
|
new checkBox(function() {
|
||||||
attributes[? "auto_exe"] = !attributes[? "auto_exe"];
|
attributes.auto_exe = !attributes.auto_exe;
|
||||||
})]);
|
})]);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
|
@ -8,7 +8,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
min_h = 96;
|
min_h = 96;
|
||||||
|
|
||||||
object = [];
|
object = [];
|
||||||
attributes[? "mesh"] = [];
|
attributes.mesh = [];
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Affect by force", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
|
inputs[| 0] = nodeValue("Affect by force", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
@ -62,12 +62,12 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
];
|
];
|
||||||
|
|
||||||
static newMesh = function(index) {
|
static newMesh = function(index) {
|
||||||
var mesh = ds_map_try_get(attributes, "mesh", []);
|
var mesh = struct_try_get(attributes, "mesh", []);
|
||||||
mesh[index] = [ [ 0, 0],
|
mesh[index] = [ [ 0, 0],
|
||||||
[32, 0],
|
[32, 0],
|
||||||
[32, 32],
|
[32, 32],
|
||||||
[ 0, 32] ];
|
[ 0, 32] ];
|
||||||
attributes[? "mesh"] = mesh;
|
attributes.mesh = mesh;
|
||||||
}
|
}
|
||||||
newMesh(0);
|
newMesh(0);
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
var _shp = inputs[| 5].getValue();
|
var _shp = inputs[| 5].getValue();
|
||||||
var _box = inputs[| 7].getValue();
|
var _box = inputs[| 7].getValue();
|
||||||
|
|
||||||
var meshes = attributes[? "mesh"];
|
var meshes = attributes.mesh;
|
||||||
if(preview_index >= array_length(meshes)) return;
|
if(preview_index >= array_length(meshes)) return;
|
||||||
|
|
||||||
if(previewing == 0) {
|
if(previewing == 0) {
|
||||||
|
@ -260,7 +260,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
|
|
||||||
if(!is_surface(_tex)) return;
|
if(!is_surface(_tex)) return;
|
||||||
|
|
||||||
var meshes = attributes[? "mesh"];
|
var meshes = attributes.mesh;
|
||||||
var mesh = [];
|
var mesh = [];
|
||||||
|
|
||||||
var ww = surface_get_width(_tex);
|
var ww = surface_get_width(_tex);
|
||||||
|
@ -368,7 +368,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
buffer_delete(surface_buffer);
|
buffer_delete(surface_buffer);
|
||||||
|
|
||||||
meshes[index] = mesh;
|
meshes[index] = mesh;
|
||||||
attributes[? "mesh"] = meshes;
|
attributes.mesh = meshes;
|
||||||
}
|
}
|
||||||
|
|
||||||
static removeColinear = function(mesh) {
|
static removeColinear = function(mesh) {
|
||||||
|
@ -541,7 +541,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
physics_fixture_set_circle_shape(fixture, min(_spos[2], _spos[3]));
|
physics_fixture_set_circle_shape(fixture, min(_spos[2], _spos[3]));
|
||||||
fixtureCreate(fixture, object);
|
fixtureCreate(fixture, object);
|
||||||
} else if(_shp == 2) {
|
} else if(_shp == 2) {
|
||||||
var meshes = attributes[? "mesh"];
|
var meshes = attributes.mesh;
|
||||||
if(array_safe_get(meshes, index, noone) == noone)
|
if(array_safe_get(meshes, index, noone) == noone)
|
||||||
return noone;
|
return noone;
|
||||||
|
|
||||||
|
@ -652,7 +652,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
var _tex = inputs[| 6].getValue();
|
var _tex = inputs[| 6].getValue();
|
||||||
|
|
||||||
if(is_array(_tex)) {
|
if(is_array(_tex)) {
|
||||||
var meshes = attributes[? "mesh"];
|
var meshes = attributes.mesh;
|
||||||
|
|
||||||
for( var i = array_length(meshes); i < array_length(_tex); i++ )
|
for( var i = array_length(meshes); i < array_length(_tex); i++ )
|
||||||
newMesh(i);
|
newMesh(i);
|
||||||
|
@ -687,16 +687,16 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() {
|
||||||
var att = ds_map_create();
|
var att = {};
|
||||||
|
|
||||||
var mesh = ds_map_try_get(attributes, "mesh", []);
|
var mesh = struct_try_get(attributes, "mesh", []);
|
||||||
att[? "mesh"] = json_stringify(mesh);
|
att.mesh = json_stringify(mesh);
|
||||||
|
|
||||||
return att;
|
return att;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
if(ds_map_exists(attr, "mesh"))
|
if(struct_has(attr, "mesh"))
|
||||||
attributes[? "mesh"] = json_parse(attr[? "mesh"]);
|
attributes.mesh = json_parse(attr.mesh);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -119,9 +119,9 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -35,10 +35,10 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
surface_w = 1;
|
surface_w = 1;
|
||||||
surface_h = 1;
|
surface_h = 1;
|
||||||
|
|
||||||
attributes[? "max_shape"] = 32;
|
attributes.max_shape = 32;
|
||||||
array_push(attributeEditors, ["Maximum shapes", "max_shape",
|
array_push(attributeEditors, ["Maximum shapes", "max_shape",
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||||
attributes[? "max_shape"] = val;
|
attributes.max_shape = val;
|
||||||
triggerRender();
|
triggerRender();
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
static onInspector1Update = function() { separateShape(); }
|
static onInspector1Update = function() { separateShape(); }
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
if(attributes[? "auto_exe"])
|
if(attributes.auto_exe)
|
||||||
separateShape();
|
separateShape();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,16 +111,16 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
|
|
||||||
shader_reset();
|
shader_reset();
|
||||||
|
|
||||||
var _pixel_surface = surface_create_valid(attributes[? "max_shape"], 1);
|
var _pixel_surface = surface_create_valid(attributes.max_shape, 1);
|
||||||
surface_set_target(_pixel_surface);
|
surface_set_target(_pixel_surface);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
BLEND_OVERRIDE;
|
BLEND_OVERRIDE;
|
||||||
shader_set(sh_seperate_shape_counter);
|
shader_set(sh_seperate_shape_counter);
|
||||||
texture_set_stage(shader_get_sampler_index(sh_seperate_shape_counter, "surface"), surface_get_texture(temp_surface[res_index]));
|
texture_set_stage(shader_get_sampler_index(sh_seperate_shape_counter, "surface"), surface_get_texture(temp_surface[res_index]));
|
||||||
shader_set_uniform_f_array_safe(shader_get_uniform(sh_seperate_shape_counter, "dimension"), [ ww, hh ]);
|
shader_set_uniform_f_array_safe(shader_get_uniform(sh_seperate_shape_counter, "dimension"), [ ww, hh ]);
|
||||||
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_counter, "maxShape"), attributes[? "max_shape"]);
|
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_counter, "maxShape"), attributes.max_shape);
|
||||||
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_counter, "ignore"), _ignore);
|
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_counter, "ignore"), _ignore);
|
||||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, attributes[? "max_shape"], 1, 0, c_white, 1);
|
draw_sprite_ext(s_fx_pixel, 0, 0, 0, attributes.max_shape, 1, 0, c_white, 1);
|
||||||
shader_reset();
|
shader_reset();
|
||||||
BLEND_NORMAL;
|
BLEND_NORMAL;
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
|
@ -2,16 +2,18 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
name = "Array to Anim";
|
name = "Array to Anim";
|
||||||
update_on_frame = true;
|
update_on_frame = true;
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0)
|
||||||
|
.setArrayDepth(1);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
inputs[| 1] = nodeValue("Speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
|
||||||
inputs[| 2] = nodeValue("Sequence", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [])
|
inputs[| 2] = nodeValue("Sequence", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [])
|
||||||
|
.setVisible(true, true)
|
||||||
.setArrayDepth(1);
|
.setArrayDepth(1);
|
||||||
|
|
||||||
inputs[| 3] = nodeValue("Overflow", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 3] = nodeValue("Overflow", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Hold", "Loop", "Empty" ]);
|
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Hold", "Loop", "Ping Pong", "Empty" ]);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
|
@ -21,7 +23,13 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
var _ord = inputs[| 2].getValue();
|
var _ord = inputs[| 2].getValue();
|
||||||
var _h = ui(64);
|
var _h = ui(64);
|
||||||
|
|
||||||
if(_hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h)) {
|
if(array_length(_ord) == 0) {
|
||||||
|
_ord = array_create(array_length(_seq));
|
||||||
|
for( var i = 0; i < array_length(_seq); i++ )
|
||||||
|
_ord[i] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
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, mouse_click(mb_left, _focus)? 2 : 1, _x, _y, _w, _h);
|
draw_sprite_stretched(THEME.button, mouse_click(mb_left, _focus)? 2 : 1, _x, _y, _w, _h);
|
||||||
if(mouse_press(mb_left, _focus))
|
if(mouse_press(mb_left, _focus))
|
||||||
dialogPanelCall(new Panel_Array_Sequence(self));
|
dialogPanelCall(new Panel_Array_Sequence(self));
|
||||||
|
@ -71,41 +79,50 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
});
|
});
|
||||||
|
|
||||||
input_display_list = [ 0,
|
input_display_list = [ 0,
|
||||||
["Frames", false], sequence_renderer, 3,
|
["Frames", false], sequence_renderer, 2, 3,
|
||||||
["Animation", false], 1,
|
["Animation", false], 1,
|
||||||
];
|
];
|
||||||
|
|
||||||
static update = function(frame = ANIMATOR.current_frame) {
|
static update = function(frame = ANIMATOR.current_frame) {
|
||||||
var _seq = inputs[| 0].getValue();
|
var _sur = inputs[| 0].getValue();
|
||||||
var _spd = inputs[| 1].getValue();
|
if(!is_array(_sur)) {
|
||||||
var _ord = inputs[| 2].getValue();
|
outputs[| 0].setValue(_sur);
|
||||||
var _ovf = inputs[| 3].getValue();
|
|
||||||
|
|
||||||
if(!is_array(_seq)) {
|
|
||||||
outputs[| 0].setValue(_seq);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _spd = inputs[| 1].getValue();
|
||||||
|
var _seq = inputs[| 2].getValue();
|
||||||
|
var _ovf = inputs[| 3].getValue();
|
||||||
|
|
||||||
var frm = floor(ANIMATOR.current_frame / _spd);
|
var frm = floor(ANIMATOR.current_frame / _spd);
|
||||||
var ind = frm;
|
var ind = frm;
|
||||||
|
|
||||||
if(array_length(_ord) > 0) {
|
if(array_length(_seq) == 0) {
|
||||||
|
_seq = array_create(array_length(_sur));
|
||||||
|
for( var i = 0; i < array_length(_sur); i++ )
|
||||||
|
_seq[i] = i;
|
||||||
|
}
|
||||||
|
|
||||||
if(_ovf == 0)
|
if(_ovf == 0)
|
||||||
ind = clamp(ind, 0, array_length(_ord) - 1);
|
ind = clamp(ind, 0, array_length(_seq) - 1);
|
||||||
else if(_ovf == 2 && ind >= array_length(_ord)) {
|
else if(_ovf == 2) {
|
||||||
|
var _slen = array_length(_seq);
|
||||||
|
var _slpp = _slen * 2 - 2;
|
||||||
|
ind = abs(ind % _slpp);
|
||||||
|
if(ind >= _slen)
|
||||||
|
ind = _slpp - ind;
|
||||||
|
} else if(_ovf == 3 && ind >= array_length(_seq)) {
|
||||||
outputs[| 0].setValue(noone);
|
outputs[| 0].setValue(noone);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ind = array_safe_get(_ord, ind,, ARRAY_OVERFLOW.loop);
|
ind = array_safe_get(_seq, ind,, ARRAY_OVERFLOW.loop);
|
||||||
} else
|
|
||||||
ind = safe_mod(floor(ANIMATOR.current_frame / _spd), array_length(_seq));
|
|
||||||
|
|
||||||
if(ind == noone) {
|
if(ind == noone) {
|
||||||
outputs[| 0].setValue(noone);
|
outputs[| 0].setValue(noone);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
outputs[| 0].setValue(array_safe_get(_seq, ind));
|
outputs[| 0].setValue(array_safe_get(_sur, ind));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -61,7 +61,7 @@ function Node_Skew(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
var _amou = _data[2];
|
var _amou = _data[2];
|
||||||
//var _wrap = _data[3];
|
//var _wrap = _data[3];
|
||||||
var _cent = _data[4];
|
var _cent = _data[4];
|
||||||
var _samp = ds_map_try_get(attributes, "oversample");
|
var _samp = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
surface_set_shader(_outSurf, shader);
|
surface_set_shader(_outSurf, shader);
|
||||||
shader_set_interpolation(_data[0]);
|
shader_set_interpolation(_data[0]);
|
||||||
|
|
|
@ -144,9 +144,9 @@ function Node_Stack(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,9 +175,9 @@ function Node_Statistic(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
|
|
||||||
inputs[| 15] = nodeValue("Bake hair", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0, "Prevent strand reseting to apply manual modification. Unbaking will remove all changes.")
|
inputs[| 15] = nodeValue("Bake hair", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0, "Prevent strand reseting to apply manual modification. Unbaking will remove all changes.")
|
||||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||||
attributes[? "use_groom"] = !attributes[? "use_groom"];
|
attributes.use_groom = !attributes.use_groom;
|
||||||
if(attributes[? "use_groom"])
|
if(attributes.use_groom)
|
||||||
groomed = strands.clone();
|
groomed = strands.clone();
|
||||||
strandUpdate(true);
|
strandUpdate(true);
|
||||||
}, "Bake" ]);
|
}, "Bake" ]);
|
||||||
|
@ -66,7 +66,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
["Preview", true], 16,
|
["Preview", true], 16,
|
||||||
];
|
];
|
||||||
|
|
||||||
attributes[? "use_groom"] = false;
|
attributes.use_groom = false;
|
||||||
groomed = new StrandMesh();
|
groomed = new StrandMesh();
|
||||||
strands = new StrandMesh();
|
strands = new StrandMesh();
|
||||||
|
|
||||||
|
@ -118,10 +118,10 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
var _typ = inputs[| 0].getValue();
|
var _typ = inputs[| 0].getValue();
|
||||||
var _pre = inputs[| 16].getValue();
|
var _pre = inputs[| 16].getValue();
|
||||||
if(!attributes[? "use_groom"])
|
if(!attributes.use_groom)
|
||||||
strands.draw(_x, _y, _s, _pre);
|
strands.draw(_x, _y, _s, _pre);
|
||||||
|
|
||||||
tools = attributes[? "use_groom"]? groomTools : -1;
|
tools = attributes.use_groom? groomTools : -1;
|
||||||
|
|
||||||
if(_typ == 0) {
|
if(_typ == 0) {
|
||||||
if(tool_dragging == noone)
|
if(tool_dragging == noone)
|
||||||
|
@ -154,7 +154,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
_msh.draw(_x, _y, _s);
|
_msh.draw(_x, _y, _s);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!attributes[? "use_groom"]) return;
|
if(!attributes.use_groom) return;
|
||||||
groomed.draw(_x, _y, _s, _pre, true);
|
groomed.draw(_x, _y, _s, _pre, true);
|
||||||
|
|
||||||
var __mx = (_mx - _x) / _s;
|
var __mx = (_mx - _x) / _s;
|
||||||
|
@ -428,8 +428,8 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
inputs[| 13].setVisible(_typ == 2, _typ == 2);
|
inputs[| 13].setVisible(_typ == 2, _typ == 2);
|
||||||
inputs[| 14].setVisible(_typ != 2);
|
inputs[| 14].setVisible(_typ != 2);
|
||||||
|
|
||||||
inputs[| 15].editWidget.text = attributes[? "use_groom"]? "Unbake" : "Bake";
|
inputs[| 15].editWidget.text = attributes.use_groom? "Unbake" : "Bake";
|
||||||
inputs[| 15].editWidget.blend = attributes[? "use_groom"]? COLORS._main_value_negative : COLORS._main_value_positive;
|
inputs[| 15].editWidget.blend = attributes.use_groom? COLORS._main_value_negative : COLORS._main_value_positive;
|
||||||
}
|
}
|
||||||
|
|
||||||
static strandUpdate = function(willReset = false) {
|
static strandUpdate = function(willReset = false) {
|
||||||
|
@ -452,7 +452,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
var sx, sy, prog, dir;
|
var sx, sy, prog, dir;
|
||||||
|
|
||||||
if(willReset) {
|
if(willReset) {
|
||||||
if(attributes[? "use_groom"]) {
|
if(attributes.use_groom) {
|
||||||
strands = groomed.clone();
|
strands = groomed.clone();
|
||||||
outputs[| 0].setValue(strands);
|
outputs[| 0].setValue(strands);
|
||||||
return;
|
return;
|
||||||
|
@ -543,16 +543,16 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() {
|
||||||
var att = ds_map_create();
|
var att = {};
|
||||||
att[? "use_groom"] = attributes[? "use_groom"];
|
att.use_groom = attributes.use_groom;
|
||||||
att[? "fixStrand"] = groomed.serialize();
|
att.fixStrand = groomed.serialize();
|
||||||
return att;
|
return att;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
if(ds_map_exists(attr, "fixStrand"))
|
if(struct_has(attr, "fixStrand"))
|
||||||
groomed.deserialize(attr[? "fixStrand"]);
|
groomed.deserialize(attr.fixStrand);
|
||||||
|
|
||||||
attributes[? "use_groom"] = ds_map_try_get(attr, "use_groom", false);
|
attributes.use_groom = struct_try_get(attr, "use_groom", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -68,8 +68,9 @@ function Node_Struct(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) {
|
for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) {
|
||||||
var key = inputs[| i + 0].getValue();
|
var key = inputs[| i + 0].getValue();
|
||||||
var val = inputs[| i + 1].getValue();
|
var val = inputs[| i + 1].getValue();
|
||||||
|
var frm = inputs[| i + 1].value_from;
|
||||||
|
|
||||||
if(inputs[| i + 1].type == VALUE_TYPE.surface)
|
if(frm != noone && frm.type == VALUE_TYPE.surface)
|
||||||
str[$ key] = new Surface(val);
|
str[$ key] = new Surface(val);
|
||||||
else
|
else
|
||||||
str[$ key] = val;
|
str[$ key] = val;
|
||||||
|
@ -93,9 +94,9 @@ function Node_Struct(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,9 +127,9 @@ function Node_Switch(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
for(var i = input_fix_len; i < array_length(_inputs); i += data_length)
|
||||||
createNewInput();
|
createNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
inputs[| 6] = nodeValue("Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
inputs[| 6] = nodeValue("Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||||
.setDisplay(VALUE_DISPLAY.vector);
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
inputs[| 7] = nodeValue("Tile", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Repeat the surface to fill the screen.");
|
inputs[| 7] = nodeValue("Render Mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
|
.setDisplay(VALUE_DISPLAY.enum_button, [ "Normal", "Tile", "Wrap" ]);
|
||||||
|
|
||||||
inputs[| 8] = nodeValue("Rotate by velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0, "Make the surface rotates to follow its movement.")
|
inputs[| 8] = nodeValue("Rotate by velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0, "Make the surface rotates to follow its movement.")
|
||||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||||
|
@ -140,7 +141,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
var rot = _data[5] + rot_vel;
|
var rot = _data[5] + rot_vel;
|
||||||
|
|
||||||
var sca = _data[6];
|
var sca = _data[6];
|
||||||
var wrp = _data[7];
|
var mode = _data[7];
|
||||||
|
|
||||||
var cDep = attrDepth();
|
var cDep = attrDepth();
|
||||||
|
|
||||||
|
@ -180,7 +181,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
pos = point_rotate(pos[0], pos[1], pos[0] + anc[0], pos[1] + anc[1], rot);
|
pos = point_rotate(pos[0], pos[1], pos[0] + anc[0], pos[1] + anc[1], rot);
|
||||||
|
|
||||||
if(wrp) {
|
if(mode == 1) {
|
||||||
var _w = _ww * sqrt(2);
|
var _w = _ww * sqrt(2);
|
||||||
var _h = _hh * sqrt(2);
|
var _h = _hh * sqrt(2);
|
||||||
var _px = (_w - _ww) / 2;
|
var _px = (_w - _ww) / 2;
|
||||||
|
@ -226,6 +227,19 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
surface_set_shader(_outSurf);
|
surface_set_shader(_outSurf);
|
||||||
shader_set_interpolation(ins);
|
shader_set_interpolation(ins);
|
||||||
draw_surface_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], rot, c_white, 1);
|
draw_surface_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
|
||||||
|
if(mode == 2) {
|
||||||
|
draw_surface_ext_safe(ins, draw_x - _ww, draw_y - _hh, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
draw_surface_ext_safe(ins, draw_x, draw_y - _hh, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
draw_surface_ext_safe(ins, draw_x + _ww, draw_y - _hh, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
|
||||||
|
draw_surface_ext_safe(ins, draw_x - _ww, draw_y, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
draw_surface_ext_safe(ins, draw_x + _ww, draw_y, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
|
||||||
|
draw_surface_ext_safe(ins, draw_x - _ww, draw_y + _hh, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
draw_surface_ext_safe(ins, draw_x, draw_y + _hh, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
draw_surface_ext_safe(ins, draw_x + _ww, draw_y + _hh, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
}
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ function Node_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
insp2UpdateTooltip = "Trigger";
|
insp2UpdateTooltip = "Trigger";
|
||||||
insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
doTrigger = false;
|
doTrigger = 0;
|
||||||
|
|
||||||
static onInspector2Update = function() {
|
static onInspector2Update = function() {
|
||||||
inputs[| 0].setAnim(true);
|
inputs[| 0].setAnim(true);
|
||||||
|
@ -26,16 +26,18 @@ function Node_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
function step() {
|
function step() {
|
||||||
if(doTrigger) {
|
if(doTrigger == 1) {
|
||||||
outputs[| 0].setValue(true);
|
outputs[| 0].setValue(true);
|
||||||
doTrigger = false;
|
doTrigger = -1;
|
||||||
} else
|
} else if(doTrigger == -1) {
|
||||||
outputs[| 0].setValue(false);
|
outputs[| 0].setValue(false);
|
||||||
|
doTrigger = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
var trg = inputs[| 0].getValue();
|
var trg = inputs[| 0].getValue();
|
||||||
if(trg) doTrigger = true;
|
if(trg) doTrigger = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||||
|
|
|
@ -16,29 +16,30 @@ function Node_Trigger_Bool(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
prevVal = false;
|
prevVal = false;
|
||||||
preview = false;
|
preview = false;
|
||||||
|
|
||||||
|
doTrigger = 0;
|
||||||
|
|
||||||
|
function step() {
|
||||||
|
if(doTrigger == 1) {
|
||||||
|
outputs[| 0].setValue(true);
|
||||||
|
doTrigger = -1;
|
||||||
|
} else if(doTrigger == -1) {
|
||||||
|
outputs[| 0].setValue(false);
|
||||||
|
doTrigger = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
var val = inputs[| 0].getValue();
|
var val = inputs[| 0].getValue();
|
||||||
var con = inputs[| 1].getValue();
|
var con = inputs[| 1].getValue();
|
||||||
|
|
||||||
switch(con) {
|
switch(con) {
|
||||||
case 0 :
|
case 0 : doTrigger = val; break;
|
||||||
outputs[| 0].setValue(val);
|
case 1 : doTrigger = !prevVal && val; break;
|
||||||
preview = val;
|
case 2 : doTrigger = prevVal && !val; break;
|
||||||
break;
|
case 3 : doTrigger = prevVal != val; break;
|
||||||
case 1 :
|
|
||||||
outputs[| 0].setValue(!prevVal && val);
|
|
||||||
preview = !prevVal && val;
|
|
||||||
break;
|
|
||||||
case 2 :
|
|
||||||
outputs[| 0].setValue( prevVal && !val);
|
|
||||||
preview = prevVal && !val;
|
|
||||||
break;
|
|
||||||
case 3 :
|
|
||||||
outputs[| 0].setValue( prevVal != val);
|
|
||||||
preview = prevVal != val;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
preview = doTrigger;
|
||||||
prevVal = val;
|
prevVal = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ function Node_Twirl(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
var center = _data[1];
|
var center = _data[1];
|
||||||
var stren = _data[2];
|
var stren = _data[2];
|
||||||
var rad = _data[3];
|
var rad = _data[3];
|
||||||
var sam = ds_map_try_get(attributes, "oversample");
|
var sam = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
surface_set_shader(_outSurf, shader);
|
surface_set_shader(_outSurf, shader);
|
||||||
shader_set_interpolation(_data[0]);
|
shader_set_interpolation(_data[0]);
|
||||||
|
|
|
@ -352,7 +352,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
type = _type;
|
type = _type;
|
||||||
forward = true;
|
forward = true;
|
||||||
|
|
||||||
|
_initName = _name;
|
||||||
name = __txt_junction_name(instanceof(node), type, index, _name);
|
name = __txt_junction_name(instanceof(node), type, index, _name);
|
||||||
|
name = _name;
|
||||||
internalName = string_replace_all(_name, " ", "_");
|
internalName = string_replace_all(_name, " ", "_");
|
||||||
|
|
||||||
if(struct_has(node, "inputMap")) {
|
if(struct_has(node, "inputMap")) {
|
||||||
|
@ -386,7 +388,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
def_val = _value;
|
def_val = _value;
|
||||||
on_end = KEYFRAME_END.hold;
|
on_end = KEYFRAME_END.hold;
|
||||||
unit = new nodeValueUnit(self);
|
unit = new nodeValueUnit(self);
|
||||||
extra_data = ds_list_create();
|
extra_data = [];
|
||||||
dyna_depo = ds_list_create();
|
dyna_depo = ds_list_create();
|
||||||
|
|
||||||
draw_line_shift_x = 0;
|
draw_line_shift_x = 0;
|
||||||
|
@ -667,7 +669,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
for( var i = 0; i < array_length(animators); i++ )
|
for( var i = 0; i < array_length(animators); i++ )
|
||||||
animators[i].suffix = " " + array_safe_get(global.displaySuffix_Area, i, "");
|
animators[i].suffix = " " + array_safe_get(global.displaySuffix_Area, i, "");
|
||||||
|
|
||||||
extra_data[| 0] = AREA_MODE.area;
|
extra_data[0] = AREA_MODE.area;
|
||||||
extract_node = "Node_Area";
|
extract_node = "Node_Area";
|
||||||
break;
|
break;
|
||||||
case VALUE_DISPLAY.padding :
|
case VALUE_DISPLAY.padding :
|
||||||
|
@ -925,7 +927,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
}
|
}
|
||||||
|
|
||||||
if(display_type == VALUE_DISPLAY.area) {
|
if(display_type == VALUE_DISPLAY.area) {
|
||||||
var dispType = ds_list_get(nodeFrom.extra_data, 0);
|
var dispType = nodeFrom.extra_data[0];
|
||||||
var surfGet = nodeFrom.display_data;
|
var surfGet = nodeFrom.display_data;
|
||||||
if(!applyUnit || surfGet == -1) return value;
|
if(!applyUnit || surfGet == -1) return value;
|
||||||
|
|
||||||
|
@ -986,6 +988,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
}
|
}
|
||||||
|
|
||||||
static getValue = function(_time = ANIMATOR.current_frame, applyUnit = true, arrIndex = 0, useCache = true) {
|
static getValue = function(_time = ANIMATOR.current_frame, applyUnit = true, arrIndex = 0, useCache = true) {
|
||||||
|
if(type == VALUE_TYPE.trigger)
|
||||||
|
useCache = false;
|
||||||
|
|
||||||
if(useCache) {
|
if(useCache) {
|
||||||
var cache_hit = cache_value[0];
|
var cache_hit = cache_value[0];
|
||||||
cache_hit &= cache_value[1] == _time;
|
cache_hit &= cache_value[1] == _time;
|
||||||
|
@ -1070,6 +1075,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
static getValueRecursive = function(_time = ANIMATOR.current_frame) {
|
static getValueRecursive = function(_time = ANIMATOR.current_frame) {
|
||||||
var val = [ -1, self ];
|
var val = [ -1, self ];
|
||||||
|
|
||||||
|
if(type == VALUE_TYPE.trigger && connect_type == JUNCTION_CONNECT.output) //trigger even will not propagate from input to output, need to be done manually
|
||||||
|
return [ __getAnimValue(_time), self ];
|
||||||
|
|
||||||
if(value_from == noone) {
|
if(value_from == noone) {
|
||||||
var _val = __getAnimValue(_time);
|
var _val = __getAnimValue(_time);
|
||||||
val = [ _val, self ];
|
val = [ _val, self ];
|
||||||
|
@ -1593,32 +1601,31 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
}
|
}
|
||||||
|
|
||||||
static serialize = function(scale = false, preset = false) {
|
static serialize = function(scale = false, preset = false) {
|
||||||
var _map = ds_map_create();
|
var _map = {};
|
||||||
|
|
||||||
_map[? "visible"] = visible;
|
_map.visible = visible;
|
||||||
|
|
||||||
if(connect_type == JUNCTION_CONNECT.output)
|
if(connect_type == JUNCTION_CONNECT.output)
|
||||||
return _map;
|
return _map;
|
||||||
|
|
||||||
_map[? "on end"] = on_end;
|
_map.on_end = on_end;
|
||||||
_map[? "unit"] = unit.mode;
|
_map.unit = unit.mode;
|
||||||
_map[? "sep_axis"] = sep_axis;
|
_map.sep_axis = sep_axis;
|
||||||
_map[? "shift x"] = draw_line_shift_x;
|
_map.shift_x = draw_line_shift_x;
|
||||||
_map[? "shift y"] = draw_line_shift_y;
|
_map.shift_y = draw_line_shift_y;
|
||||||
_map[? "from node"] = !preset && value_from? value_from.node.node_id : -1;
|
_map.from_node = !preset && value_from? value_from.node.node_id : -1;
|
||||||
_map[? "from index"] = !preset && value_from? value_from.index : -1;
|
_map.from_index = !preset && value_from? value_from.index : -1;
|
||||||
_map[? "global_use"] = expUse;
|
_map.global_use = expUse;
|
||||||
_map[? "global_key"] = expression;
|
_map.global_key = expression;
|
||||||
_map[? "anim"] = is_anim;
|
_map.anim = is_anim;
|
||||||
|
|
||||||
ds_map_add_list(_map, "raw value", animator.serialize(scale));
|
_map.raw_value = animator.serialize(scale);
|
||||||
|
|
||||||
var _anims = ds_list_create();
|
var _anims = [];
|
||||||
for( var i = 0; i < array_length(animators); i++ )
|
for( var i = 0; i < array_length(animators); i++ )
|
||||||
ds_list_add_list(_anims, animators[i].serialize(scale));
|
array_push(_anims, animators[i].serialize(scale));
|
||||||
ds_map_add_list(_map, "animators", _anims);
|
_map.animators = _anims;
|
||||||
|
_map.data = extra_data;
|
||||||
ds_map_add_list(_map, "data", ds_list_clone(extra_data));
|
|
||||||
|
|
||||||
return _map;
|
return _map;
|
||||||
}
|
}
|
||||||
|
@ -1630,38 +1637,38 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
if(_map == undefined) return;
|
if(_map == undefined) return;
|
||||||
if(_map == noone) return;
|
if(_map == noone) return;
|
||||||
|
|
||||||
visible = ds_map_try_get(_map, "visible", visible);
|
visible = _map.visible;
|
||||||
if(connect_type == JUNCTION_CONNECT.output)
|
if(connect_type == JUNCTION_CONNECT.output)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//printIf(TESTING, " |- Applying deserialize to junction " + name + " of node " + node.name);
|
//printIf(TESTING, " |- Applying deserialize to junction " + name + " of node " + node.name);
|
||||||
on_end = ds_map_try_get(_map, "on end", on_end);
|
on_end = struct_try_get(_map, "on_end");
|
||||||
unit.mode = ds_map_try_get(_map, "unit", VALUE_UNIT.constant);
|
unit.mode = struct_try_get(_map, "unit");
|
||||||
expUse = ds_map_try_get(_map, "global_use");
|
expUse = struct_try_get(_map, "global_use");
|
||||||
expression = ds_map_try_get(_map, "global_key");
|
expression = struct_try_get(_map, "global_key");
|
||||||
expTree = evaluateFunctionTree(expression);
|
expTree = evaluateFunctionTree(expression);
|
||||||
|
|
||||||
sep_axis = ds_map_try_get(_map, "sep_axis");
|
sep_axis = struct_try_get(_map, "sep_axis");
|
||||||
is_anim = ds_map_try_get(_map, "anim");
|
is_anim = struct_try_get(_map, "anim");
|
||||||
|
|
||||||
draw_line_shift_x = ds_map_try_get(_map, "shift x");
|
draw_line_shift_x = struct_try_get(_map, "shift_x");
|
||||||
draw_line_shift_y = ds_map_try_get(_map, "shift y");
|
draw_line_shift_y = struct_try_get(_map, "shift_y");
|
||||||
|
|
||||||
animator.deserialize(_map[? "raw value"], scale);
|
animator.deserialize(struct_try_get(_map, "raw_value"), scale);
|
||||||
|
|
||||||
if(ds_map_exists(_map, "animators")) {
|
if(struct_has(_map, "animators")) {
|
||||||
var anims = _map[? "animators"];
|
var anims = _map.animators;
|
||||||
for( var i = 0; i < ds_list_size(anims); i++ )
|
for( var i = 0; i < array_length(anims); i++ )
|
||||||
animators[i].deserialize(anims[| i], scale);
|
animators[i].deserialize(anims[i], scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!preset) {
|
if(!preset) {
|
||||||
con_node = _map[? "from node"];
|
con_node = struct_try_get(_map, "from_node", -1);
|
||||||
con_index = _map[? "from index"];
|
con_index = struct_try_get(_map, "from_index", -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ds_map_exists(_map, "data"))
|
if(struct_has(_map, "data"))
|
||||||
ds_list_copy(extra_data, _map[? "data"]);
|
extra_data = _map.data;
|
||||||
|
|
||||||
if(APPENDING) def_val = getValue(0);
|
if(APPENDING) def_val = getValue(0);
|
||||||
|
|
||||||
|
@ -1680,8 +1687,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ds_map_exists(NODE_MAP, _node)) {
|
if(!ds_map_exists(NODE_MAP, _node)) {
|
||||||
var txt = "Node connect error : Node ID " + string(_node) + " not found.";
|
var txt = $"Node connect error : Node ID {_node} not found.";
|
||||||
log_warning("LOAD", "[Connect] " + txt, node);
|
log_warning("LOAD", $"[Connect] {txt}", node);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1689,17 +1696,17 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
var _ol = ds_list_size(_nd.outputs);
|
var _ol = ds_list_size(_nd.outputs);
|
||||||
|
|
||||||
if(log)
|
if(log)
|
||||||
log_warning("LOAD", "[Connect] Reconnecting " + string(node.name) + " to " + _nd.name, node);
|
log_warning("LOAD", $"[Connect] Reconnecting {node.name} to {_nd.name}", node);
|
||||||
|
|
||||||
if(con_index < _ol) {
|
if(con_index < _ol) {
|
||||||
if(setFrom(_nd.outputs[| con_index], false))
|
if(setFrom(_nd.outputs[| con_index], false))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
log_warning("LOAD", "[Connect] Connection conflict " + string(node.name) + " to " + string(_nd.name) + " : Connection failed.", node);
|
log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Connection failed.", node);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_warning("LOAD", "[Connect] Connection conflict " + string(node.name) + " to " + string(_nd.name) + " : Node not exist.", node);
|
log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Node not exist.", node);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1712,7 +1719,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
|
|
||||||
static cleanUp = function() {
|
static cleanUp = function() {
|
||||||
ds_list_destroy(value_to);
|
ds_list_destroy(value_to);
|
||||||
ds_list_destroy(extra_data);
|
|
||||||
animator.cleanUp();
|
animator.cleanUp();
|
||||||
delete animator;
|
delete animator;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,19 +74,19 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
wav_file_prg = 0;
|
wav_file_prg = 0;
|
||||||
wav_file_lim = 1;
|
wav_file_lim = 1;
|
||||||
|
|
||||||
attributes[? "preview_shift"] = 0;
|
attributes.preview_shift = 0;
|
||||||
attributes[? "preview_gain"] = 0.5;
|
attributes.preview_gain = 0.5;
|
||||||
|
|
||||||
array_push(attributeEditors, "Audio Preview");
|
array_push(attributeEditors, "Audio Preview");
|
||||||
|
|
||||||
array_push(attributeEditors, ["Gain", "preview_gain",
|
array_push(attributeEditors, ["Gain", "preview_gain",
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||||
attributes[? "preview_gain"] = val;
|
attributes.preview_gain = val;
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
array_push(attributeEditors, ["Shift", "preview_shift",
|
array_push(attributeEditors, ["Shift", "preview_shift",
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||||
attributes[? "preview_shift"] = val;
|
attributes.preview_shift = val;
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
on_dragdrop_file = function(path) {
|
on_dragdrop_file = function(path) {
|
||||||
|
@ -184,7 +184,7 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
|
|
||||||
insp2UpdateTooltip = __txtx("play_with_timeline", "Play with timeline");
|
insp2UpdateTooltip = __txtx("play_with_timeline", "Play with timeline");
|
||||||
insp2UpdateIcon = [ THEME.play_sound, 1, COLORS._main_icon_light ];
|
insp2UpdateIcon = [ THEME.play_sound, 1, COLORS._main_icon_light ];
|
||||||
attributes[? "play"] = true;
|
attributes.play = true;
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
|
@ -194,7 +194,7 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
}
|
}
|
||||||
|
|
||||||
static onInspector2Update = function() {
|
static onInspector2Update = function() {
|
||||||
attributes[? "play"] = !attributes[? "play"];
|
attributes.play = !attributes.play;
|
||||||
}
|
}
|
||||||
|
|
||||||
static step = function() {
|
static step = function() {
|
||||||
|
@ -206,21 +206,21 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
UPDATE |= RENDER_TYPE.full;
|
UPDATE |= RENDER_TYPE.full;
|
||||||
}
|
}
|
||||||
|
|
||||||
insp2UpdateIcon[1] = attributes[? "play"];
|
insp2UpdateIcon[1] = attributes.play;
|
||||||
insp2UpdateIcon[2] = attributes[? "play"]? COLORS._main_icon_light : COLORS._main_icon;
|
insp2UpdateIcon[2] = attributes.play? COLORS._main_icon_light : COLORS._main_icon;
|
||||||
if(preview_audio == -1) return;
|
if(preview_audio == -1) return;
|
||||||
|
|
||||||
if(audio_is_playing(preview_audio) && !ANIMATOR.is_playing)
|
if(audio_is_playing(preview_audio) && !ANIMATOR.is_playing)
|
||||||
audio_stop_sound(preview_audio);
|
audio_stop_sound(preview_audio);
|
||||||
|
|
||||||
if(!attributes[? "play"]) return;
|
if(!attributes.play) return;
|
||||||
if(ANIMATOR.is_playing) {
|
if(ANIMATOR.is_playing) {
|
||||||
if(ANIMATOR.current_frame == 0)
|
if(ANIMATOR.current_frame == 0)
|
||||||
audio_stop_sound(preview_audio);
|
audio_stop_sound(preview_audio);
|
||||||
|
|
||||||
var dur = ANIMATOR.current_frame / ANIMATOR.framerate - attributes[? "preview_shift"];
|
var dur = ANIMATOR.current_frame / ANIMATOR.framerate - attributes.preview_shift;
|
||||||
if(!audio_is_playing(preview_audio))
|
if(!audio_is_playing(preview_audio))
|
||||||
audio_play_sound(preview_audio, 1, false, attributes[? "preview_gain"], dur);
|
audio_play_sound(preview_audio, 1, false, attributes.preview_gain, dur);
|
||||||
else if(ANIMATOR.frame_progress)
|
else if(ANIMATOR.frame_progress)
|
||||||
audio_sound_set_track_position(preview_audio, dur);
|
audio_sound_set_track_position(preview_audio, dur);
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
draw_surface_part_ext_safe(audio_surface, 0, 0, min(wd, sw), sh,
|
draw_surface_part_ext_safe(audio_surface, 0, 0, min(wd, sw), sh,
|
||||||
bbox.xc - sw * ss / 2,
|
bbox.xc - sw * ss / 2,
|
||||||
bbox.yc - sh * ss / 2,
|
bbox.yc - sh * ss / 2,
|
||||||
ss, ss,, attributes[? "play"]? COLORS._main_accent : c_white);
|
ss, ss,, attributes.play? COLORS._main_accent : c_white);
|
||||||
}
|
}
|
||||||
|
|
||||||
var str = filename_name(path_current);
|
var str = filename_name(path_current);
|
||||||
|
|
|
@ -43,7 +43,7 @@ function Node_Websocket_Receiver(_x, _y, _group = noone) : Node(_x, _y, _group)
|
||||||
setPort(_port);
|
setPort(_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
network_trigger = false;
|
network_trigger = 0;
|
||||||
function asyncPackets(_async_load) {
|
function asyncPackets(_async_load) {
|
||||||
var _active = inputs[| 1].getValue();
|
var _active = inputs[| 1].getValue();
|
||||||
if(!_active) return;
|
if(!_active) return;
|
||||||
|
@ -72,11 +72,13 @@ function Node_Websocket_Receiver(_x, _y, _group = noone) : Node(_x, _y, _group)
|
||||||
}
|
}
|
||||||
|
|
||||||
static step = function() {
|
static step = function() {
|
||||||
if(network_trigger) {
|
if(network_trigger == 1) {
|
||||||
outputs[| 1].setValue(1);
|
outputs[| 1].setValue(1);
|
||||||
network_trigger = false;
|
network_trigger = -1;
|
||||||
} else
|
} else if(network_trigger == -1) {
|
||||||
outputs[| 1].setValue(0);
|
outputs[| 1].setValue(0);
|
||||||
|
network_trigger = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function(frame = ANIMATOR.current_frame) {
|
static update = function(frame = ANIMATOR.current_frame) {
|
||||||
|
|
|
@ -57,10 +57,10 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
array_push(attributeEditors, "Warp");
|
array_push(attributeEditors, "Warp");
|
||||||
|
|
||||||
attributes[? "iteration"] = 4;
|
attributes.iteration = 4;
|
||||||
array_push(attributeEditors, ["Iteration", "iteration",
|
array_push(attributeEditors, ["Iteration", "iteration",
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||||
attributes[? "iteration"] = val;
|
attributes.iteration = val;
|
||||||
triggerRender();
|
triggerRender();
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var it = attributes[? "iteration"];
|
var it = attributes.iteration;
|
||||||
var _rat = 1 / it;
|
var _rat = 1 / it;
|
||||||
|
|
||||||
repeat(it) {
|
repeat(it) {
|
||||||
|
@ -487,34 +487,33 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
}
|
}
|
||||||
|
|
||||||
static postDeserialize = function() {
|
static postDeserialize = function() {
|
||||||
var _inputs = load_map[? "inputs"];
|
var _inputs = load_map.inputs;
|
||||||
|
|
||||||
for(var i = control_index; i < ds_list_size(_inputs); i++) {
|
for(var i = control_index; i < array_length(_inputs); i++) {
|
||||||
var inp = createControl();
|
var inp = createControl();
|
||||||
print(instanceof(inp))
|
inp.applyDeserialize(_inputs[i]);
|
||||||
inp.applyDeserialize(_inputs[| i]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() {
|
||||||
var att = ds_map_create();
|
var att = {};
|
||||||
|
|
||||||
var pinList = ds_list_create();
|
var pinList = [];
|
||||||
for( var j = 0; j < array_length(data.points); j++ )
|
for( var j = 0; j < array_length(data.points); j++ )
|
||||||
for( var k = 0; k < array_length(data.points[j]); k++ ) {
|
for( var k = 0; k < array_length(data.points[j]); k++ ) {
|
||||||
var p = data.points[j][k];
|
var p = data.points[j][k];
|
||||||
if(p == 0) continue;
|
if(p == 0) continue;
|
||||||
if(p.pin) ds_list_add(pinList, p.index);
|
if(p.pin) array_push(pinList, p.index);
|
||||||
}
|
}
|
||||||
|
|
||||||
ds_map_add_list(att, "pin", pinList);
|
att.pin = pinList;
|
||||||
return att;
|
return att;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPin = noone;
|
loadPin = noone;
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
if(ds_map_exists(attr, "pin"))
|
if(struct_has(attr, "pin"))
|
||||||
loadPin = attr[? "pin"];
|
loadPin = attr.pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
static postConnect = function() {
|
static postConnect = function() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
function Panel_Array_Sequence(node) : PanelContent() constructor {
|
function Panel_Array_Sequence(node) : PanelContent() constructor {
|
||||||
self.node = node;
|
self.node = node;
|
||||||
title = __txt("Array Sequence");
|
title = __txt("Frame Sequence Editor");
|
||||||
|
|
||||||
w = ui(640);
|
w = ui(640);
|
||||||
h = ui(168);
|
h = ui(168);
|
||||||
|
@ -105,11 +105,19 @@ function Panel_Array_Sequence(node) : PanelContent() constructor {
|
||||||
draw_set_alpha(1);
|
draw_set_alpha(1);
|
||||||
|
|
||||||
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub);
|
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub);
|
||||||
draw_text_add(_sx + _ns / 2, ui(0), i);
|
draw_text_add(_sx + _ns / 2, ui(0), i + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for( var i = 0; i < array_length(_ord); i++ ) {
|
var __ord = _ord;
|
||||||
var _i = _ord[i];
|
var _def = array_length(_ord) == 0;
|
||||||
|
if(_def) {
|
||||||
|
__ord = array_create(array_length(_seq));
|
||||||
|
for( var i = 0; i < array_length(_seq); i++ )
|
||||||
|
__ord[i] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( var i = 0; i < array_length(__ord); i++ ) {
|
||||||
|
var _i = __ord[i];
|
||||||
if(_i == noone) continue;
|
if(_i == noone) continue;
|
||||||
var _s = _seq[_i];
|
var _s = _seq[_i];
|
||||||
if(!is_surface(_s)) continue;
|
if(!is_surface(_s)) continue;
|
||||||
|
@ -122,9 +130,9 @@ function Panel_Array_Sequence(node) : PanelContent() constructor {
|
||||||
var _ssx = _sx + (_ns - _sw * _ss) / 2;
|
var _ssx = _sx + (_ns - _sw * _ss) / 2;
|
||||||
var _ssy = _sy + (_ns - _sh * _ss) / 2;
|
var _ssy = _sy + (_ns - _sh * _ss) / 2;
|
||||||
|
|
||||||
draw_surface_ext_safe(_s, _ssx, _ssy, _ss, _ss);
|
draw_surface_ext_safe(_s, _ssx, _ssy, _ss, _ss,,, _def? 0.5 : 1);
|
||||||
|
|
||||||
if(pHOVER && point_in_rectangle(msx, msy, _sx, _sy, _sx + _ns, _sy + _ns)) {
|
if(pHOVER && !_def && point_in_rectangle(msx, msy, _sx, _sy, _sx + _ns, _sy + _ns)) {
|
||||||
if(mouse_press(mb_left, pFOCUS)) {
|
if(mouse_press(mb_left, pFOCUS)) {
|
||||||
_ord[i] = noone;
|
_ord[i] = noone;
|
||||||
node.inputs[| 2].setValue(_ord);
|
node.inputs[| 2].setValue(_ord);
|
||||||
|
|
|
@ -27,7 +27,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
||||||
split = "";
|
split = "";
|
||||||
|
|
||||||
tab_width = 0;
|
tab_width = 0;
|
||||||
tab_height = ui(20);
|
tab_height = ui(24);
|
||||||
tab_x = 0;
|
tab_x = 0;
|
||||||
tab_x_to = 0;
|
tab_x_to = 0;
|
||||||
tab_surface = noone;
|
tab_surface = noone;
|
||||||
|
@ -450,13 +450,15 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
||||||
checkHover();
|
checkHover();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tab_cover = noone;
|
||||||
function drawTab() {
|
function drawTab() {
|
||||||
tab_surface = surface_verify(tab_surface, w - padding * 2 + 1, tab_height + ui(4));
|
tab_surface = surface_verify(tab_surface, w - padding * 2 + 1, tab_height + ui(4));
|
||||||
|
|
||||||
var tsx = x + padding - 1;
|
var tsx = x + padding - 1;
|
||||||
var tsy = y;
|
var tsy = y + ui(2);
|
||||||
var msx = mouse_x - tsx;
|
var msx = mouse_x - tsx;
|
||||||
var msy = mouse_y - tsy;
|
var msy = mouse_y - tsy;
|
||||||
|
tab_cover = noone;
|
||||||
|
|
||||||
surface_set_target(tab_surface);
|
surface_set_target(tab_surface);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
@ -490,16 +492,19 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
||||||
content[i].tab_x = lerp_float(content[i].tab_x, tbx, 5);
|
content[i].tab_x = lerp_float(content[i].tab_x, tbx, 5);
|
||||||
var _tbx = content[i].tab_x;
|
var _tbx = content[i].tab_x;
|
||||||
var _hov = point_in_rectangle(msx, msy, _tbx, tby, _tbx + tbw, tab_height);
|
var _hov = point_in_rectangle(msx, msy, _tbx, tby, _tbx + tbw, tab_height);
|
||||||
|
var _tdh = tbh + THEME_VALUE.panel_tab_extend;
|
||||||
|
|
||||||
if(i == content_index) {
|
if(i == content_index) {
|
||||||
foc = FOCUS == self;
|
foc = FOCUS == self;
|
||||||
var cc = FOCUS == self? COLORS.panel_tab_active : COLORS.panel_tab;
|
var cc = FOCUS == self? COLORS._main_accent : COLORS.panel_tab;
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_tab, FOCUS == self, _tbx, tby, tbw, tbh, cc, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 1 + (FOCUS == self), _tbx, tby, tbw, _tdh, cc, 1);
|
||||||
|
if(!foc) tab_cover = BBOX().fromWH(tsx + _tbx, tsy + tby + tbh - ui(2), tbw, THEME_VALUE.panel_tab_extend);
|
||||||
} else {
|
} else {
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, _tbx, tby, tbw, tbh, COLORS.panel_tab_inactive, 1);
|
var cc = COLORS.panel_tab_inactive;
|
||||||
|
|
||||||
if(HOVER == self && _hov)
|
if(HOVER == self && _hov)
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, _tbx, tby, tbw, tbh, COLORS.panel_tab_hover, 1);
|
var cc = COLORS.panel_tab_hover;
|
||||||
|
|
||||||
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, _tbx, tby, tbw, _tdh, cc, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(HOVER == self && _hov) {
|
if(HOVER == self && _hov) {
|
||||||
|
@ -516,7 +521,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
||||||
if(mouse_press(mb_right, FOCUS == self)) {
|
if(mouse_press(mb_right, FOCUS == self)) {
|
||||||
var menu = array_clone(border_rb_menu);
|
var menu = array_clone(border_rb_menu);
|
||||||
if(instanceof(content[i]) == "Panel_Menu")
|
if(instanceof(content[i]) == "Panel_Menu")
|
||||||
array_remove(menu, 2, border_rb_close);
|
array_remove(menu, 2);
|
||||||
|
|
||||||
menuCall("panel_border_menu",,, menu);
|
menuCall("panel_border_menu",,, menu);
|
||||||
}
|
}
|
||||||
|
@ -533,7 +538,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_set_text(f_p3, fa_left, fa_bottom, cc);
|
draw_set_text(f_p3, fa_left, fa_bottom, cc);
|
||||||
draw_text_add(_tbx + ui(8), tab_height - ui(2), txt);
|
draw_text_add(_tbx + ui(8), tab_height - ui(4), txt);
|
||||||
|
|
||||||
tbx += tbw + ui(2);
|
tbx += tbw + ui(2);
|
||||||
}
|
}
|
||||||
|
@ -553,7 +558,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
||||||
var tbw = string_width(txt) + ui(16);
|
var tbw = string_width(txt) + ui(16);
|
||||||
if(icn != noone) tbw += ui(16 + 4);
|
if(icn != noone) tbw += ui(16 + 4);
|
||||||
|
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_tab, FOCUS == self, _tbx, tby, tbw, tbh, COLORS.panel_tab_active, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 2, _tbx, tby, tbw, tbh, COLORS._main_accent, 1);
|
||||||
|
|
||||||
var cc = COLORS.panel_bg_clear_inner;
|
var cc = COLORS.panel_bg_clear_inner;
|
||||||
if(icn != noone) {
|
if(icn != noone) {
|
||||||
|
@ -561,7 +566,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
||||||
_tbx += ui(20);
|
_tbx += ui(20);
|
||||||
}
|
}
|
||||||
draw_set_text(f_p3, fa_left, fa_bottom, COLORS.panel_bg_clear_inner);
|
draw_set_text(f_p3, fa_left, fa_bottom, COLORS.panel_bg_clear_inner);
|
||||||
draw_text(_tbx + ui(8), tab_height - ui(2), txt);
|
draw_text_add(_tbx + ui(8), tab_height - ui(4), txt);
|
||||||
|
|
||||||
if(tab_hold_state == 0) {
|
if(tab_hold_state == 0) {
|
||||||
if(point_distance(tab_holding_mx, tab_holding_my, msx, msy) > 8)
|
if(point_distance(tab_holding_mx, tab_holding_my, msx, msy) > 8)
|
||||||
|
@ -633,7 +638,8 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
draw_surface_safe(content_surface, tx, ty);
|
draw_surface_safe(content_surface, tx, ty);
|
||||||
draw_sprite_stretched(THEME.ui_panel_bg, 3, tx + padding, ty + padding, _tw, _th);
|
draw_sprite_stretched(THEME.ui_panel_fg, 0, tx + padding, ty + padding, _tw, _th);
|
||||||
|
draw_sprite_bbox(THEME.ui_panel_tab, 3, tab_cover);
|
||||||
|
|
||||||
if(FOCUS == self && parent != noone) {
|
if(FOCUS == self && parent != noone) {
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_active, 0, tx + padding, ty + padding, tw - padding * 2, th - padding * 2, COLORS._main_accent, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_active, 0, tx + padding, ty + padding, tw - padding * 2, th - padding * 2, COLORS._main_accent, 1);
|
||||||
|
|
|
@ -175,7 +175,7 @@ function Panel_Graph() : PanelContent() constructor {
|
||||||
addHotkey("Graph", "Add node", "A", MOD_KEY.none, function() { PANEL_GRAPH.callAddDialog(); });
|
addHotkey("Graph", "Add node", "A", MOD_KEY.none, function() { PANEL_GRAPH.callAddDialog(); });
|
||||||
addHotkey("Graph", "Focus content", "F", MOD_KEY.none, function() { PANEL_GRAPH.fullView(); });
|
addHotkey("Graph", "Focus content", "F", MOD_KEY.none, function() { PANEL_GRAPH.fullView(); });
|
||||||
addHotkey("Graph", "Preview focusing node", "P", MOD_KEY.none, function() { PANEL_GRAPH.setCurrentPreview(); });
|
addHotkey("Graph", "Preview focusing node", "P", MOD_KEY.none, function() { PANEL_GRAPH.setCurrentPreview(); });
|
||||||
addHotkey("Graph", "Preview window", "P", MOD_KEY.ctrl, function() { PANEL_GRAPH.previewWindow(PANEL_GRAPH.node_focus); });
|
addHotkey("Graph", "Preview window", "P", MOD_KEY.ctrl, function() { create_preview_window(PANEL_GRAPH.node_focus); });
|
||||||
addHotkey("Graph", "Import image", "I", MOD_KEY.none, function() { nodeBuild("Node_Image", PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y); });
|
addHotkey("Graph", "Import image", "I", MOD_KEY.none, function() { nodeBuild("Node_Image", PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y); });
|
||||||
addHotkey("Graph", "Import image array", "I", MOD_KEY.shift, function() { nodeBuild("Node_Image_Sequence", PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y); });
|
addHotkey("Graph", "Import image array", "I", MOD_KEY.shift, function() { nodeBuild("Node_Image_Sequence", PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y); });
|
||||||
addHotkey("Graph", "Add number", "1", MOD_KEY.none, function() { nodeBuild("Node_Number", PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y); });
|
addHotkey("Graph", "Add number", "1", MOD_KEY.none, function() { nodeBuild("Node_Number", PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y); });
|
||||||
|
@ -493,7 +493,7 @@ function Panel_Graph() : PanelContent() constructor {
|
||||||
}));
|
}));
|
||||||
array_push(menu,
|
array_push(menu,
|
||||||
menuItem(__txtx("panel_graph_preview_window", "Send to preview window"), function() {
|
menuItem(__txtx("panel_graph_preview_window", "Send to preview window"), function() {
|
||||||
previewWindow(node_hover);
|
create_preview_window(node_hover);
|
||||||
}, noone, ["Graph", "Preview window"]));
|
}, noone, ["Graph", "Preview window"]));
|
||||||
array_push(menu,
|
array_push(menu,
|
||||||
menuItem(__txtx("panel_graph_inspector_panel", "Send to new inspector"), function() {
|
menuItem(__txtx("panel_graph_inspector_panel", "Send to new inspector"), function() {
|
||||||
|
@ -910,11 +910,11 @@ function Panel_Graph() : PanelContent() constructor {
|
||||||
nodeArray[i] = nodes_select_list[| i];
|
nodeArray[i] = nodes_select_list[| i];
|
||||||
}
|
}
|
||||||
|
|
||||||
var _map = ds_map_create();
|
var _map = {};
|
||||||
var _node = ds_list_create();
|
var _node = [];
|
||||||
for(var i = 0; i < array_length(nodeArray); i++)
|
for(var i = 0; i < array_length(nodeArray); i++)
|
||||||
SAVE_NODE(_node, nodeArray[i],,,, getCurrentContext());
|
SAVE_NODE(_node, nodeArray[i],,,, getCurrentContext());
|
||||||
ds_map_add_list(_map, "nodes", _node);
|
_map.nodes = _node;
|
||||||
|
|
||||||
APPENDING = true;
|
APPENDING = true;
|
||||||
CLONING = true;
|
CLONING = true;
|
||||||
|
@ -922,8 +922,6 @@ function Panel_Graph() : PanelContent() constructor {
|
||||||
APPENDING = false;
|
APPENDING = false;
|
||||||
CLONING = false;
|
CLONING = false;
|
||||||
|
|
||||||
ds_map_destroy(_map);
|
|
||||||
|
|
||||||
if(ds_list_size(_app) == 0) {
|
if(ds_list_size(_app) == 0) {
|
||||||
ds_list_destroy(_app);
|
ds_list_destroy(_app);
|
||||||
return;
|
return;
|
||||||
|
@ -984,20 +982,19 @@ function Panel_Graph() : PanelContent() constructor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var _map = ds_map_create();
|
var _map = {};
|
||||||
var _node = ds_list_create();
|
var _node = [];
|
||||||
for(var i = 0; i < array_length(nodeArray); i++)
|
for(var i = 0; i < array_length(nodeArray); i++)
|
||||||
SAVE_NODE(_node, nodeArray[i],,,, getCurrentContext());
|
SAVE_NODE(_node, nodeArray[i],,,, getCurrentContext());
|
||||||
ds_map_add_list(_map, "nodes", _node);
|
_map.nodes = _node;
|
||||||
|
|
||||||
clipboard_set_text(json_encode_minify(_map));
|
clipboard_set_text(json_encode_minify(_map));
|
||||||
ds_map_destroy(_map);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function doPaste() {
|
function doPaste() {
|
||||||
var txt = clipboard_get_text();
|
var txt = clipboard_get_text();
|
||||||
var _map = json_decode(txt);
|
var _map = json_try_parse(txt);
|
||||||
if(_map != -1) {
|
if(_map != noone) {
|
||||||
ds_map_clear(APPEND_MAP);
|
ds_map_clear(APPEND_MAP);
|
||||||
APPENDING = true;
|
APPENDING = true;
|
||||||
CLONING = true;
|
CLONING = true;
|
||||||
|
@ -1005,7 +1002,6 @@ function Panel_Graph() : PanelContent() constructor {
|
||||||
APPENDING = false;
|
APPENDING = false;
|
||||||
CLONING = false;
|
CLONING = false;
|
||||||
|
|
||||||
ds_map_destroy(_map);
|
|
||||||
if(_app == noone)
|
if(_app == noone)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue