mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-13 13:50:29 +01:00
node chords
This commit is contained in:
parent
ff32d508f4
commit
83d6f87ade
166 changed files with 964 additions and 420 deletions
Binary file not shown.
Binary file not shown.
|
@ -244,7 +244,13 @@ event_inherited();
|
|||
array_push(_outputs, _new_node.outputs[i]);
|
||||
|
||||
if(PANEL_INSPECTOR) PANEL_INSPECTOR.setInspecting(_new_node);
|
||||
if(PANEL_GRAPH) PANEL_GRAPH.selectDragNode(_new_node, PREFERENCES.node_add_select);
|
||||
|
||||
if(PANEL_GRAPH) {
|
||||
if(PREFERENCES.node_add_select)
|
||||
PANEL_GRAPH.selectDragNode(_new_node, junction_called == noone);
|
||||
var _ins = instanceof(_new_node);
|
||||
if(struct_has(HOTKEYS, _ins)) FOCUS_STR = _ins;
|
||||
}
|
||||
|
||||
} else if(is_instanceof(_node, NodeAction)) { // NOT IMPLEMENTED
|
||||
var _dat = _node.build(node_target_x, node_target_y,, _param);
|
||||
|
|
|
@ -9,6 +9,7 @@ event_inherited();
|
|||
align = fa_center;
|
||||
text_pad = ui(8);
|
||||
item_pad = ui(8);
|
||||
minWidth = 0;
|
||||
widths = [];
|
||||
|
||||
draggable = false;
|
||||
|
@ -85,6 +86,7 @@ event_inherited();
|
|||
if(_emp) {
|
||||
array_push(widths, 0);
|
||||
} else {
|
||||
lw = max(minWidth, lw);
|
||||
array_push(widths, lw);
|
||||
ww += lw;
|
||||
hh = max(hh, lh);
|
||||
|
@ -106,6 +108,7 @@ event_inherited();
|
|||
lh += hght;
|
||||
}
|
||||
|
||||
lw = max(minWidth, lw);
|
||||
array_push(widths, _emp? 0 : lw);
|
||||
ww += lw;
|
||||
hh = max(hh, lh);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// @description
|
||||
var ev_id = async_load[? "id"];
|
||||
var ev_type = async_load[? "event_type"];
|
||||
print(ev_type)
|
||||
|
||||
switch(ev_type) {
|
||||
|
||||
|
|
|
@ -25,8 +25,9 @@ if(!LOADING && PROJECT.active && !PROJECT.safeMode) { //node step
|
|||
|
||||
#region hotkey
|
||||
if(!HOTKEY_BLOCK) {
|
||||
if(ds_map_exists(HOTKEYS, "")) {
|
||||
var l = HOTKEYS[? ""];
|
||||
|
||||
if(struct_has(HOTKEYS, 0)) {
|
||||
var l = HOTKEYS[$ 0];
|
||||
for(var i = 0, n = ds_list_size(l); i < n; i++) {
|
||||
var hotkey = l[| i];
|
||||
if(hotkey.key == 0 && hotkey.modi == MOD_KEY.none) continue;
|
||||
|
@ -36,8 +37,8 @@ if(!LOADING && PROJECT.active && !PROJECT.safeMode) { //node step
|
|||
}
|
||||
}
|
||||
|
||||
if(ds_map_exists(HOTKEYS, FOCUS_STR)) {
|
||||
var list = HOTKEYS[? FOCUS_STR];
|
||||
if(struct_has(HOTKEYS, FOCUS_STR)) {
|
||||
var list = HOTKEYS[$ FOCUS_STR];
|
||||
for(var i = 0, n = ds_list_size(list); i < n; i++) {
|
||||
var hotkey = list[| i];
|
||||
if(hotkey.key == 0 && hotkey.modi == MOD_KEY.none) continue;
|
||||
|
@ -46,6 +47,7 @@ if(!LOADING && PROJECT.active && !PROJECT.safeMode) { //node step
|
|||
hotkey.action();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HOTKEY_BLOCK = false;
|
||||
|
|
|
@ -2,7 +2,7 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
name = "3D Extrude";
|
||||
batch_output = false;
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Dimension(self));
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
name = "3D Plane";
|
||||
batch_output = false;
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Vec2("Render position", self, [ 0.5, 0.5 ]))
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Shader_Processor(_x, _y, _group = noone) : Node_Shader(_x, _y, _group) constructor {
|
||||
name = "";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
addShaderProp();
|
||||
|
||||
attribute_surface_depth();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
function Node_(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -12,4 +12,14 @@ function Node_Template(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
|||
static step = function() {}
|
||||
|
||||
static update = function() {}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("", " > Set", KEY_GROUP.numeric, MOD_KEY.none, () => { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
addHotkey("", " > ", "", MOD_KEY.none, () => { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(); });
|
||||
addHotkey("", " > Toggle", "", MOD_KEY.none, () => { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue((_n.inputs[1].getValue() + 1) % 2); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -343,6 +343,12 @@
|
|||
array_push(arr, value);
|
||||
}
|
||||
|
||||
function array_push_to_back_index(arr, index) {
|
||||
var _val = arr[index];
|
||||
array_delete(arr, index, 1);
|
||||
array_push(arr, _val);
|
||||
}
|
||||
|
||||
function array_spread(arr, _arr = [], _minDepth = 0) {
|
||||
INLINE
|
||||
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
function point_to_line(_px, _py, _x0, _y0, _x1, _y1) {
|
||||
function point_to_line(_px, _py, _x0, _y0, _x1, _y1, _p = undefined) {
|
||||
var l2 = sqr(_x0 - _x1) + sqr(_y0 - _y1);
|
||||
if (l2 == 0) return [ _x0, _y0 ];
|
||||
|
||||
var t = ((_px - _x0) * (_x1 - _x0) + (_py - _y0) * (_y1 - _y0)) / l2;
|
||||
t = clamp(t, 0, 1);
|
||||
return [ lerp(_x0, _x1, t), lerp(_y0, _y1, t) ];
|
||||
|
||||
_p ??= [ 0, 0 ];
|
||||
_p[@ 0] = lerp(_x0, _x1, t);
|
||||
_p[@ 1] = lerp(_y0, _y1, t);
|
||||
return _p;
|
||||
}
|
||||
|
||||
function distance_to_line(_px, _py, _x0, _y0, _x1, _y1) {
|
||||
|
@ -18,10 +22,28 @@ function distance_to_line(_px, _py, _x0, _y0, _x1, _y1) {
|
|||
return dd;
|
||||
}
|
||||
|
||||
function distance_to_line_infinite(px, py, x0, y0, x1, y1) {
|
||||
return abs((x1 - x0) * (y0 - py) - (x0 - px) * (y1 - y0)) / sqrt(sqr(x1 - x0) + sqr(y1 - y0));
|
||||
function point_closer(_p, _dist, _px, _py, _x0, _y0, _x1, _y1) {
|
||||
var l2 = sqr(_x0 - _x1) + sqr(_y0 - _y1);
|
||||
if (l2 == 0) return point_distance(_px, _py, _x0, _y0);
|
||||
|
||||
var t = ((_px - _x0) * (_x1 - _x0) + (_py - _y0) * (_y1 - _y0)) / l2;
|
||||
t = clamp(t, 0, 1);
|
||||
|
||||
var cx = lerp(_x0, _x1, t);
|
||||
var cy = lerp(_y0, _y1, t);
|
||||
var dx = _px - cx;
|
||||
var dy = _py - cy;
|
||||
var dd = dx * dx + dy * dy;
|
||||
|
||||
if(dd >= _dist) return _dist;
|
||||
|
||||
_p[@ 0] = cx;
|
||||
_p[@ 1] = cy;
|
||||
return dd;
|
||||
}
|
||||
|
||||
function distance_to_line_infinite(px, py, x0, y0, x1, y1) { return abs((x1 - x0) * (y0 - py) - (x0 - px) * (y1 - y0)) / sqrt(sqr(x1 - x0) + sqr(y1 - y0)); }
|
||||
|
||||
function point_project_line(px, py, l0x, l0y, l1x, l1y) {
|
||||
var mag = point_distance(l0x, l0y, l1x, l1y);
|
||||
var dir = point_direction(l0x, l0y, l1x, l1y);
|
||||
|
|
|
@ -86,11 +86,11 @@ function draw_line_curve_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_whit
|
|||
}
|
||||
}
|
||||
|
||||
function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) {
|
||||
function point_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s, _p = undefined) {
|
||||
var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 32 * PROJECT.graphConnection.line_sample);
|
||||
sample = clamp(sample, 2, 128);
|
||||
|
||||
var dist = 999999;
|
||||
var dist = infinity;
|
||||
var ox, oy, nx, ny, t, it;
|
||||
|
||||
var x2 = lerp(x0, x1, 0. - sign(x1 - x0) * 0.2);
|
||||
|
@ -114,21 +114,20 @@ function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) {
|
|||
+ 4 * y3 * power(it, 3) * power(t, 1)
|
||||
+ y1 * power(it, 4);
|
||||
|
||||
if(i)
|
||||
dist = min(dist, distance_to_line(mx, my, ox, oy, nx, ny));
|
||||
if(i) dist = point_closer(_p, dist, mx, my, ox, oy, nx, ny);
|
||||
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
|
||||
return dist;
|
||||
return _p;
|
||||
}
|
||||
|
||||
function distance_to_curve_corner(mx, my, x0, y0, x1, y1, _s) {
|
||||
function point_to_curve_corner(mx, my, x0, y0, x1, y1, _s, _p = undefined) {
|
||||
var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 32 * PROJECT.graphConnection.line_sample);
|
||||
sample = clamp(sample, 2, 128);
|
||||
|
||||
var dist = 999999;
|
||||
var dist = infinity;
|
||||
var ox, oy, nx, ny, t, it;
|
||||
|
||||
var x2 = lerp(x0, x1, 0.9);
|
||||
|
@ -149,13 +148,12 @@ function distance_to_curve_corner(mx, my, x0, y0, x1, y1, _s) {
|
|||
+ 3 * y2 * power(it, 1) * power(t, 2)
|
||||
+ 3 * y3 * power(it, 2) * power(t, 1)
|
||||
+ y1 * power(it, 3);
|
||||
|
||||
if(i)
|
||||
dist = min(dist, distance_to_line(mx, my, ox, oy, nx, ny));
|
||||
|
||||
if(i) dist = point_closer(_p, dist, mx, my, ox, oy, nx, ny);
|
||||
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
|
||||
return dist;
|
||||
return _p;
|
||||
}
|
|
@ -94,29 +94,29 @@ function draw_line_elbow_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_whit
|
|||
draw_corner(x1 - corner * sx, y0, x1, y0, x1, y0 + corner * sy, thick, colc, sample);
|
||||
}
|
||||
|
||||
function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s) {
|
||||
var inv = x1 <= x0;
|
||||
var xx0 = x0;
|
||||
var xx1 = x1;
|
||||
function point_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, _p = undefined) {
|
||||
var inv = x1 <= x0;
|
||||
var xx0 = x0;
|
||||
var xx1 = x1;
|
||||
var dist = infinity;
|
||||
|
||||
if(y0 != y1 && inv) {
|
||||
var dist = distance_to_line(mx, my, xx0, y0, xx0, cy);
|
||||
dist = min(dist, distance_to_line(mx, my, xx0, cy, xx1, cy));
|
||||
dist = min(dist, distance_to_line(mx, my, xx1, cy, xx1, y1));
|
||||
|
||||
return dist;
|
||||
dist = point_closer(_p, dist, mx, my, xx0, y0, xx0, cy);
|
||||
dist = point_closer(_p, dist, mx, my, xx0, cy, xx1, cy);
|
||||
dist = point_closer(_p, dist, mx, my, xx1, cy, xx1, y1);
|
||||
return _p;
|
||||
|
||||
} else {
|
||||
var dist = distance_to_line(mx, my, cx, y0, cx, y1);
|
||||
dist = min(dist, distance_to_line(mx, my, x0, y0, cx, y0));
|
||||
dist = min(dist, distance_to_line(mx, my, cx, y1, x1, y1));
|
||||
|
||||
return dist;
|
||||
dist = point_closer(_p, dist, mx, my, cx, y0, cx, y1);
|
||||
dist = point_closer(_p, dist, mx, my, x0, y0, cx, y0);
|
||||
dist = point_closer(_p, dist, mx, my, cx, y1, x1, y1);
|
||||
return _p;
|
||||
}
|
||||
}
|
||||
|
||||
function distance_to_elbow_corner(mx, my, x0, y0, x1, y1) {
|
||||
var dist = distance_to_line(mx, my, x0, y0, x1, y0);
|
||||
dist = min(dist, distance_to_line(mx, my, x1, y0, x1, y1));
|
||||
|
||||
return dist;
|
||||
function point_to_elbow_corner(mx, my, x0, y0, x1, y1, _p = undefined) {
|
||||
var dist = infinity;
|
||||
dist = point_closer(_p, dist, mx, my, x0, y0, x1, y0);
|
||||
dist = point_closer(_p, dist, mx, my, x1, y0, x1, y1);
|
||||
return _p;
|
||||
}
|
|
@ -244,7 +244,7 @@ function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c
|
|||
|
||||
}
|
||||
|
||||
function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, indexIn, indexOut) {
|
||||
function point_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, indexIn, indexOut, _p = undefined) {
|
||||
var iy = sign(y1 - y0);
|
||||
var xx0 = x0 + extend * _s;
|
||||
var xx1 = x1 - extend * _s;
|
||||
|
@ -263,7 +263,8 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde
|
|||
xx0 = x0 + extend * _s * indexIn;
|
||||
xx1 = x1 - extend * _s * indexOut;
|
||||
|
||||
var dist = 9999999;
|
||||
var dist = infinity;
|
||||
|
||||
if(inv) {
|
||||
var ofl = cy < _y0 || cy > _y1;
|
||||
var iy = sign(y1 - y0);
|
||||
|
@ -272,8 +273,8 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde
|
|||
var ix = sign(xx0 - xx1);
|
||||
var rrx = abs(xx0 - xx1);
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, x0, y0, xx0, y0));
|
||||
dist = min(dist, distance_to_line(mx, my, xx1, y1, x1, y1));
|
||||
dist = point_closer(_p, dist, mx, my, x0, y0, xx0, y0);
|
||||
dist = point_closer(_p, dist, mx, my, xx1, y1, x1, y1);
|
||||
|
||||
if(xx1 > xx0 && !ofl) {
|
||||
var top = abs(cy - y0) < rrx / 2;
|
||||
|
@ -282,23 +283,23 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde
|
|||
if(top) {
|
||||
var cor = (cy - y0) * 2;
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, xx0, y0, xx1 - cor * iy, y0));
|
||||
dist = min(dist, distance_to_line(mx, my, xx1, y0 + cor, xx1, y1));
|
||||
dist = point_closer(_p, dist, mx, my, xx0, y0, xx1 - cor * iy, y0);
|
||||
dist = point_closer(_p, dist, mx, my, xx1, y0 + cor, xx1, y1);
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, xx1 - cor * iy, y0, xx1, y0 + cor));
|
||||
dist = point_closer(_p, dist, mx, my, xx1 - cor * iy, y0, xx1, y0 + cor);
|
||||
} else if(bot) {
|
||||
var cor = (y1 - cy) * 2;
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, xx0, y0, xx0, y1 - cor));
|
||||
dist = min(dist, distance_to_line(mx, my, xx0 + cor * iy, y1, xx1, y1));
|
||||
dist = point_closer(_p, dist, mx, my, xx0, y0, xx0, y1 - cor);
|
||||
dist = point_closer(_p, dist, mx, my, xx0 + cor * iy, y1, xx1, y1);
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, xx0, y1 - cor, xx0 + cor * iy, y1));
|
||||
dist = point_closer(_p, dist, mx, my, xx0, y1 - cor, xx0 + cor * iy, y1);
|
||||
} else {
|
||||
var cor = rrx / 2;
|
||||
dist = min(dist, distance_to_line(mx, my, xx0, y0, xx0, cy - cor * iy0));
|
||||
dist = min(dist, distance_to_line(mx, my, xx1, cy + cor * iy1, xx1, y1));
|
||||
dist = point_closer(_p, dist, mx, my, xx0, y0, xx0, cy - cor * iy0);
|
||||
dist = point_closer(_p, dist, mx, my, xx1, cy + cor * iy1, xx1, y1);
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, xx0, cy - cor * sign(y1 - y0), xx1, cy + cor * sign(y1 - y0)));
|
||||
dist = point_closer(_p, dist, mx, my, xx0, cy - cor * sign(y1 - y0), xx1, cy + cor * sign(y1 - y0));
|
||||
}
|
||||
} else {
|
||||
var cut0 = min(abs(cy - yy0) / 2, abs(xx1 - xx0) / 2, ofl? 16 * _s : 9999);
|
||||
|
@ -313,23 +314,24 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde
|
|||
var crX3 = xx1;
|
||||
var crY3 = cy + cut1 * iy1;
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, x0, y0, xx0, y0));
|
||||
dist = min(dist, distance_to_line(mx, my, xx1, y1, x1, y1));
|
||||
dist = point_closer(_p, dist, mx, my, x0, y0, xx0, y0);
|
||||
dist = point_closer(_p, dist, mx, my, xx1, y1, x1, y1);
|
||||
|
||||
if(abs(crX0 - crX3) == abs(crY0 - crY3)) {
|
||||
dist = min(dist, distance_to_line(mx, my, crX0, y0, crX0, crY0));
|
||||
dist = min(dist, distance_to_line(mx, my, crX3, y1, crX3, crY3));
|
||||
dist = min(dist, distance_to_line(mx, my, crX0, crY0, crX3, crY3));
|
||||
dist = point_closer(_p, dist, mx, my, crX0, y0, crX0, crY0);
|
||||
dist = point_closer(_p, dist, mx, my, crX3, y1, crX3, crY3);
|
||||
dist = point_closer(_p, dist, mx, my, crX0, crY0, crX3, crY3);
|
||||
} else {
|
||||
dist = min(dist, distance_to_line(mx, my, crX0, y0, crX0, crY0));
|
||||
dist = min(dist, distance_to_line(mx, my, crX1, crY1, crX2, crY2));
|
||||
dist = min(dist, distance_to_line(mx, my, crX3, crY3, crX3, y1));
|
||||
dist = point_closer(_p, dist, mx, my, crX0, y0, crX0, crY0);
|
||||
dist = point_closer(_p, dist, mx, my, crX1, crY1, crX2, crY2);
|
||||
dist = point_closer(_p, dist, mx, my, crX3, crY3, crX3, y1);
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, crX0, crY0, crX1, crY1));
|
||||
dist = min(dist, distance_to_line(mx, my, crX2, crY2, crX3, crY3));
|
||||
dist = point_closer(_p, dist, mx, my, crX0, crY0, crX1, crY1);
|
||||
dist = point_closer(_p, dist, mx, my, crX2, crY2, crX3, crY3);
|
||||
}
|
||||
}
|
||||
return dist;
|
||||
return _p;
|
||||
|
||||
} else {
|
||||
cx = clamp(cx, _x0 + abs(ry) / 2, _x1 - abs(ry) / 2);
|
||||
cy = clamp(cy, _y0 + abs(rx) / 2, _y1 - abs(rx) / 2);
|
||||
|
@ -338,23 +340,23 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde
|
|||
var _xc0 = clamp(cx - (ry / 2) * sign(x1 - x0), _x0, _x1);
|
||||
var _xc1 = clamp(cx + (ry / 2) * sign(x1 - x0), _x0, _x1);
|
||||
|
||||
dist = min(dist, distance_to_line(mx, my, x0, y0, _xc0, y0));
|
||||
dist = min(dist, distance_to_line(mx, my, _xc0, y0, _xc1, y1));
|
||||
dist = min(dist, distance_to_line(mx, my, _xc1, y1, x1, y1));
|
||||
dist = point_closer(_p, dist, mx, my, x0, y0, _xc0, y0);
|
||||
dist = point_closer(_p, dist, mx, my, _xc0, y0, _xc1, y1);
|
||||
dist = point_closer(_p, dist, mx, my, _xc1, y1, x1, y1);
|
||||
|
||||
return dist;
|
||||
return _p;
|
||||
}
|
||||
}
|
||||
|
||||
function distance_to_elbow_diag_corner(mx, my, x0, y0, x1, y1) {
|
||||
function point_to_elbow_diag_corner(mx, my, x0, y0, x1, y1, _p = undefined) {
|
||||
var sx = sign(x1 - x0);
|
||||
var sy = sign(y1 - y0);
|
||||
var diag = min(abs(x0 - x1) / 2, abs(y0 - y1) / 2);
|
||||
var dist = infinity;
|
||||
|
||||
var dist = 99999;
|
||||
dist = min(dist, distance_to_line(mx, my, x0, y0, x1 - diag * sx, y0));
|
||||
dist = min(dist, distance_to_line(mx, my, x1 - diag * sx, y0, x1, y0 + diag * sy));
|
||||
dist = min(dist, distance_to_line(mx, my, x1, y0 + diag * sy, x1, y1));
|
||||
dist = point_closer(_p, dist, mx, my, x0, y0, x1 - diag * sx, y0);
|
||||
dist = point_closer(_p, dist, mx, my, x1 - diag * sx, y0, x1, y0 + diag * sy);
|
||||
dist = point_closer(_p, dist, mx, my, x1, y0 + diag * sy, x1, y1);
|
||||
|
||||
return dist;
|
||||
return _p;
|
||||
}
|
|
@ -33,6 +33,11 @@ function draw_line_connect(x0, y0, x1, y1, _s = 1, thick = 1, c1 = c_white, c2 =
|
|||
function distance_to_linear_connection(mx, my, x0, y0, x1, y1, _s, extend) {
|
||||
var xx0 = x0 + extend * _s;
|
||||
var xx1 = x1 - extend * _s;
|
||||
|
||||
return distance_to_line(mx, my, xx0, y0, xx1, y1);
|
||||
}
|
||||
|
||||
function point_to_linear_connection(mx, my, x0, y0, x1, y1, _s, extend, _p = undefined) {
|
||||
var xx0 = x0 + extend * _s;
|
||||
var xx1 = x1 - extend * _s;
|
||||
return point_to_line(mx, my, xx0, y0, xx1, y1, _p);
|
||||
}
|
|
@ -44,10 +44,14 @@ function draw_line_feedback(x0, y0, x1, y1, th, c1, c0, _s) {
|
|||
function distance_line_feedback(mx, my, x0, y0, x1, y1, _s) {
|
||||
var _y0 = y0 - 12 * _s;
|
||||
var _y1 = y1 - 12 * _s;
|
||||
|
||||
var dd = 99999999;
|
||||
|
||||
dd = min(dd, distance_to_line(mx, my, x0, _y0, x1, _y1));
|
||||
var dd = distance_to_line(mx, my, x0, _y0, x1, _y1);
|
||||
|
||||
return dd;
|
||||
}
|
||||
|
||||
function point_to_line_feedback(mx, my, x0, y0, x1, y1, _s, _p = undefined) {
|
||||
var _y0 = y0 - 12 * _s;
|
||||
var _y1 = y1 - 12 * _s;
|
||||
var dd = point_to_line(mx, my, x0, _y0, x1, _y1, _p);
|
||||
return dd;
|
||||
}
|
|
@ -50,7 +50,7 @@ function functionObjectLite(_context, _name, _action, _param = noone) constructo
|
|||
|
||||
function registerFunction(_context, _name, _key, _mod, _action, _param = noone) { return new functionObject(_context, _name, _key, _mod, _action, _param); }
|
||||
function functionObject(_context, _name, _key, _mod, _action, _param = noone) constructor {
|
||||
hotkey = addHotkey(_context, _name, _key, _mod, _action);
|
||||
hotkey = addHotkey(_context == ""? 0 : _context, _name, _key, _mod, _action);
|
||||
context = _context;
|
||||
name = _name;
|
||||
dkey = _key;
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
var _lsp = _vsp[array_length(_vsp) - 1];
|
||||
NIGHTLY = string_length(_lsp) == 3;
|
||||
|
||||
HOTKEYS = ds_map_create();
|
||||
HOTKEYS = {};
|
||||
HOTKEY_CONTEXT = ds_list_create();
|
||||
HOTKEY_CONTEXT[| 0] = "";
|
||||
HOTKEY_CONTEXT[| 0] = 0;
|
||||
|
||||
globalvar TOOLTIP, DRAGGING, DIALOG_DEPTH_HOVER;
|
||||
global.KEYS = { download_links: "" };
|
||||
|
|
|
@ -111,9 +111,10 @@ function hotkeyObject(_context, _name, _key, _mod = MOD_KEY.none, _action = noon
|
|||
dKey = _key;
|
||||
dModi = _mod;
|
||||
|
||||
static full_name = function() /*=>*/ {return string_to_var(context == ""? $"global.{name}" : $"{context}.{name}")};
|
||||
static full_name = function() /*=>*/ {return string_to_var(context == ""? $"global.{name}" : $"{context}.{name}")};
|
||||
static get_key_name = function() /*=>*/ {return key_get_name(key, modi)};
|
||||
|
||||
static serialize = function() /*=>*/ { return { context, name, key, modi } }
|
||||
static serialize = function( ) /*=>*/ { return { context, name, key, modi } }
|
||||
static deserialize = function(l) /*=>*/ { if(!is_struct(l)) return; key = l.key; modi = l.modi; }
|
||||
if(struct_has(HOTKEYS_DATA, $"{context}_{name}")) deserialize(HOTKEYS_DATA[$ $"{context}_{name}"]);
|
||||
}
|
||||
|
@ -123,33 +124,33 @@ function addHotkey(_context, _name, _key, _mod, _action) {
|
|||
|
||||
var key = new hotkeyObject(_context, _name, _key, _mod, _action);
|
||||
|
||||
if(!ds_map_exists(HOTKEYS, _context)) {
|
||||
HOTKEYS[? _context] = ds_list_create();
|
||||
if(!struct_has(HOTKEYS, _context)) {
|
||||
HOTKEYS[$ _context] = ds_list_create();
|
||||
if(!ds_list_exist(HOTKEY_CONTEXT, _context))
|
||||
ds_list_add(HOTKEY_CONTEXT, _context);
|
||||
}
|
||||
|
||||
for(var i = 0; i < ds_list_size(HOTKEYS[? _context]); i++) {
|
||||
var hotkey = HOTKEYS[? _context][| i];
|
||||
for(var i = 0; i < ds_list_size(HOTKEYS[$ _context]); i++) {
|
||||
var hotkey = HOTKEYS[$ _context][| i];
|
||||
if(hotkey.name == key.name) {
|
||||
delete HOTKEYS[? _context][| i];
|
||||
HOTKEYS[? _context][| i] = key;
|
||||
delete HOTKEYS[$ _context][| i];
|
||||
HOTKEYS[$ _context][| i] = key;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(_context == "") ds_list_insert(HOTKEYS[? _context], 0, key);
|
||||
else ds_list_add(HOTKEYS[? _context], key);
|
||||
if(_context == "") ds_list_insert(HOTKEYS[$ _context], 0, key);
|
||||
else ds_list_add(HOTKEYS[$ _context], key);
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
function find_hotkey(_context, _name) {
|
||||
if(!ds_map_exists(HOTKEYS, _context)) return getToolHotkey(_context, _name);
|
||||
if(!struct_has(HOTKEYS, _context)) return getToolHotkey(_context, _name);
|
||||
|
||||
for(var j = 0; j < ds_list_size(HOTKEYS[? _context]); j++) {
|
||||
if(HOTKEYS[? _context][| j].name == _name)
|
||||
return HOTKEYS[? _context][| j];
|
||||
for(var j = 0; j < ds_list_size(HOTKEYS[$ _context]); j++) {
|
||||
if(HOTKEYS[$ _context][| j].name == _name)
|
||||
return HOTKEYS[$ _context][| j];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,7 +224,7 @@ function hotkey_draw(keyStr, _x, _y, _status = 0) {
|
|||
function hotkey_serialize() {
|
||||
var _context = [];
|
||||
for(var i = 0, n = ds_list_size(HOTKEY_CONTEXT); i < n; i++) {
|
||||
var ll = HOTKEYS[? HOTKEY_CONTEXT[| i]];
|
||||
var ll = HOTKEYS[$ HOTKEY_CONTEXT[| i]];
|
||||
|
||||
for(var j = 0, m = ds_list_size(ll); j < m; j++) {
|
||||
var _hk = ll[| j];
|
||||
|
|
|
@ -5,10 +5,31 @@
|
|||
shift = 1 << 1,
|
||||
alt = 1 << 2
|
||||
}
|
||||
|
||||
enum KEY_GROUP {
|
||||
base = 10000,
|
||||
numeric = 10001,
|
||||
}
|
||||
|
||||
global.KEY_STRING_MAP = ds_map_create();
|
||||
|
||||
global.KEY_STRING_MAP[? 0] = ""
|
||||
global.KEY_STRING_MAP[? 33] = "!"
|
||||
global.KEY_STRING_MAP[? 34] = "\""
|
||||
global.KEY_STRING_MAP[? 35] = "#"
|
||||
global.KEY_STRING_MAP[? 36] = "$"
|
||||
global.KEY_STRING_MAP[? 37] = "%"
|
||||
global.KEY_STRING_MAP[? 38] = "&"
|
||||
global.KEY_STRING_MAP[? 39] = "'"
|
||||
global.KEY_STRING_MAP[? 40] = "("
|
||||
global.KEY_STRING_MAP[? 41] = ")"
|
||||
global.KEY_STRING_MAP[? 42] = "*"
|
||||
global.KEY_STRING_MAP[? 43] = "+"
|
||||
global.KEY_STRING_MAP[? 44] = ","
|
||||
global.KEY_STRING_MAP[? 45] = "-"
|
||||
global.KEY_STRING_MAP[? 46] = "."
|
||||
global.KEY_STRING_MAP[? 47] = "/"
|
||||
|
||||
global.KEY_STRING_MAP[? 48] = "0"
|
||||
global.KEY_STRING_MAP[? 49] = "1"
|
||||
global.KEY_STRING_MAP[? 50] = "2"
|
||||
|
@ -19,7 +40,7 @@
|
|||
global.KEY_STRING_MAP[? 55] = "7"
|
||||
global.KEY_STRING_MAP[? 56] = "8"
|
||||
global.KEY_STRING_MAP[? 57] = "9"
|
||||
|
||||
|
||||
global.KEY_STRING_MAP[? 65] = "A"
|
||||
global.KEY_STRING_MAP[? 66] = "B"
|
||||
global.KEY_STRING_MAP[? 67] = "C"
|
||||
|
@ -79,6 +100,8 @@
|
|||
|
||||
global.KEY_STRING_MAP[? 223] = "`" // actually ` but that needs to be escaped
|
||||
|
||||
global.KEY_STRING_MAP[? KEY_GROUP.numeric] = "0-9"
|
||||
|
||||
function key_get_index(key) {
|
||||
if(key == "") return noone;
|
||||
|
||||
|
@ -94,8 +117,7 @@
|
|||
|
||||
#region get name
|
||||
function key_get_name(_key, _mod) {
|
||||
if(!is_real(_key) || (_key <= 0 && _mod == MOD_KEY.none))
|
||||
return "";
|
||||
if(!is_numeric(_key) || (_key <= 0 && _mod == MOD_KEY.none)) return "";
|
||||
|
||||
var dk = "";
|
||||
if(_mod & MOD_KEY.ctrl) dk += "Ctrl+";
|
||||
|
@ -139,16 +161,25 @@
|
|||
break;
|
||||
}
|
||||
|
||||
if(string_char_at(dk, string_length(dk)) == "+")
|
||||
dk = string_copy(dk, 1, string_length(dk) - 1);
|
||||
|
||||
dk = string_trim_end(dk, ["+"]);
|
||||
return dk;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
function key_press(_key, _mod = MOD_KEY.none) {
|
||||
if(WIDGET_CURRENT) return false;
|
||||
if(_mod == MOD_KEY.none && _key == noone) return false;
|
||||
|
||||
return (_key == noone || keyboard_check_pressed(_key)) && HOTKEY_MOD == _mod;
|
||||
var _modPress = HOTKEY_MOD == _mod;
|
||||
var _keyPress = false;
|
||||
|
||||
switch(_key) {
|
||||
case KEY_GROUP.numeric : _keyPress = keyboard_key >= ord("0") && keyboard_key <= ord("9") break;
|
||||
|
||||
case noone : _keyPress = true; break;
|
||||
default : _keyPress = keyboard_check_pressed(_key); break;
|
||||
}
|
||||
|
||||
return _keyPress && _modPress;
|
||||
}
|
|
@ -11,7 +11,7 @@ enum LIGHT_SHAPE_2D {
|
|||
function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "2D Light";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
typeList = [
|
||||
new scrollItem("Point", s_node_2d_light_shape, 0),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Nine Slice";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Dimension(self));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_FXAA(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "FXAA";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Alpha_Cutoff", "Minimum > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Alpha_Cutoff(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Alpha Cutoff";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Minimum", self, 0.2, "Any pixel with less alpha (more transparent) than this will be removed."))
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Alpha_Grey(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Alpha to Grey";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -14,7 +14,7 @@ function Node_Alpha_Hash(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
15, 47, 7, 39, 13, 45, 5, 37,
|
||||
63, 31, 55, 23, 61, 29, 53, 21];
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
|
||||
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
#region create
|
||||
|
||||
#endregion
|
||||
|
||||
function Node_Anim_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Evaluate Curve";
|
||||
update_on_frame = true;
|
||||
|
||||
setDimension(96, 48);
|
||||
|
||||
newInput(0, nodeValue_Curve("Curve", self, CURVE_DEF_01));
|
||||
newInput(0, nodeValue_Curve("Curve", self, CURVE_DEF_01));
|
||||
newInput(1, nodeValue_Float("Progress", self, 0))
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Atlas(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Pixel Expand";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -7,14 +7,14 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
newInput(1, nodeValue_Int("Width", self, 4096, "Amount of bits to extract."));
|
||||
|
||||
newInput(2, nodeValue_Float("Location", self, 0))
|
||||
.setDisplay(VALUE_DISPLAY._default, { unit: 0, side_button: button(function() {
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button: button(function() /*=>*/ {
|
||||
inputs[2].attributes.unit = (inputs[2].attributes.unit + 1) % 3;
|
||||
inputs[2].display_data.side_button.tooltip.index = inputs[2].attributes.unit;
|
||||
update();
|
||||
}).setTooltip( new tooltipSelector("Unit", [ "Bit", "Second", "Progress" ]) )
|
||||
.setIcon( THEME.unit_audio, [ function() { return inputs[2].attributes.unit; } ], COLORS._main_icon )
|
||||
.setIcon( THEME.unit_audio, [ function() /*=>*/ {return inputs[2].attributes.unit} ], COLORS._main_icon )
|
||||
}
|
||||
);
|
||||
inputs[2].attributes.unit = 0;
|
||||
|
||||
newInput(3, nodeValue_Enum_Button("Cursor location", self, 1, [ "Start", "Middle", "End" ]));
|
||||
|
||||
|
@ -41,6 +41,8 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
inputs[2].display_data.side_button.tooltip.index = inputs[2].attributes.unit;
|
||||
|
||||
var _aud = getInputData(0);
|
||||
if(!is_instanceof(_aud, audioObject)) return;
|
||||
|
||||
|
@ -95,7 +97,7 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
outputs[0].setValue(res);
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var _aud = getInputData(0);
|
||||
if(!is_instanceof(_aud, audioObject)) return;
|
||||
|
||||
|
@ -120,6 +122,6 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
draw_set_color(COLORS._main_accent);
|
||||
draw_line(dx + cr * ss, bbox.yc - 16 * _s, dx + cr * ss, bbox.yc + 16 * _s);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Average(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Average";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Surface("Mask", self));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Bend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Bend";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Bevel";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Int("Height", self, 4))
|
||||
.setMappable(11);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#region create
|
||||
|
||||
function Node_create_Blend(_x, _y, _group = noone, _param = {}) {
|
||||
var node = new Node_Blend(_x, _y, _group);
|
||||
node.skipDefault();
|
||||
|
@ -23,6 +22,24 @@
|
|||
stretch,
|
||||
tile
|
||||
}
|
||||
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blend", "Blend mode > Multiply", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(array_find(BLEND_TYPES, "Multiply")); });
|
||||
addHotkey("Node_Blend", "Blend mode > Add", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(array_find(BLEND_TYPES, "Add")); });
|
||||
addHotkey("Node_Blend", "Blend mode > Screen", "C", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(array_find(BLEND_TYPES, "Screen")); });
|
||||
addHotkey("Node_Blend", "Blend mode > Subtract", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(array_find(BLEND_TYPES, "Subtract")); });
|
||||
addHotkey("Node_Blend", "Preserve alpha > Toggle","P", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[9].setValue(!_n.inputs[9].getValue()); });
|
||||
|
||||
addHotkey("Node_Blend", "Inputs > Swap", "Q", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR
|
||||
var _i0 = _n.inputs[0].value_from;
|
||||
var _i1 = _n.inputs[1].value_from;
|
||||
if(_i0 == _i1) return;
|
||||
|
||||
_n.inputs[1].setFrom(_i0);
|
||||
_n.inputs[0].setFrom(_i1);
|
||||
});
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blend_Edge", "Width > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); });
|
||||
addHotkey("Node_Blend_Edge", "Types > Toggle", "T", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 3); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blend_Edge(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Blend Edge";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Width", self, 0.1))
|
||||
.setDisplay(VALUE_DISPLAY.slider)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Blobify(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Blobify";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Bloom", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Bloom";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
newInput(1, nodeValue_Float("Size", self, 3, "Bloom blur radius."))
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 0.1] });
|
||||
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Int("Size", self, 3))
|
||||
.setValidator(VV_min(0))
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur_Bokeh", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur_Bokeh(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Lens Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Strength", self, 0.2))
|
||||
.setMappable(8);
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur_Box", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur_Box(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Box Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Int("Size", self, 3))
|
||||
.setUnitRef(function(index) /*=>*/ {return getDimension(index)});
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur_Contrast", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur_Contrast(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Contrast Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Size", self, 3))
|
||||
.setValidator(VV_min(0))
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur_Directional", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Directional Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Strength", self, 0.2))
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 0.5, 0.001] })
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Blur_Path(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Path Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
newInput(1, nodeValue_PathNode("Blur Path", self, noone))
|
||||
.setVisible(true, true);
|
||||
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur_Radial", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) * 15); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur_Radial(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Radial Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Rotation("Strength", self, 45))
|
||||
.setMappable(10);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Blur_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Shape Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
newInput(1, nodeValue_Surface("Blur Shape", self));
|
||||
|
||||
newInput(2, nodeValue_Surface("Blur mask", self));
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur_Simple", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Non-Uniform Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
newInput(1, nodeValue_Float("Size", self, 3))
|
||||
.setValidator(VV_min(0))
|
||||
.setUnitRef(function(index) /*=>*/ {return getDimension(index)});
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur_Slope", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur_Slope(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Slope Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Strength", self, 4))
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 32, 0.1 ] })
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Blur_Zoom", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Zoom Blur";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Strength", self, 0.2))
|
||||
.setMappable(12);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Brush_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Brush";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_BW(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "BW";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Brightness", self, 0))
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01] })
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_Cache(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group) const
|
|||
name = "Cache";
|
||||
use_cache = CACHE_USE.auto;
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newOutput(0, nodeValue_Output("Cache surface", self, VALUE_TYPE.surface, noone));
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_Cache_Array(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group)
|
|||
name = "Cache Array";
|
||||
use_cache = CACHE_USE.manual;
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Int("Start frame", self, -1, "Frame index to start caching, set to -1 to start at the first frame."));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Chromatic_Aberration(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Chromatic Aberration";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Vec2("Center", self, [ 0.5, 0.5 ]))
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
name = "Color Adjust";
|
||||
batch_output = false;
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Brightness", self, 0))
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01 ] })
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Color_Remove", "Invert > Toggle", "I", MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[6].setValue(!_n.inputs[6].getValue()); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Color_Remove(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Remove Color";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Palette("Colors", self, array_clone(DEF_PALETTE)));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Replace Palette";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
newInput(1, nodeValue_Palette("From", self, array_clone(DEF_PALETTE)));
|
||||
|
||||
newInput(2, nodeValue_Palette("To", self, array_clone(DEF_PALETTE)));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Colorize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Colorize";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Gradient("Gradient", self, new gradientObject([ cola(c_black), cola(c_white) ])))
|
||||
.setMappable(11);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Replace Colors";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
newInput(1, nodeValue_Palette("Palette from", self, []));
|
||||
|
||||
newInput(2, nodeValue_Palette("Palette to", self, []))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Convolution";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Matrix("Kernel", self, new Matrix(3)));
|
||||
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Corner", "Radius > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Round Corner";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Radius", self, 2))
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [2, 16, 0.1] });
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
name = "Crop";
|
||||
preview_alpha = 0.5;
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Padding("Crop", self, [ 0, 0, 0, 0 ]))
|
||||
.setUnitRef(function(index) { return getDimension(index); });
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Crop Content";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Cross_Section(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Draw Cross Section";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Enum_Button("Axis", self, 0 , [ "X", "Y" ]));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Curve";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Curve("Brightness", self, CURVE_DEF_01));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Curve_HSV(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "HSV Curve";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Curve("Hue", self, CURVE_DEF_01));
|
||||
|
||||
|
|
|
@ -2130,7 +2130,13 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
}
|
||||
|
||||
if(active_draw_index > -1) {
|
||||
draw_sprite_stretched_ext(bg_spr, 1, xx, yy, round(w * _s), round(h * _s), active_draw_index > 1? COLORS.node_border_file_drop : COLORS._main_accent, 1);
|
||||
var cc = COLORS._main_accent;
|
||||
switch(active_draw_index) {
|
||||
case 1 : cc = COLORS.node_border_context; break;
|
||||
case 2 : cc = COLORS.node_border_file_drop; break;
|
||||
}
|
||||
|
||||
draw_sprite_stretched_ext(bg_spr, 1, xx, yy, round(w * _s), round(h * _s), cc, 1);
|
||||
|
||||
if(active_draw_anchor) draw_sprite_stretched_add(bg_spr, 1, xx, yy, round(w * _s), round(h * _s), COLORS._main_accent, 0.5);
|
||||
|
||||
|
@ -2205,7 +2211,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
}
|
||||
|
||||
static drawActive = function(_x, _y, _s, ind = 0) {
|
||||
active_draw_index = ind;
|
||||
active_draw_index = ind;
|
||||
if(display_parameter.highlight) drawBranch();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_De_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "De-Corner";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_De_Stray(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "De-Stray";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Tolerance", self, 0))
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
#region create
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Delay", "Overflow > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 3); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Delay(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Delay";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Dilate";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Vec2("Center", self, [ 0, 0 ]))
|
||||
.setUnitRef(function(index) { return getDimension(index); });
|
||||
|
|
|
@ -1,7 +1,18 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Displace", "Mode > Toggle", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 5].setValue((_n.inputs[ 5].getValue() + 1) % 4); });
|
||||
addHotkey("Node_Displace", "Oversample Mode > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 7].setValue((_n.inputs[ 7].getValue() + 1) % 3); });
|
||||
addHotkey("Node_Displace", "Blend Mode > Toggle", "B", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[11].setValue((_n.inputs[11].getValue() + 1) % 3); });
|
||||
|
||||
addHotkey("Node_Displace", "Iterate > Toggle", "I", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 6].setValue((_n.inputs[ 6].getValue() + 1) % 2); });
|
||||
addHotkey("Node_Displace", "Fade Distance > Toggle", "F", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[19].setValue((_n.inputs[19].getValue() + 1) % 2); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Displace";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self))
|
||||
newInput(0, nodeValue_Surface("Surface In", self))
|
||||
.setVisible(true, true);
|
||||
|
||||
newInput(1, nodeValue_Surface("Displace map", self))
|
||||
|
@ -27,7 +38,7 @@ function Node_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
newInput(6, nodeValue_Bool("Iterate", self, false, @"If not set, then strength value is multiplied directly to the displacement.
|
||||
If set, then strength value control how many times the effect applies on itself."));
|
||||
|
||||
newInput(7, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ]))
|
||||
newInput(7, nodeValue_Enum_Scroll("Oversample Mode", self, 0, [ "Empty", "Clamp", "Repeat" ]))
|
||||
.setTooltip("How to deal with pixel outside the surface.\n - Empty: Use empty pixel\n - Clamp: Repeat edge pixel\n - Repeat: Repeat texture.");
|
||||
|
||||
newInput(8, nodeValue_Surface("Mask", self));
|
||||
|
@ -38,7 +49,7 @@ If set, then strength value control how many times the effect applies on itself.
|
|||
newInput(10, nodeValue_Bool("Active", self, true));
|
||||
active_index = 10;
|
||||
|
||||
newInput(11, nodeValue_Enum_Scroll("Blend mode", self, 0, [ "Overwrite", "Min", "Max" ]));
|
||||
newInput(11, nodeValue_Enum_Scroll("Blend Mode", self, 0, [ "Overwrite", "Min", "Max" ]));
|
||||
|
||||
newInput(12, nodeValue_Toggle("Channel", self, 0b1111, { data: array_create(4, THEME.inspector_channel) }));
|
||||
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Dither", "Pattern > Toggle", "P", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 4); });
|
||||
addHotkey("Node_Dither", "Mode > Toggle", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[6].setValue(!_n.inputs[6].getValue()); });
|
||||
addHotkey("Node_Dither", "Contrast > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
static dither2 = [ 0, 2,
|
||||
3, 1 ];
|
||||
|
@ -16,7 +24,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
name = "Dither";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Palette("Palette", self, array_clone(DEF_PALETTE)));
|
||||
|
||||
|
@ -30,7 +38,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
newInput(5, nodeValue_Surface("Contrast map", self));
|
||||
|
||||
newInput(6, nodeValue_Enum_Button("Mode", self, 0, [ "Color", "Alpha" ]));
|
||||
newInput(6, nodeValue_Enum_Button("Mode", self, 0, [ "Color", "Alpha" ]));
|
||||
|
||||
newInput(7, nodeValue_Surface("Mask", self));
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
function Node_Dither_Diffuse(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Error Diffuse Dither";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Surface("Mask", self));
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Edge_Detect", "Algorithm > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue((_n.inputs[1].getValue() + 1) % 4); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Edge Detect";
|
||||
|
||||
|
@ -8,9 +14,9 @@ function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
|
||||
newInput(0, nodeValue_Surface("Surface in self", self));
|
||||
|
||||
newInput(1, nodeValue_Enum_Scroll("Algorithm", self, 0, ["Sobel", "Prewitt", "Laplacian", "Neighbor max diff"] ));
|
||||
newInput(1, nodeValue_Enum_Scroll("Algorithm", self, 0, ["Sobel", "Prewitt", "Laplacian", "Neighbor max diff"] ));
|
||||
|
||||
newInput(2, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ]))
|
||||
newInput(2, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ]))
|
||||
.setTooltip("How to deal with pixel outside the surface.\n - Empty: Use empty pixel\n - Clamp: Repeat edge pixel\n - Repeat: Repeat texture.");
|
||||
|
||||
newInput(3, nodeValue_Surface("Mask", self));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Edge_Shade(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Edge Shade";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,15 +1,23 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Erode", "Width > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); });
|
||||
addHotkey("Node_Erode", "Preserve Border > Toggle", "B", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(!_n.inputs[2].getValue()); });
|
||||
addHotkey("Node_Erode", "Use Alpha > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue(!_n.inputs[3].getValue()); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Erode(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Erode";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Int("Width", self, 1))
|
||||
.setValidator(VV_min(0))
|
||||
.setMappable(10);
|
||||
|
||||
newInput(2, nodeValue_Bool("Preserve border",self, false));
|
||||
newInput(2, nodeValue_Bool("Preserve Border",self, false));
|
||||
|
||||
newInput(3, nodeValue_Bool("Use alpha", self, true));
|
||||
newInput(3, nodeValue_Bool("Use Alpha", self, true));
|
||||
|
||||
newInput(4, nodeValue_Surface("Mask", self));
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
name = "Find pixel";
|
||||
setDimension(96, 48);
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Color("Search color", self, cola(c_black)));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Flip(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Flip";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Enum_Button("Axis", self, 0, [ "x", "y" ]));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Flood Fill";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Surface("Mask", self));
|
||||
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Fn_Math", "Operation > Add", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[_n.inl + 0].setValue(0); });
|
||||
addHotkey("Node_Fn_Math", "Operation > Minus", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[_n.inl + 0].setValue(1); });
|
||||
addHotkey("Node_Fn_Math", "Operation > Multiply", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[_n.inl + 0].setValue(2); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Fn_Math(_x, _y, _group = noone) : Node_Fn(_x, _y, _group) constructor {
|
||||
name = "Math";
|
||||
time_based = false;
|
||||
|
||||
newInput(inl + 0, nodeValue_Enum_Scroll("Operation", self, 2 , [ "Add", "Minus", "Multiply" ] ));
|
||||
newInput(inl + 0, nodeValue_Enum_Scroll("Operation", self, 2, [ "Add", "Minus", "Multiply" ] ));
|
||||
|
||||
newInput(inl + 1, nodeValue_Float("Value 1", self, 0 ))
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Gamma_Map(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Gamma Map";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Invert", self, false));
|
||||
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Glow", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(toNumber(chr(keyboard_key))); });
|
||||
addHotkey("Node_Glow", "Mode > Toggle", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[10].setValue((_n.inputs[10].getValue() + 1) % 2); });
|
||||
addHotkey("Node_Glow", "Side > Toggle", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[12].setValue((_n.inputs[12].getValue() + 1) % 2); });
|
||||
addHotkey("Node_Glow", "Draw Original > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[11].setValue((_n.inputs[11].getValue() + 1) % 2); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Glow";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Border", self, 0))
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 4, 0.1] });
|
||||
|
@ -26,7 +35,7 @@ function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
|
||||
newInput(10, nodeValue_Enum_Button("Mode", self, 0, [ "Greyscale", "Alpha" ]));
|
||||
|
||||
newInput(11, nodeValue_Bool("Draw original", self, true));
|
||||
newInput(11, nodeValue_Bool("Draw Original", self, true));
|
||||
|
||||
newInput(12, nodeValue_Enum_Button("Side", self, 0, [ "Outer", "Inner" ]));
|
||||
|
||||
|
|
|
@ -1,3 +1,23 @@
|
|||
#region create
|
||||
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Gradient", "Type > Toggle", "T", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 3); });
|
||||
addHotkey("Node_Gradient", "Angle > Rotate CCW","R", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue((_n.inputs[3].getValue() + 90) % 360); });
|
||||
addHotkey("Node_Gradient", "Gradient > Invert", "I", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR
|
||||
var _grad = _n.inputs[1].getValue();
|
||||
var _k = [];
|
||||
for( var i = 0, n = array_length(_grad.keys); i < n; i++ ) {
|
||||
_k[i] = _grad.keys[n - i - 1];
|
||||
_k[i].time = 1 - _k[i].time;
|
||||
}
|
||||
_grad.keys = _k;
|
||||
_grad.refresh();
|
||||
_n.triggerRender();
|
||||
});
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Draw Gradient";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Grain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Grain";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Surface("Mask", self));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Grey_Alpha(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Grey to Alpha";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Replace color", self, true, "Replace output with solid color."));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Greyscale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Greyscale";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Brightness", self, 0))
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01] })
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Grid_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Grid Warp";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_High_Pass", "Radius > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[7].setValue(toNumber(chr(keyboard_key))); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_High_Pass(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "High Pass";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
@ -21,7 +27,7 @@ function Node_High_Pass(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
input_display_list = [ 1, 4,
|
||||
["Surfaces", true], 0, 2, 3, 5, 6,
|
||||
["Sharpen", false], 7, 8,
|
||||
["Effect", false], 7, 8,
|
||||
]
|
||||
|
||||
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_HSV_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
name = "HSV Extract";
|
||||
batch_output = false;
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Output Array", self, false));
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Image_Grid", "Main Axis > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[0].setValue(!_n.inputs[0].getValue()); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Image_Grid(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Image Grid";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Splice Spritesheet";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Vec2("Sprite size", self, [ 32, 32 ]));
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Interlaced", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[8].setValue(toNumber(chr(keyboard_key))); });
|
||||
addHotkey("Node_Interlaced", "Axis > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 7].setValue((_n.inputs[ 7].getValue() + 1) % 2); });
|
||||
addHotkey("Node_Interlaced", "Invert > Toggle", "I", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 9].setValue((_n.inputs[ 9].getValue() + 1) % 2); });
|
||||
addHotkey("Node_Interlaced", "Loop > Toggle", "L", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[11].setValue((_n.inputs[11].getValue() + 1) % 2); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Interlaced(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Interlace";
|
||||
|
||||
|
@ -5,7 +14,7 @@ function Node_Interlaced(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
use_cache = CACHE_USE.manual;
|
||||
clearCacheOnChange = false;
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Invert(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Invert";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Surface("Mask", self));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_JPEG(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "JPEG";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Kuwahara", "Radius > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(toNumber(chr(keyboard_key))); });
|
||||
addHotkey("Node_Kuwahara", "Types > Toggle", "T", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[9].setValue((_n.inputs[9].getValue() + 1) % 3); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Kuwahara(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Kuwahara";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Level";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Slider_Range("White in", self, [0, 1]));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Level_Selector(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Level Selector";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Float("Midpoint", self, 0))
|
||||
.setDisplay(VALUE_DISPLAY.slider)
|
||||
|
|
|
@ -8,7 +8,7 @@ enum LIQUEFY_TYPE {
|
|||
function Node_Liquefy(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Liquefy";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Bool("Active", self, true));
|
||||
active_index = 1;
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
#region
|
||||
FN_NODE_CONTEXT_INVOKE {
|
||||
addHotkey("Node_Local_Analyze", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(toNumber(chr(keyboard_key))); });
|
||||
addHotkey("Node_Local_Analyze", "Oversample mode > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue((_n.inputs[3].getValue() + 1) % 3); });
|
||||
addHotkey("Node_Local_Analyze", "Shape > Toggle", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue((_n.inputs[4].getValue() + 1) % 3); });
|
||||
});
|
||||
#endregion
|
||||
|
||||
function Node_Local_Analyze(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Local Analyze";
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
newInput(0, nodeValue_Surface("Surface In", self));
|
||||
|
||||
newInput(1, nodeValue_Enum_Scroll("Algorithm", self, 0, [ "Average (Blur)", "Maximum", "Minimum" ]));
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue