mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 14:36:13 +01:00
1.17.0.3 patches
This commit is contained in:
parent
586fa1fe66
commit
d3c024abb2
8 changed files with 34 additions and 17 deletions
|
@ -136,7 +136,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
inspectInput1.index = -1;
|
inspectInput1.index = -1;
|
||||||
inspectInput2.index = -1;
|
inspectInput2.index = -1;
|
||||||
|
|
||||||
autoUpdatedTrigger = true;
|
|
||||||
updatedInTrigger = nodeValue("Update", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, false).setVisible(true, true);
|
updatedInTrigger = nodeValue("Update", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, false).setVisible(true, true);
|
||||||
updatedOutTrigger = nodeValue("Updated", self, JUNCTION_CONNECT.output, VALUE_TYPE.trigger, false).setVisible(true, true);
|
updatedOutTrigger = nodeValue("Updated", self, JUNCTION_CONNECT.output, VALUE_TYPE.trigger, false).setVisible(true, true);
|
||||||
|
|
||||||
|
@ -580,6 +579,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
|
|
||||||
if(will_setHeight) {
|
if(will_setHeight) {
|
||||||
setHeight();
|
setHeight();
|
||||||
|
getJunctionList();
|
||||||
will_setHeight = false;
|
will_setHeight = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,13 @@ function Node_De_Stray(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
__init_mask_modifier(5); // inputs 7, 8,
|
__init_mask_modifier(5); // inputs 7, 8,
|
||||||
|
|
||||||
|
inputs[| 9] = nodeValue("Fill Empty", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
input_display_list = [ 2,
|
input_display_list = [ 2,
|
||||||
["Surfaces", true], 0, 5, 6, 7, 8,
|
["Surfaces", true], 0, 5, 6, 7, 8,
|
||||||
["Effect", false], 4, 1, 3,
|
["Effect", false], 4, 1, 3, 9,
|
||||||
]
|
]
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
@ -41,6 +43,7 @@ function Node_De_Stray(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
var _tol = _data[1];
|
var _tol = _data[1];
|
||||||
var _itr = _data[3];
|
var _itr = _data[3];
|
||||||
var _str = _data[4];
|
var _str = _data[4];
|
||||||
|
var _fil = _data[9];
|
||||||
|
|
||||||
var _sw = surface_get_width_safe(surf);
|
var _sw = surface_get_width_safe(surf);
|
||||||
var _sh = surface_get_height_safe(surf);
|
var _sh = surface_get_height_safe(surf);
|
||||||
|
@ -57,6 +60,7 @@ function Node_De_Stray(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
shader_set_f("dimension", _sw, _sh);
|
shader_set_f("dimension", _sw, _sh);
|
||||||
shader_set_f("tolerance", _tol);
|
shader_set_f("tolerance", _tol);
|
||||||
shader_set_i("strict", _str);
|
shader_set_i("strict", _str);
|
||||||
|
shader_set_i("fill", _fil);
|
||||||
|
|
||||||
draw_surface_safe(temp_surface[!_bg]);
|
draw_surface_safe(temp_surface[!_bg]);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
|
@ -43,7 +43,6 @@ enum NODE_EXPORT_FORMAT {
|
||||||
function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Export";
|
name = "Export";
|
||||||
preview_channel = 1;
|
preview_channel = 1;
|
||||||
autoUpdatedTrigger = false;
|
|
||||||
|
|
||||||
playing = false;
|
playing = false;
|
||||||
played = 0;
|
played = 0;
|
||||||
|
@ -118,6 +117,8 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
inputs[| 15] = nodeValue("Custom Range", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
inputs[| 15] = nodeValue("Custom Range", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
|
||||||
|
inputs[| 16] = nodeValue("Auto Export", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Loop exit", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
|
outputs[| 0] = nodeValue("Loop exit", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
|
||||||
|
|
||||||
outputs[| 1] = nodeValue("Preview", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone)
|
outputs[| 1] = nodeValue("Preview", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone)
|
||||||
|
@ -202,7 +203,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
}); #endregion
|
}); #endregion
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Export", false], 0, 1, 2, export_template,
|
["Export", false], 0, 1, 2, export_template, 16,
|
||||||
["Format", false], 3, 9, 6, 7, 10, 13,
|
["Format", false], 3, 9, 6, 7, 10, 13,
|
||||||
["Custom Range", true, 15], 12,
|
["Custom Range", true, 15], 12,
|
||||||
["Animation", false], 8, 5, 11, 14,
|
["Animation", false], 8, 5, 11, 14,
|
||||||
|
@ -211,6 +212,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
render_process_id = 0;
|
render_process_id = 0;
|
||||||
render_type = "";
|
render_type = "";
|
||||||
render_target = "";
|
render_target = "";
|
||||||
|
exportLog = true;
|
||||||
|
|
||||||
directory = TEMPDIR + string(irandom_range(100000, 999999));
|
directory = TEMPDIR + string(irandom_range(100000, 999999));
|
||||||
converter = filepath_resolve(PREFERENCES.ImageMagick_path) + "convert.exe";
|
converter = filepath_resolve(PREFERENCES.ImageMagick_path) + "convert.exe";
|
||||||
|
@ -552,9 +554,11 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
return _pathOut;
|
return _pathOut;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static export = function() { #region
|
static export = function(log = true) { #region
|
||||||
//print($">>>>>>>>>>>>>>>>>>>> export {CURRENT_FRAME} <<<<<<<<<<<<<<<<<<<<");
|
//print($">>>>>>>>>>>>>>>>>>>> export {CURRENT_FRAME} <<<<<<<<<<<<<<<<<<<<");
|
||||||
|
|
||||||
|
exportLog = log;
|
||||||
|
|
||||||
var surf = getInputData( 0);
|
var surf = getInputData( 0);
|
||||||
var path = getInputData( 1);
|
var path = getInputData( 1);
|
||||||
var suff = getInputData( 2);
|
var suff = getInputData( 2);
|
||||||
|
@ -592,7 +596,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
p = save_surface(_surf, p);
|
p = save_surface(_surf, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(form != NODE_EXPORT_FORMAT.animation && !IS_CMD) {
|
if(exportLog && form != NODE_EXPORT_FORMAT.animation && !IS_CMD) {
|
||||||
var noti = log_message("EXPORT", $"Export {array_length(surf)} images complete.", THEME.noti_icon_tick, COLORS._main_value_positive, false);
|
var noti = log_message("EXPORT", $"Export {array_length(surf)} images complete.", THEME.noti_icon_tick, COLORS._main_value_positive, false);
|
||||||
noti.path = filename_dir(p);
|
noti.path = filename_dir(p);
|
||||||
noti.setOnClick(function() { shellOpenExplorer(self.path); }, "Open in explorer", THEME.explorer);
|
noti.setOnClick(function() { shellOpenExplorer(self.path); }, "Open in explorer", THEME.explorer);
|
||||||
|
@ -612,7 +616,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
|
|
||||||
p = save_surface(surf, p);
|
p = save_surface(surf, p);
|
||||||
|
|
||||||
if(form != NODE_EXPORT_FORMAT.animation && !IS_CMD) {
|
if(exportLog && form != NODE_EXPORT_FORMAT.animation && !IS_CMD) {
|
||||||
var noti = log_message("EXPORT", $"Export image as {p}", THEME.noti_icon_tick, COLORS._main_value_positive, false);
|
var noti = log_message("EXPORT", $"Export image as {p}", THEME.noti_icon_tick, COLORS._main_value_positive, false);
|
||||||
noti.path = filename_dir(p);
|
noti.path = filename_dir(p);
|
||||||
noti.setOnClick(function() { shellOpenExplorer(self.path); }, "Open in explorer", THEME.explorer);
|
noti.setOnClick(function() { shellOpenExplorer(self.path); }, "Open in explorer", THEME.explorer);
|
||||||
|
@ -710,7 +714,6 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
|
|
||||||
if(form == NODE_EXPORT_FORMAT.single) {
|
if(form == NODE_EXPORT_FORMAT.single) {
|
||||||
Render();
|
Render();
|
||||||
|
|
||||||
export();
|
export();
|
||||||
updatedOutTrigger.setValue(true);
|
updatedOutTrigger.setValue(true);
|
||||||
return;
|
return;
|
||||||
|
@ -751,6 +754,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
var user = getInputData(15);
|
var user = getInputData(15);
|
||||||
|
|
||||||
inputs[| 11].setVisible(anim == 1);
|
inputs[| 11].setVisible(anim == 1);
|
||||||
|
inputs[| 16].setVisible(anim == 0);
|
||||||
|
|
||||||
inputs[| 12].editWidget.minn = FIRST_FRAME + 1;
|
inputs[| 12].editWidget.minn = FIRST_FRAME + 1;
|
||||||
inputs[| 12].editWidget.maxx = LAST_FRAME + 1;
|
inputs[| 12].editWidget.maxx = LAST_FRAME + 1;
|
||||||
|
@ -826,8 +830,10 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
|
|
||||||
static update = function(frame = CURRENT_FRAME) { #region
|
static update = function(frame = CURRENT_FRAME) { #region
|
||||||
var anim = getInputData(3);
|
var anim = getInputData(3);
|
||||||
|
var expo = getInputData(16);
|
||||||
|
|
||||||
if(anim == NODE_EXPORT_FORMAT.single) {
|
if(anim == NODE_EXPORT_FORMAT.single) {
|
||||||
if(isInLoop()) export();
|
if(isInLoop() || expo) export(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ enum ARRAY_PROCESS {
|
||||||
function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
attributes.array_process = ARRAY_PROCESS.loop;
|
attributes.array_process = ARRAY_PROCESS.loop;
|
||||||
current_data = [];
|
current_data = [];
|
||||||
inputs_data = [];
|
|
||||||
inputs_is_array = [];
|
inputs_is_array = [];
|
||||||
all_inputs = [];
|
all_inputs = [];
|
||||||
|
|
||||||
|
|
|
@ -307,7 +307,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
||||||
if(!is_surface(_distMap))
|
if(!is_surface(_distMap))
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
|
|
||||||
if(scatter_map != _distMap || scatter_maps != seed || scatter_mapa != _amount)
|
// if(scatter_map != _distMap || scatter_maps != seed || scatter_mapa != _amount)
|
||||||
scatter_mapp = get_points_from_dist(_distMap, _amount, seed);
|
scatter_mapp = get_points_from_dist(_distMap, _amount, seed);
|
||||||
|
|
||||||
scatter_map = _distMap;
|
scatter_map = _distMap;
|
||||||
|
|
|
@ -497,7 +497,7 @@ function nodeValueUnit(_nodeValue) constructor { #region
|
||||||
if(is_array(base) && !is_array(value))
|
if(is_array(base) && !is_array(value))
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
var _val = array_create(array_length(value));
|
var _val = array_clone(value);
|
||||||
|
|
||||||
switch(disp) {
|
switch(disp) {
|
||||||
case VALUE_DISPLAY.padding :
|
case VALUE_DISPLAY.padding :
|
||||||
|
@ -790,6 +790,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
} else
|
} else
|
||||||
visible = inspector;
|
visible = inspector;
|
||||||
node.will_setHeight = true;
|
node.will_setHeight = true;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
|
|
@ -1786,9 +1786,10 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
|
|
||||||
function saveCurrentFrame() { #region
|
function saveCurrentFrame() { #region
|
||||||
var prevS = getNodePreviewSurface();
|
var prevS = getNodePreviewSurface();
|
||||||
|
var _node = getNodePreview();
|
||||||
if(!is_surface(prevS)) return;
|
if(!is_surface(prevS)) return;
|
||||||
|
|
||||||
var path = get_save_filename("image|*.png;*.jpg", "export");
|
var path = get_save_filename("image|*.png;*.jpg", _node.display_name == ""? "export" : _node.display_name);
|
||||||
key_release();
|
key_release();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
if(filename_ext(path) != ".png") path += ".png";
|
if(filename_ext(path) != ".png") path += ".png";
|
||||||
|
@ -1797,7 +1798,7 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
function saveAllCurrentFrames() { #region
|
function saveAllCurrentFrames() { #region
|
||||||
var path = get_save_filename("image|*.png;*.jpg", "export");
|
var path = get_save_filename("image|*.png;*.jpg", _node.display_name == ""? "export" : _node.display_name);
|
||||||
key_release();
|
key_release();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ varying vec4 v_vColour;
|
||||||
uniform vec2 dimension;
|
uniform vec2 dimension;
|
||||||
uniform float tolerance;
|
uniform float tolerance;
|
||||||
uniform int strict;
|
uniform int strict;
|
||||||
|
uniform int fill;
|
||||||
|
|
||||||
float d(in vec4 c1, in vec4 c2) { return length(c1.rgb * c1.a - c2.rgb * c2.a) / sqrt(3.); }
|
float d(in vec4 c1, in vec4 c2) { return length(c1.rgb * c1.a - c2.rgb * c2.a) / sqrt(3.); }
|
||||||
bool s(in vec4 c1, in vec4 c2) { return d(c1, c2) <= tolerance; }
|
bool s(in vec4 c1, in vec4 c2) { return d(c1, c2) <= tolerance; }
|
||||||
|
@ -66,7 +67,12 @@ void main() {
|
||||||
vec4 a8 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( tx.x, tx.y));
|
vec4 a8 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( tx.x, tx.y));
|
||||||
|
|
||||||
gl_FragColor = a4;
|
gl_FragColor = a4;
|
||||||
if(a4.a == 0.) return;
|
if(a4.a == 0.) {
|
||||||
|
if(fill == 0) return;
|
||||||
|
|
||||||
|
gl_FragColor = sel4(a4, a1, a3, a5, a7);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(strict == 0) {
|
if(strict == 0) {
|
||||||
if(a1.a > 0. && !s(a4, a1) && s(a1, a3) && s(a1, a5)) gl_FragColor = sel3(a4, a1, a3, a5);
|
if(a1.a > 0. && !s(a4, a1) && s(a1, a3) && s(a1, a5)) gl_FragColor = sel3(a4, a1, a3, a5);
|
||||||
|
|
Loading…
Reference in a new issue