- Fix default preset overriding some value with manually created node.

This commit is contained in:
Tanasart 2024-07-31 10:45:59 +07:00
parent 2b5fdb474c
commit 301e43a6c2
54 changed files with 332 additions and 260 deletions

Binary file not shown.

View file

@ -42,6 +42,7 @@
dialog_drag_sy = 0;
dialog_drag_mx = 0;
dialog_drag_my = 0;
mouse_draggable = true;
passthrough = false;
@ -59,7 +60,7 @@
dialog_dragging = false;
}
if(point_in_rectangle(mouse_mx, mouse_my, dialog_x, dialog_y, dialog_x + dialog_w, dialog_y + ui(title_height))) {
if(mouse_draggable && point_in_rectangle(mouse_mx, mouse_my, dialog_x, dialog_y, dialog_x + dialog_w, dialog_y + ui(title_height))) {
mouse_active = false;
if(mouse_press(mb_left, sFOCUS)) {
dialog_dragging = true;
@ -69,6 +70,8 @@
dialog_drag_my = mouse_my;
}
}
mouse_draggable = true;
}
dialog_resizable = false;
@ -101,8 +104,7 @@
if(mouse_release(mb_left)) dialog_resizing = 0;
if(sHOVER && distance_to_line(mouse_mx, mouse_my, dialog_x + dialog_w, dialog_y,
dialog_x + dialog_w, dialog_y + dialog_h) < 12) {
if(sHOVER && distance_to_line(mouse_mx, mouse_my, dialog_x + dialog_w, dialog_y, dialog_x + dialog_w, dialog_y + dialog_h) < 12) {
mouse_active = false;
CURSOR = cr_size_we;
@ -114,8 +116,7 @@
}
}
if(sHOVER && distance_to_line(mouse_mx, mouse_my, dialog_x, dialog_y + dialog_h,
dialog_x + dialog_w, dialog_y + dialog_h) < 12) {
if(sHOVER && distance_to_line(mouse_mx, mouse_my, dialog_x, dialog_y + dialog_h, dialog_x + dialog_w, dialog_y + dialog_h) < 12) {
mouse_active = false;
if(CURSOR == cr_size_we)

View file

@ -13,9 +13,12 @@ event_inherited();
key_selecting = noone;
key_dragging = noone;
key_drag_sx = 0;
key_drag_mx = 0;
key_deleting = false;
key_drag_dead = true;
key_drag_sx = 0;
key_drag_sy = 0;
key_drag_mx = 0;
key_drag_my = 0;
destroy_on_click_out = true;
@ -220,16 +223,17 @@ event_inherited();
}
}
if(isHover && i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
if(isHover && mouse_press(mb_right, interactable && sFOCUS)) {
hovering = pal;
menuCall("palette_window_preset_menu",,, [
menuItem(__txtx("palette_editor_set_default", "Set as default"), function() {
PROJECT.setPalette(array_clone(hovering.palette));
}),
menuItem(__txtx("palette_editor_delete", "Delete palette"), function() {
file_delete(hovering.path);
__initPalette();
menuItem(__txtx("gradient_set_palette", "Convert to Gradient"), function() {
var _p = hovering.palette;
if(array_length(_p) < 2) return;
gradient.keys = [];
for( var i = 0, n = array_length(_p); i < n; i++ )
gradient.keys[i] = new gradientKey(i / (n - 1), _p[i]);
}),
]);
}

View file

@ -93,10 +93,6 @@ if !ready exit;
#endregion
#region gradient
var gr_x = content_x + ui(22);
var gr_y = dialog_y + ui(54);
var gr_w = content_w - ui(44);
var gr_h = ui(20);
#region tools
var bx = content_x + content_w - ui(50);
@ -122,37 +118,62 @@ if !ready exit;
bx -= ui(32);
#endregion
var gr_x = content_x + ui(22);
var gr_y = dialog_y + ui(54);
var gr_w = content_w - ui(44);
var gr_h = ui(20);
draw_sprite_stretched(THEME.textbox, 3, gr_x - ui(6), gr_y - ui(6), gr_w + ui(12), gr_h + ui(12));
draw_sprite_stretched(THEME.textbox, 0, gr_x - ui(6), gr_y - ui(6), gr_w + ui(12), gr_h + ui(12));
gradient.draw(gr_x, gr_y, gr_w, gr_h);
draw_sprite_stretched_add(THEME.ui_panel_fg, 1, gr_x, gr_y, gr_w, gr_h, c_white, 0.25);
var hover = noone;
for(var i = 0; i < array_length(gradient.keys); i++) {
var _k = gradient.keys[i];
var _c = _k.value;
var _kx = gr_x + _k.time * gr_w;
var _ky = gr_y + gr_h / 2;
var _in = _k == key_selecting? 1 : 0;
draw_sprite_ui_uniform(THEME.prop_gradient, _in, _kx, gr_y + gr_h / 2, 1, _c);
var _hov = sHOVER && point_in_rectangle(mouse_mx, mouse_my, _kx - ui(6), gr_y, _kx + ui(6), gr_y + gr_h);
_hov |= key_dragging == _k;
_k._hover = lerp_float(_k._hover, _hov, 5);
if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, _kx - ui(6), gr_y, _kx + ui(6), gr_y + gr_h)) {
draw_sprite_ui_uniform(THEME.prop_gradient, _in, _kx, gr_y + gr_h / 2, 1.2, _c);
hover = _k;
var _kw = ui(12);
var _kh = lerp(ui(24), ui(32), _k._hover);
var _kdx = _kx - _kw / 2;
var _kdy = _ky - _kh / 2;
var _aa = key_dragging == _k && key_deleting? 0.3 : 1;
draw_sprite_stretched_ext(THEME.prop_gradient, 0, _kdx, _kdy, _kw, _kh, _c, _aa);
if(key_selecting == _k || key_dragging == _k) {
draw_sprite_stretched_ext(THEME.prop_gradient, 1, _kdx, _kdy, _kw, _kh, COLORS._main_accent, _aa);
} else {
if(_color_get_light(_c) < 0.75) draw_sprite_stretched_ext(THEME.prop_gradient, 1, _kdx, _kdy, _kw, _kh, c_white, _aa);
else draw_sprite_stretched_ext(THEME.prop_gradient, 1, _kdx, _kdy, _kw, _kh, c_black, _aa);
}
if(_hov) hover = _k;
}
if(key_dragging) {
if(abs(mouse_mx - key_drag_mx) > 4)
key_drag_dead = false;
key_deleting = abs(mouse_my - key_drag_my) > ui(32) && array_length(gradient.keys) > 1;
if(!key_drag_dead) {
var newT = key_drag_sx + (mouse_mx - key_drag_mx) / gr_w;
newT = clamp(newT, 0, 1);
if(!key_drag_dead && !key_deleting) {
var newT = clamp(key_drag_sx + (mouse_mx - key_drag_mx) / gr_w, 0, 1);
setKeyPosition(key_dragging, newT);
}
if(mouse_release(mb_left)) {
removeKeyOverlap(key_dragging);
if(key_deleting) array_remove(gradient.keys, key_dragging);
else removeKeyOverlap(key_dragging);
key_dragging = noone;
}
}
@ -165,16 +186,21 @@ if !ready exit;
if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, _x0, _y0, _x1, _y1)) {
if(mouse_press(mb_left, sFOCUS)) {
widget_clear();
if(hover) {
key_selecting = hover;
if(interactable) {
key_dragging = hover;
key_drag_dead = true;
key_deleting = false;
key_drag_sx = hover.time;
key_drag_mx = mouse_mx;
key_drag_dead = true;
key_drag_my = mouse_my;
}
selector.setColor(hover.value);
} else if(interactable) {
key_selecting = noone;
@ -186,9 +212,12 @@ if !ready exit;
key_selecting = _newkey;
key_dragging = _newkey;
key_drag_dead = true;
key_deleting = false;
key_drag_sx = tt;
key_drag_mx = mouse_mx;
key_drag_dead = false;
key_drag_my = mouse_my;
selector.setColor(key_dragging.value);
}

View file

@ -140,15 +140,22 @@ event_inherited();
#region tools
function sortPalette(sortFunc) {
if(index_selecting[1] < 2)
array_sort(palette, sortFunc);
else {
var _arr = array_create(index_selecting[1]);
for(var i = 0; i < index_selecting[1]; i++)
_arr[i] = palette[index_selecting[0] + i];
array_sort(_arr, sortFunc);
for(var i = 0; i < index_selecting[1]; i++)
palette[index_selecting[0] + i] = _arr[i];
}
onApply(palette);
}
#endregion
#region action
onResize = function() {
sp_presets.resize(sp_preset_w, dialog_h - ui(62));
}
function onResize() { sp_presets.resize(sp_preset_w, dialog_h - ui(62)); }
function checkMouse() {}
#endregion

View file

@ -80,8 +80,12 @@ if palette == 0 exit;
#region tools
var bx = content_x + content_w - ui(50);
var by = dialog_y + ui(16);
var bc = index_selecting[1] < 2? COLORS._main_icon : merge_color(COLORS._main_icon, COLORS._main_accent, 0.5);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_sort", "Sort color"), THEME.sort) == 2) {
var _txt = index_selecting[1] < 2? __txtx("palette_editor_sort", "Sort palette") : __txtx("palette_editor_sort_selected", "Sort selected");
var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, _txt, THEME.sort, 0, bc);
if(b) mouse_draggable = false;
if(b == 2) {
menuCall("palette_window_sort_menu", bx + ui(32), by, [
menuItem(__txtx("palette_editor_sort_brighter", "Brighter"), function() { sortPalette(__sortBright); }),
menuItem(__txtx("palette_editor_sort_darker", "Darker"), function() { sortPalette(__sortDark); }),
@ -93,8 +97,23 @@ if palette == 0 exit;
}
bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_reverse", "Reverse palette"), THEME.reverse) == 2) {
var _txt = index_selecting[1] < 2? __txtx("palette_editor_reverse", "Reverse palette") : __txtx("palette_editor_reverse_selected", "Reverse selected");
var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, _txt, THEME.reverse, 0, bc);
if(b) mouse_draggable = false;
if(b == 2) {
if(index_selecting[1] < 2)
palette = array_reverse(palette);
else {
var _arr = array_create(index_selecting[1]);
for(var i = 0; i < index_selecting[1]; i++)
_arr[i] = palette[index_selecting[0] + i];
_arr = array_reverse(_arr);
for(var i = 0; i < index_selecting[1]; i++)
palette[index_selecting[0] + i] = _arr[i];
}
onApply(palette);
}
bx -= ui(32);
@ -160,6 +179,8 @@ if palette == 0 exit;
var _k = string(_p);
var _ii = 0;
var _selecting = index >= index_selecting[0] && index < index_selecting[0] + index_selecting[1];
while(struct_has(_clrRep, _k)) {
_k = $"{_p}{_ii}";
_ii++;
@ -168,14 +189,14 @@ if palette == 0 exit;
_clrRep[$ _k] = 1;
if(struct_has(ppos, _k)) {
ppos[$ _k][0] = ppos[$ _k][0] == 0? _px : lerp_float(ppos[$ _k][0], _px, 4);
ppos[$ _k][1] = ppos[$ _k][1] == 0? _py : lerp_float(ppos[$ _k][1], _py, 4);
ppos[$ _k][0] = (ppos[$ _k][0] == 0 || !_selecting)? _px - dialog_x : lerp_float(ppos[$ _k][0], _px - dialog_x, 4);
ppos[$ _k][1] = (ppos[$ _k][1] == 0 || !_selecting)? _py - dialog_y : lerp_float(ppos[$ _k][1], _py - dialog_y, 4);
} else {
ppos[$ _k] = [ _px, _py ];
ppos[$ _k] = [ _px - dialog_x, _py - dialog_y ];
}
var _pdx = ppos[$ _k][0];
var _pdy = ppos[$ _k][1];
var _pdx = dialog_x + ppos[$ _k][0];
var _pdy = dialog_y + ppos[$ _k][1];
var _ind = 0;
if(row == 1) {
@ -194,16 +215,14 @@ if palette == 0 exit;
}
_palInd[index] = _ind;
drawColor(_p, _pdx, _pdy, _pw, _ph, _ind);
drawColor(_p, _pdx, _pdy, _pw, _ph, true, _ind);
if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, _kx, _ky, _kx + ww, _ky + hh)) {
hover = index;
hvx = _kx;
hvy = _ky;
if(index >= index_selecting[0] && index < index_selecting[0] + index_selecting[1]
&& !point_in_rectangle(mouse_mx, mouse_my, _kx + 4, _ky + 4, _kx + ww - 8, _ky + hh - 8))
if(_selecting && !point_in_rectangle(mouse_mx, mouse_my, _kx + 4, _ky + 4, _kx + ww - 8, _ky + hh - 8))
_hedge = true;
}
}
@ -217,18 +236,17 @@ if palette == 0 exit;
if(index >= index_selecting[0] && index < index_selecting[0] + index_selecting[1]) {
var _p = palette[index];
var _px = dialog_x + ppos[$ _p][0] - pl_sx;
var _py = dialog_y + ppos[$ _p][1] - pl_sy;
var _px = ppos[$ _p][0] - pl_sx;
var _py = ppos[$ _p][1] - pl_sy;
drawColor(_p, _px, _py, _pw, _ph, _palInd[index]);
drawColor(_p, _px, _py, _pw, _ph, true, _palInd[index]);
}
}
surface_reset_target();
shader_set(sh_dialog_palette_selector);
shader_set_f("dimension", pl_sw, pl_sh);
shader_set_i("edge", _hedge && !mouse_click(mb_left));
shader_set_i("edge", (_hedge && !mouse_click(mb_left)) || index_dragging != noone);
shader_set_color("edgeColor", COLORS._main_accent);
draw_surface(selection_surface, pl_sx, pl_sy);

View file

@ -136,6 +136,7 @@ function array_overlap(arr0, arr1) {
}
function array_empty(arr) { INLINE return is_array(arr) && array_length(arr) == 0; }
function array_valid(arr) { INLINE return is_array(arr) && array_length(arr) > 0; }
function array_invalid(arr) { INLINE return !is_array(arr) || array_length(arr) == 0; }
function array_find(arr, val) {
@ -211,6 +212,7 @@ function array_clone(arr, _depth = -1) {
var _res = [];
for( var i = 0, n = array_length(arr); i < n; i++ )
_res[i] = array_clone(arr[i], _depth--);
return _res;
}

View file

@ -201,9 +201,9 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor {
} #endregion
}
function drawColor(color, _x, _y, _w, _h, _ind = 1) {
function drawColor(color, _x, _y, _w, _h, _alp = true, _ind = 1) {
if(is_real(color))
if(is_real(color) || !_alp)
draw_sprite_stretched_ext(THEME.palette_mask, _ind, _x, _y, _w, _h, color, 1);
else if(is_int64(color)) {
var _a = _color_get_alpha(color);
@ -213,8 +213,8 @@ function drawColor(color, _x, _y, _w, _h, _ind = 1) {
} else {
draw_sprite_stretched_ext(THEME.palette_mask, _ind, _x, _y, _w, _h - ui(8), color, 1);
draw_sprite_stretched_ext(THEME.palette_mask, 0, _x, _y + _h - ui(6), _w, ui(6), c_black, 1);
draw_sprite_stretched_ext(THEME.palette_mask, 0, _x, _y + _h - ui(6), _w * _a, ui(6), c_white, 1);
draw_sprite_stretched_ext(THEME.palette_mask, 1, _x, _y + _h - ui(6), _w, ui(6), c_black, 1);
draw_sprite_stretched_ext(THEME.palette_mask, 1, _x, _y + _h - ui(6), _w * _a, ui(6), c_white, 1);
}
}
}

View file

@ -39,7 +39,7 @@
LATEST_VERSION = 11700;
VERSION = 11780;
SAVE_VERSION = 11700;
VERSION_STRING = "1.17.9.005";
VERSION_STRING = "1.17.9.006";
BUILD_NUMBER = 11780;
HOTKEYS = ds_map_create();
@ -47,9 +47,7 @@
HOTKEY_CONTEXT[| 0] = "";
globalvar TOOLTIP, DRAGGING, DIALOG_DEPTH_HOVER;
global.KEYS = {
download_links: "",
};
global.KEYS = { download_links: "" };
globalvar CURRENT_COLOR;
CURRENT_COLOR = c_white;

View file

@ -12,6 +12,8 @@ function gradientKey(time, value) constructor {
self.time = time;
self.value = value;
_hover = 0;
static clone = function() { return new gradientKey(time, value); }
static serialize = function() { return { time, value }; }
}

View file

@ -1,4 +1,4 @@
function Node_create_3D_Obj(_x, _y, _group = noone) { #region
function Node_create_3D_Obj(_x, _y, _group = noone) {
var path = "";
if(NODE_NEW_MANUAL) {
path = get_open_filename_pxc("3d object|*.obj", "");
@ -6,18 +6,18 @@ function Node_create_3D_Obj(_x, _y, _group = noone) { #region
if(path == "") return noone;
}
var node = new Node_3D_Mesh_Obj(_x, _y, _group);
var node = new Node_3D_Mesh_Obj(_x, _y, _group).skipDefault();
node.setPath(path);
return node;
} #endregion
}
function Node_create_3D_Obj_path(_x, _y, path) { #region
function Node_create_3D_Obj_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_3D_Mesh_Obj(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_3D_Mesh_Obj(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.setPath(path);
return node;
} #endregion
}
function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group) constructor {
name = "3D Obj";

View file

@ -6,7 +6,7 @@ function Node_create_ASE_File_Read(_x, _y, _group = noone) {
if(path == "") return noone;
}
var node = new Node_ASE_File_Read(_x, _y, _group);
var node = new Node_ASE_File_Read(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
if(NODE_NEW_MANUAL) node.doUpdate();
@ -16,7 +16,7 @@ function Node_create_ASE_File_Read(_x, _y, _group = noone) {
function Node_create_ASE_File_Read_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_ASE_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_ASE_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();

View file

@ -6,7 +6,7 @@
];
function Node_create_Blend(_x, _y, _group = noone, _param = {}) {
var node = new Node_Blend(_x, _y, _group);
var node = new Node_Blend(_x, _y, _group).skipDefault();
var query = struct_try_get(_param, "query", "");
var ind = array_find(global.node_blend_keys, query);

View file

@ -196,6 +196,8 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
managedRenderOrder = false;
skipDefault();
draw_dummy = false;
dummy_input = nodeValue("Add to group", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0);

View file

@ -14,7 +14,7 @@ enum COMPARE_OPERATOR {
function Node_create_Compare(_x, _y, _group = noone, _param = {}) {
var query = struct_try_get(_param, "query", "");
var node = new Node_Compare(_x, _y, _group);
var node = new Node_Compare(_x, _y, _group).skipDefault();
var ind = -1;
switch(query) {

View file

@ -6,7 +6,7 @@ function Node_create_CSV_File_Read(_x, _y, _group = noone) {
if(path == "") return noone;
}
var node = new Node_CSV_File_Read(_x, _y, _group);
var node = new Node_CSV_File_Read(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
@ -16,7 +16,7 @@ function Node_create_CSV_File_Read(_x, _y, _group = noone) {
function Node_create_CSV_File_Read_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_CSV_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_CSV_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();

View file

@ -1,12 +1,12 @@
function Node_create_CSV_File_Write(_x, _y, _group = noone) { #region
function Node_create_CSV_File_Write(_x, _y, _group = noone) {
var path = "";
var node = new Node_CSV_File_Write(_x, _y, _group);
var node = new Node_CSV_File_Write(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
return node;
} #endregion
}
function Node_CSV_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "CSV File Out";

View file

@ -519,7 +519,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
/////============= STEP =============
static stepBegin = function() { #region
static stepBegin = function() {
if(use_cache) cacheArrayCheck();
doStepBegin();
@ -546,7 +546,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
if(is_3D == NODE_3D.polygon) USE_DEPTH = true;
if(is_simulation) PROJECT.animator.is_simulating = true;
} #endregion
}
static doStepBegin = function() {}
@ -747,8 +747,13 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
/////============ INPUTS ============
set_default = true;
static skipDefault = function() /*=>*/ { set_default = false; return self; }
static resetDefault = function() {
var folder = instanceof(self);
if(!ds_map_exists(global.PRESETS_MAP, folder)) {
for( var i = 0, n = ds_list_size(inputs); i < n; i++ )
inputs[| i].resetValue();
@ -768,7 +773,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
for( var i = 0, n = ds_list_size(inputs); i < n; i++ )
inputs[| i].resetValue();
} if(!APPENDING && !LOADING) run_in(1, method(self, resetDefault));
} if(!APPENDING && !LOADING) run_in(1, function() /*=>*/ { if(set_default) resetDefault() });
static addInput = function(junctionFrom, shift = input_fix_len) {
var targ = getInput(y, junctionFrom, shift);
@ -780,8 +785,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
static getInputData = function(index, def = 0) { return array_safe_get_fast(inputs_data, index, def); }
static setInputData = function(index, value) {
INLINE
var _inp = inputs[| index];
inputs_data[index] = value;
if(is_struct(_inp)) input_value_map[$ _inp.internalName] = value;

View file

@ -6,7 +6,7 @@ function Node_create_Directory_Search(_x, _y, _group = noone) {
if(path == "") return noone;
}
var node = new Node_Directory_Search(_x, _y, _group);
var node = new Node_Directory_Search(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
if(NODE_NEW_MANUAL) node.doUpdate();
@ -16,7 +16,7 @@ function Node_create_Directory_Search(_x, _y, _group = noone) {
function Node_create_Directory_path(_x, _y, path) {
if(!directory_exists(path)) return noone;
var node = new Node_Directory_Search(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_Directory_Search(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
return node;

View file

@ -1,4 +1,4 @@
function Node_create_Display_Image(_x, _y, _group = noone) { #region
function Node_create_Display_Image(_x, _y, _group = noone) {
var path = "";
if(NODE_NEW_MANUAL) {
path = get_open_filename_pxc("image|*.png;*.jpg", "");
@ -6,21 +6,21 @@ function Node_create_Display_Image(_x, _y, _group = noone) { #region
if(path == "") return noone;
}
var node = new Node_Display_Image(_x, _y, _group);
var node = new Node_Display_Image(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
return node;
} #endregion
}
function Node_create_Display_Image_path(_x, _y, path) { #region
function Node_create_Display_Image_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_Display_Image(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_Display_Image(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
return node;
} #endregion
}
function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Display Image";

View file

@ -1,6 +1,6 @@
function Node_create_Equation(_x, _y, _group = noone, _param = {}) { #region
function Node_create_Equation(_x, _y, _group = noone, _param = {}) {
var query = struct_try_get(_param, "query", "");
var node = new Node_Equation(_x, _y, _group);
var node = new Node_Equation(_x, _y, _group).skipDefault();
if(query == "") return node;
node.inputs[| 0].setValue(query);
@ -27,7 +27,7 @@ function Node_create_Equation(_x, _y, _group = noone, _param = {}) { #region
node.inputs[| 1 + i * 2].setValue(vars[i]);
return node;
} #endregion
}
function Node_Equation(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "Equation";

View file

@ -11,7 +11,7 @@ MPEG-4 (.mp4)|*.mp4",
key_release();
}
var node = new Node_Export(_x, _y, _group);
var node = new Node_Export(_x, _y, _group).skipDefault();
node.inputs[| 1].setValue(path);
if(NODE_NEW_MANUAL) node.extensionCheck();

View file

@ -74,6 +74,8 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
destroy_when_upgroup = true;
inParent = undefined;
skipDefault();
setDimension(96, 32 + 24);
inputs[| 0] = nodeValue("Display type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)

View file

@ -4,6 +4,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
is_group_io = true;
destroy_when_upgroup = true;
skipDefault();
setDimension(96, 32 + 24);
inputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1)

View file

@ -1,4 +1,4 @@
function Node_create_Image(_x, _y, _group = noone) { #region
function Node_create_Image(_x, _y, _group = noone) {
var path = "";
if(NODE_NEW_MANUAL) {
path = get_open_filename_pxc("image|*.png;*.jpg", "");
@ -6,21 +6,21 @@ function Node_create_Image(_x, _y, _group = noone) { #region
if(path == "") return noone;
}
var node = new Node_Image(_x, _y, _group);
var node = new Node_Image(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
if(NODE_NEW_MANUAL) node.doUpdate();
return node;
} #endregion
}
function Node_create_Image_path(_x, _y, path) { #region
function Node_create_Image_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_Image(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_Image(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
return node;
} #endregion
}
function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Image";

View file

@ -1,4 +1,4 @@
function Node_create_Image_Animated(_x, _y, _group = noone) { #region
function Node_create_Image_Animated(_x, _y, _group = noone) {
var path = "";
if(NODE_NEW_MANUAL) {
path = get_open_filenames_compat("image|*.png;*.jpg", "");
@ -6,22 +6,22 @@ function Node_create_Image_Animated(_x, _y, _group = noone) { #region
if(path == "") return noone;
}
var node = new Node_Image_Animated(_x, _y, _group);
var node = new Node_Image_Animated(_x, _y, _group).skipDefault();
var paths = string_splice(path, "\n");
node.inputs[| 0].setValue(paths);
if(NODE_NEW_MANUAL) node.doUpdate();
return node;
} #endregion
}
function Node_create_Image_Animated_path(_x, _y, _path) { #region
var node = new Node_Image_Animated(_x, _y, PANEL_GRAPH.getCurrentContext());
function Node_create_Image_Animated_path(_x, _y, _path) {
var node = new Node_Image_Animated(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(_path);
node.doUpdate();
return node;
} #endregion
}
enum ANIMATION_END {
loop,

View file

@ -1,4 +1,4 @@
function Node_create_Image_gif(_x, _y, _group = noone) { #region
function Node_create_Image_gif(_x, _y, _group = noone) {
var path = "";
if(NODE_NEW_MANUAL) {
path = get_open_filename_pxc("animated gif|*.gif", "");
@ -6,22 +6,22 @@ function Node_create_Image_gif(_x, _y, _group = noone) { #region
if(path == "") return noone;
}
var node = new Node_Image_gif(_x, _y, _group);
var node = new Node_Image_gif(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
if(NODE_NEW_MANUAL) node.doUpdate();
return node;
} #endregion
}
function Node_create_Image_gif_path(_x, _y, path) { #region
function Node_create_Image_gif_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_Image_gif(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_Image_gif(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
return node;
} #endregion
}
function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Image GIF";

View file

@ -1,4 +1,4 @@
function Node_create_Image_Sequence(_x, _y, _group = noone) { #region
function Node_create_Image_Sequence(_x, _y, _group = noone) {
var path = "";
if(NODE_NEW_MANUAL) {
path = get_open_filenames_compat("image|*.png;*.jpg", "");
@ -6,20 +6,22 @@ function Node_create_Image_Sequence(_x, _y, _group = noone) { #region
if(path == "") return noone;
}
var node = new Node_Image_Sequence(_x, _y, _group);
var node = new Node_Image_Sequence(_x, _y, _group).skipDefault();
var paths = string_splice(path, "\n");
node.inputs[| 0].setValue(paths);
if(NODE_NEW_MANUAL) node.doUpdate();
return node;
} #endregion
}
function Node_create_Image_Sequence_path(_x, _y, _path) { #region
var node = new Node_Image_Sequence(_x, _y, PANEL_GRAPH.getCurrentContext());
function Node_create_Image_Sequence_path(_x, _y, _path) {
var node = new Node_Image_Sequence(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(_path);
node.doUpdate();
return node;
} #endregion
}
enum CANVAS_SIZE {
individual,
@ -81,7 +83,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
var paths = paths_to_array_ext(path);
inputs[| 0].setValue(path);
if(updatePaths(paths)) {
if(updatePaths()) {
doUpdate();
return true;
}
@ -93,25 +95,26 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
insp1UpdateIcon = [ THEME.refresh_icon, 1, COLORS._main_value_positive ];
static onInspector1Update = function() {
updatePaths(path_get(getInputData(0)));
updatePaths();
triggerRender();
}
function updatePaths(paths = path_current) {
function updatePaths() {
var _paths = getInputData(0);
var paths = path_get(_paths);
path_current = array_clone(paths);
for(var i = 0; i < array_length(spr); i++) {
if(spr[i] && sprite_exists(spr[i]))
sprite_delete(spr[i]);
}
spr = [];
path_current = [];
for( var i = 0, n = array_length(paths); i < n; i++ ) {
var path = path_get(paths[i]);
var path = paths[i];
if(path == -1) continue;
array_push(path_current, path);
var ext = string_lower(filename_ext(path));
setDisplayName(filename_name_only(path));
edit_time = max(edit_time, file_get_modify_s(path));
@ -152,10 +155,10 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
}
static update = function(frame = CURRENT_FRAME) {
var path = path_get(getInputData(0));
var path = inputs[| 0].getValue();
if(!array_equals(path_current, path))
updatePaths(path);
updatePaths();
var pad = getInputData(1);
var can = getInputData(2);
@ -170,6 +173,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
var amo = array_length(spr);
for(var i = amo; i < array_length(surfs); i++)
surface_free(surfs[i]);
array_resize(surfs, amo);
for(var i = 0; i < amo; i++) {
@ -179,19 +183,17 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
switch(can) {
case CANVAS_SIZE.minimum :
if(ww == -1) ww = _w;
else ww = min(ww, _w);
if(hh == -1) hh = _h;
else hh = min(hh, _h);
ww = ww == -1? _w : min(ww, _w);
hh = hh == -1? _h : min(hh, _h);
break;
case CANVAS_SIZE.maximum :
if(ww == -1) ww = _w;
else ww = max(ww, _w);
if(hh == -1) hh = _h;
else hh = max(hh, _h);
ww = ww == -1? _w : max(ww, _w);
hh = hh == -1? _h : max(hh, _h);
break;
}
}
_ww = ww;
_hh = hh;
ww += pad[0] + pad[2];
@ -212,6 +214,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
BLEND_NORMAL;
surface_reset_target();
break;
case CANVAS_SIZE.maximum :
case CANVAS_SIZE.minimum :
surfs[i] = surface_verify(surfs[i], ww, hh, attrDepth());
@ -229,6 +232,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
draw_sprite_ext(_spr, 0, sw, sh, ss, ss, 0, c_white, 1);
BLEND_NORMAL;
surface_reset_target();
} else {
var xx = (ww - _w) / 2;
var yy = (hh - _h) / 2;

View file

@ -6,7 +6,7 @@ function Node_create_Json_File_Read(_x, _y, _group = noone) {
if(path == "") return noone;
}
var node = new Node_Json_File_Read(_x, _y, _group);
var node = new Node_Json_File_Read(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
@ -16,7 +16,7 @@ function Node_create_Json_File_Read(_x, _y, _group = noone) {
function Node_create_Json_File_Read_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_Json_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_Json_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();

View file

@ -13,7 +13,7 @@ enum LOGIC_OPERATOR {
function Node_create_Logic(_x, _y, _group = noone, _param = {}) {
var query = struct_try_get(_param, "query", "");
var node = new Node_Logic(_x, _y, _group);
var node = new Node_Logic(_x, _y, _group).skipDefault();
var ind = -1;
switch(query) {

View file

@ -33,7 +33,7 @@ enum MATH_OPERATOR {
function Node_create_Math(_x, _y, _group = noone, _param = {}) {
var query = struct_try_get(_param, "query", "");
var node = new Node_Math(_x, _y, _group);
var node = new Node_Math(_x, _y, _group).skipDefault();
switch(query) { #region
case "add" :

View file

@ -2,7 +2,7 @@
global.node_plot_linear_keys = [ "plot", "bar chart", "graph", "waveform" ];
function Node_create_Plot_Linear(_x, _y, _group = noone, _param = {}) {
var node = new Node_Plot_Linear(_x, _y, _group);
var node = new Node_Plot_Linear(_x, _y, _group).skipDefault();
var query = struct_try_get(_param, "query", "");
switch(query) {

View file

@ -1,7 +1,7 @@
global.node_repeat_keys = [ "repeat polar", "repeat circular" ];
function Node_create_Repeat(_x, _y, _group = noone, _param = {}) {
var _node = new Node_Repeat(_x, _y, _group);
var _node = new Node_Repeat(_x, _y, _group).skipDefault();
var query = struct_try_get(_param, "query", "");
switch(query) {

View file

@ -1,6 +1,6 @@
function Node_create_Scale_Algo(_x, _y, _group = noone, _param = {}) {
var query = struct_try_get(_param, "query", "");
var node = new Node_Scale_Algo(_x, _y, _group);
var node = new Node_Scale_Algo(_x, _y, _group).skipDefault();
switch(query) {
case "scale2x" : node.inputs[| 1].setValue(0); break;

View file

@ -5,9 +5,9 @@
"arrow", "gear",
];
function Node_create_Shape(_x, _y, _group = noone, _param = {}) { #region
function Node_create_Shape(_x, _y, _group = noone, _param = {}) {
var query = struct_try_get(_param, "query", "");
var node = new Node_Shape(_x, _y, _group);
var node = new Node_Shape(_x, _y, _group).skipDefault();
var ind = -1;
switch(query) {

View file

@ -12,7 +12,7 @@ enum STAT_OPERATOR {
function Node_create_Statistic(_x, _y, _group = noone, _param = {}) {
var query = struct_try_get(_param, "query", "");
var node = new Node_Statistic(_x, _y, _group);
var node = new Node_Statistic(_x, _y, _group).skipDefault();
var ind = -1;
switch(query) {

View file

@ -1,7 +1,7 @@
function Node_create_SVG_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_SVG(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_SVG(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
return node;

View file

@ -6,7 +6,7 @@ function Node_create_Text_File_Read(_x, _y, _group = noone) {
if(path == "") return noone;
}
var node = new Node_Text_File_Read(_x, _y, _group);
var node = new Node_Text_File_Read(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
@ -16,7 +16,7 @@ function Node_create_Text_File_Read(_x, _y, _group = noone) {
function Node_create_Text_File_Read_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_Text_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_Text_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();

View file

@ -37,18 +37,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
name_custom = false;
switch(type) {
case VALUE_TYPE.color :
if(is_array(_value)) {
for (var i = 0, n = array_length(_value); i < n; i++)
_value[i] = cola(_value[i]);
} else
_value = cola(_value);
break;
case VALUE_TYPE.PCXnode : accept_array = false; break;
}
if(struct_has(node, "inputMap")) {
if(_connect == JUNCTION_CONNECT.input) node.inputMap[? internalName] = self;
else if(_connect == JUNCTION_CONNECT.output) node.outputMap[? internalName] = self;
@ -90,11 +78,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
#region ---- animation ----
if(_type == VALUE_TYPE.color) {
if(is_array(_value)) {
for( var i = 0, n = array_length(_value); i < n; i++ )
_value[i] = cola(_value[i], _color_get_alpha(_value[i]));
} else
_value = cola(_value, _color_get_alpha(_value));
if(is_array(_value)) for( var i = 0, n = array_length(_value); i < n; i++ ) _value[i] = cola(_value[i]);
else _value = cola(_value);
}
key_inter = CURVE_TYPE.linear;
@ -983,37 +968,33 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
/////============== GET =============
static valueProcess = function(value, nodeFrom = undefined, applyUnit = true, arrIndex = 0) { #region
static valueProcess = function(value, nodeFrom = undefined, applyUnit = true, arrIndex = 0) {
var typeFrom = nodeFrom == undefined? VALUE_TYPE.any : nodeFrom.type;
if(applyUnit && display_type == VALUE_DISPLAY.d3quarternion && display_data.angle_display == QUARTERNION_DISPLAY.euler)
return quarternionFromEuler(value[0], value[1], value[2]);
#region color compatibility [ color, palette, gradient ]
if(type == VALUE_TYPE.gradient && typeFrom == VALUE_TYPE.color) {
if(is_instanceof(value, gradientObject))
return value;
if(type == VALUE_TYPE.gradient && typeFrom == VALUE_TYPE.color) { // color compatibility [ color, palette, gradient ]
if(is_instanceof(value, gradientObject)) return value;
if(is_array(value)) {
var amo = array_length(value);
var grad = array_create(amo);
for( var i = 0; i < amo; i++ )
grad[i] = new gradientKey(i / amo, value[i]);
var g = new gradientObject();
g.keys = grad;
return g;
}
if(is_real(value)) return new gradientObject(value);
return new gradientObject(0);
return is_real(value)? new gradientObject(value) : new gradientObject(cola(c_black));
}
if(display_type == VALUE_DISPLAY.palette && !is_array(value)) {
return [ value ];
}
#endregion
if(display_type == VALUE_DISPLAY.palette && !is_array(value)) return [ value ];
if(display_type == VALUE_DISPLAY.area) { #region
if(display_type == VALUE_DISPLAY.area) {
if(!is_undefined(nodeFrom) && struct_has(nodeFrom.display_data, "onSurfaceSize")) {
var surf = nodeFrom.display_data.onSurfaceSize();
@ -1047,51 +1028,40 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
}
return applyUnit? unit.apply(value, arrIndex) : value;
} #endregion
if(type == VALUE_TYPE.text) { #region
switch(display_type) {
case VALUE_DISPLAY.text_array : return value;
default: return string_real(value);
}
} #endregion
if((typeFrom == VALUE_TYPE.integer || typeFrom == VALUE_TYPE.float || typeFrom == VALUE_TYPE.boolean) && type == VALUE_TYPE.color)
return value >= 1? value : make_color_hsv(0, 0, value * 255);
if(type == VALUE_TYPE.text) return display_type == VALUE_DISPLAY.text_array? value : string_real(value);
if(typeFrom == VALUE_TYPE.boolean && type == VALUE_TYPE.text)
return value? "true" : "false";
if(typeNumeric(typeFrom) && type == VALUE_TYPE.color) return value >= 1? value : make_color_rgb(value * 255, value * 255, value * 255);
if(type == VALUE_TYPE.integer || type == VALUE_TYPE.float) { #region
if(typeFrom == VALUE_TYPE.text)
value = toNumber(value);
if(typeFrom == VALUE_TYPE.boolean && type == VALUE_TYPE.text) return value? "true" : "false";
if(type == VALUE_TYPE.integer || type == VALUE_TYPE.float) {
if(typeFrom == VALUE_TYPE.text) value = toNumber(value);
value = applyUnit? unit.apply(value, arrIndex) : value;
if(value_tag == "dimension") {
for( var i = 0, n = array_length(value); i < n; i++ )
value[i] = clamp(value[i], 0, 8192);
}
if(value_tag == "dimension")
for( var i = 0, n = array_length(value); i < n; i++ ) value[i] = clamp(value[i], 0, 8192);
if(validator != noone)
value = validator.validate(value);
if(validator != noone) value = validator.validate(value);
return value;
} #endregion
}
if(type == VALUE_TYPE.surface && connect_type == JUNCTION_CONNECT.input && !is_surface(value) && def_val == USE_DEF)
return DEF_SURFACE;
return value;
} #endregion
}
static getStaticValue = function() { INLINE return ds_list_empty(animator.values)? 0 : animator.values[| 0].value; }
static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) { //// Get value
draw_junction_index = type;
if(type == VALUE_TYPE.trigger)
return _getValue(_time, false, 0, false);
//global.cache_call++;
if(useCache && use_cache) {
var cache_hit = cache_value[0];
cache_hit &= !isActiveDynamic(_time) || cache_value[1] == _time;
@ -1100,23 +1070,15 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
cache_hit &= connect_type == JUNCTION_CONNECT.input;
cache_hit &= unit.reference == noone || unit.mode == VALUE_UNIT.constant;
if(cache_hit) {
return cache_value[2];
}
if(cache_hit) return cache_value[2];
}
var val = _getValue(_time, applyUnit, arrIndex, log);
if(!accept_array && array_get_depth(val) > def_depth) {
noti_warning($"{name} does not accept array data.",, node);
return 0;
}
if(!accept_array && array_get_depth(val) > def_depth) { noti_warning($"{name} does not accept array data.", noone, node); return 0; }
draw_junction_index = type;
if(type == VALUE_TYPE.surface || type == VALUE_TYPE.any) {
var _sval = val;
if(is_array(_sval) && !array_empty(_sval))
_sval = _sval[0];
var _sval = array_valid(val)? val[0] : val;
if(is_instanceof(_sval, SurfaceAtlas))
draw_junction_index = VALUE_TYPE.atlas;
@ -1142,8 +1104,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
var typ = nod.type;
var dis = nod.display_type;
if(connect_type == JUNCTION_CONNECT.output)
return val;
if(connect_type == JUNCTION_CONNECT.output) return val;
if(typ == VALUE_TYPE.surface && (type == VALUE_TYPE.integer || type == VALUE_TYPE.float)) { // Dimension conversion
if(is_array(val)) {
@ -1194,14 +1155,17 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
var _val = array_create(array_length(val));
for( var i = 0, n = array_length(val); i < n; i++ )
_val[i] = valueProcess(val[i], nod, applyUnit, arrIndex);
return _val;
}
return valueProcess(val, nod, applyUnit, arrIndex);
var _val = valueProcess(val, nod, applyUnit, arrIndex);
return _val;
}
static getValueRecursive = function(arr = __curr_get_val, _time = CURRENT_FRAME) { #region
static getValueRecursive = function(arr = __curr_get_val, _time = CURRENT_FRAME) {
arr[@ 0] = __getAnimValue(_time);
arr[@ 1] = self;
@ -1241,7 +1205,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
global.EVALUATE_HEAD = noone;
}
} #endregion
}
static arrayBalance = function(val) { #region
if(!is_array(def_val))
@ -1386,17 +1350,18 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
str = $"File not exist: {path}";
}
break;
case VALUE_DISPLAY.path_array:
var paths = animator.getValue();
if(is_array(paths)) {
for( var i = 0, n = array_length(paths); i < n; i++ ) {
if(path_get(paths[i]) != -1) continue;
value_validation = VALIDATION.error;
str = "File not exist: " + string(paths[i]);
str = $"File not exist: {paths[i]}";
}
} else {
value_validation = VALIDATION.error;
str = "File not exist: " + string(paths);
str = $"File not exist: {paths}";
}
break;
}
@ -1422,10 +1387,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
return self;
} #endregion
static setValue = function(val = 0, record = true, time = CURRENT_FRAME, _update = true) { #region ////Set value
static setValue = function(val = 0, record = true, time = CURRENT_FRAME, _update = true) { ////Set value
val = unit.invApply(val);
return setValueDirect(val, noone, record, time, _update);
} #endregion
}
static overrideValue = function(_val) { #region
ds_list_clear(animator.values);

View file

@ -384,6 +384,17 @@ function value_type_direct_settable(type) {
return false;
}
function typeNumeric(type) {
switch(type) {
case VALUE_TYPE.integer :
case VALUE_TYPE.float :
case VALUE_TYPE.boolean :
return true;
}
return false;
}
function typeArray(_type) {
switch(_type) {
case VALUE_DISPLAY.range :

View file

@ -6,7 +6,7 @@ function Node_create_WAV_File_Read(_x, _y, _group = noone) {
if(path == "") return noone;
}
var node = new Node_WAV_File_Read(_x, _y, _group);
var node = new Node_WAV_File_Read(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
if(NODE_NEW_MANUAL) node.doUpdate();
@ -16,7 +16,7 @@ function Node_create_WAV_File_Read(_x, _y, _group = noone) {
function Node_create_WAV_File_Read_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_WAV_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_WAV_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();

View file

@ -6,7 +6,7 @@ function Node_create_XML_File_Read(_x, _y, _group = noone) {
if(path == "") return noone;
}
var node = new Node_XML_File_Read(_x, _y, _group);
var node = new Node_XML_File_Read(_x, _y, _group).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();
@ -16,7 +16,7 @@ function Node_create_XML_File_Read(_x, _y, _group = noone) {
function Node_create_XML_File_Read_path(_x, _y, path) {
if(!file_exists_empty(path)) return noone;
var node = new Node_XML_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext());
var node = new Node_XML_File_Read(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(path);
node.doUpdate();

View file

@ -599,12 +599,12 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
if(_outp == -1) return;
var _canvas = nodeBuild("Node_Canvas", _node.x, _node.y + _node.h + 64);
var _canvas = nodeBuild("Node_Canvas", _node.x, _node.y + _node.h + 64).skipDefault();
_canvas.inputs[| 0].setValue([surface_get_width_safe(surf), surface_get_height_safe(surf)]);
_canvas.inputs[| 5].setValue(true);
var _blend = new Node_Blend(_node.x + _node.w + 64, _node.y, getCurrentContext());
var _blend = new Node_Blend(_node.x + _node.w + 64, _node.y, getCurrentContext()).skipDefault();
_blend.inputs[| 0].setFrom(_outp);
_blend.inputs[| 1].setFrom(_canvas.outputs[| 0]);
} #endregion
@ -2557,12 +2557,12 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
var _j1 = _n1.outputs[| 0];
if(_j0.type == VALUE_TYPE.surface && _j1.type == VALUE_TYPE.surface) {
var _blend = new Node_Blend(cx, cy, getCurrentContext());
var _blend = new Node_Blend(cx, cy, getCurrentContext()).skipDefault();
_blend.inputs[| 0].setFrom(_j0);
_blend.inputs[| 1].setFrom(_j1);
} else if((_j0.type == VALUE_TYPE.integer || _j0.type == VALUE_TYPE.float) && (_j1.type == VALUE_TYPE.integer || _j1.type == VALUE_TYPE.float)) {
var _blend = new Node_Math(cx, cy, getCurrentContext());
var _blend = new Node_Math(cx, cy, getCurrentContext()).skipDefault();
_blend.inputs[| 1].setFrom(_j0);
_blend.inputs[| 2].setFrom(_j1);
@ -2596,7 +2596,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
cx = cx + 160;
cy = round(cy / len / 32) * 32;
var _compose = new Node_Composite(cx, cy, getCurrentContext());
var _compose = new Node_Composite(cx, cy, getCurrentContext()).skipDefault();
repeat(len) {
var _node = ds_priority_delete_min(pr);
@ -2670,7 +2670,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
x1 += 64;
y1 += 64;
var f = new Node_Frame(x0, y0, getCurrentContext());
var f = new Node_Frame(x0, y0, getCurrentContext()).skipDefault();
f.inputs[| 0].setValue([x1 - x0, y1 - y0]);
} #endregion
@ -3039,7 +3039,7 @@ function load_file_path(path, _x = undefined, _y = undefined) {
case "hex" :
case "gpl" :
case "pal" :
node = new Node_Palette(_x, _y, PANEL_GRAPH.getCurrentContext());
node = new Node_Palette(_x, _y, PANEL_GRAPH.getCurrentContext()).skipDefault();
node.inputs[| 0].setValue(loadPalette(p));
break;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

View file

@ -3,8 +3,8 @@
"%Name":"s_prop_gradient",
"bboxMode":0,
"bbox_bottom":31,
"bbox_left":4,
"bbox_right":15,
"bbox_left":1,
"bbox_right":10,
"bbox_top":0,
"collisionKind":1,
"collisionTolerance":0,
@ -12,18 +12,38 @@
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"3916cca5-48a7-4980-92b8-e234d77b249e","name":"3916cca5-48a7-4980-92b8-e234d77b249e","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"e1033abb-2a09-49ac-8c0d-992ede3811fc","name":"e1033abb-2a09-49ac-8c0d-992ede3811fc","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"bfa2cff1-f342-43c9-b3bf-826f4790763a","name":"bfa2cff1-f342-43c9-b3bf-826f4790763a","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"367e8479-ae5d-4428-879d-533cca68b752","name":"367e8479-ae5d-4428-879d-533cca68b752","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"f13e49d0-ee4c-4e4e-a3f6-4e6273af3825","name":"f13e49d0-ee4c-4e4e-a3f6-4e6273af3825","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":32,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"8b768d86-1541-479d-ae70-2de7cdad3da1","blendMode":0,"displayName":"default","isLocked":false,"name":"8b768d86-1541-479d-ae70-2de7cdad3da1","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
{"$GMImageLayer":"","%Name":"e95fccf5-1212-41dd-9e1e-862a7cc497f1","blendMode":0,"displayName":"default","isLocked":false,"name":"e95fccf5-1212-41dd-9e1e-862a7cc497f1","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_prop_gradient",
"nineSlice":null,
"nineSlice":{
"$GMNineSliceData":"",
"bottom":6,
"enabled":true,
"guideColour":[4294902015,4294902015,4294902015,4294902015,],
"highlightColour":1728023040,
"highlightStyle":0,
"left":0,
"resourceType":"GMNineSliceData",
"resourceVersion":"2.0",
"right":0,
"tileMode":[
0,
0,
0,
0,
0,
],
"top":6,
},
"origin":4,
"parent":{
"name":"inspector",
@ -50,7 +70,7 @@
},
"eventStubScript":null,
"eventToFunction":{},
"length":2.0,
"length":3.0,
"lockOrigin":false,
"moments":{
"$KeyframeStore<MomentsEventKeyframe>":"",
@ -70,16 +90,19 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"3916cca5-48a7-4980-92b8-e234d77b249e","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"072efc3c-6465-4770-ab06-56a893427df6","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"bfa2cff1-f342-43c9-b3bf-826f4790763a","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"1612cf6e-172c-49c2-aa99-6990f2854a31","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"e1033abb-2a09-49ac-8c0d-992ede3811fc","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"f2497081-3bc3-47da-b74d-b9b7dfc01ae4","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"367e8479-ae5d-4428-879d-533cca68b752","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"e6215325-0cf7-4627-9eb3-8b48725f4c28","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"f13e49d0-ee4c-4e4e-a3f6-4e6273af3825","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"159cb629-fdc0-46a7-8c4d-9c0438837d0f","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,
"volume":1.0,
"xorigin":10,
"xorigin":6,
"yorigin":16,
},
"swatchColours":null,
@ -90,5 +113,5 @@
},
"type":0,
"VTile":false,
"width":20,
"width":12,
}