mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +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;
|
||||
inspectInput2.index = -1;
|
||||
|
||||
autoUpdatedTrigger = 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);
|
||||
|
||||
|
@ -580,6 +579,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
if(will_setHeight) {
|
||||
setHeight();
|
||||
getJunctionList();
|
||||
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,
|
||||
|
||||
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);
|
||||
|
||||
input_display_list = [ 2,
|
||||
["Surfaces", true], 0, 5, 6, 7, 8,
|
||||
["Effect", false], 4, 1, 3,
|
||||
["Effect", false], 4, 1, 3, 9,
|
||||
]
|
||||
|
||||
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 _itr = _data[3];
|
||||
var _str = _data[4];
|
||||
var _fil = _data[9];
|
||||
|
||||
var _sw = surface_get_width_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("tolerance", _tol);
|
||||
shader_set_i("strict", _str);
|
||||
shader_set_i("fill", _fil);
|
||||
|
||||
draw_surface_safe(temp_surface[!_bg]);
|
||||
surface_reset_shader();
|
||||
|
|
|
@ -43,7 +43,6 @@ enum NODE_EXPORT_FORMAT {
|
|||
function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Export";
|
||||
preview_channel = 1;
|
||||
autoUpdatedTrigger = false;
|
||||
|
||||
playing = false;
|
||||
played = 0;
|
||||
|
@ -117,7 +116,9 @@ 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)
|
||||
.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[| 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
|
||||
|
||||
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,
|
||||
["Custom Range", true, 15], 12,
|
||||
["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_type = "";
|
||||
render_target = "";
|
||||
exportLog = true;
|
||||
|
||||
directory = TEMPDIR + string(irandom_range(100000, 999999));
|
||||
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;
|
||||
} #endregion
|
||||
|
||||
static export = function() { #region
|
||||
static export = function(log = true) { #region
|
||||
//print($">>>>>>>>>>>>>>>>>>>> export {CURRENT_FRAME} <<<<<<<<<<<<<<<<<<<<");
|
||||
|
||||
exportLog = log;
|
||||
|
||||
var surf = getInputData( 0);
|
||||
var path = getInputData( 1);
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
noti.path = filename_dir(p);
|
||||
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);
|
||||
|
||||
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);
|
||||
noti.path = filename_dir(p);
|
||||
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) {
|
||||
Render();
|
||||
|
||||
export();
|
||||
updatedOutTrigger.setValue(true);
|
||||
return;
|
||||
|
@ -732,7 +735,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
static step = function() { #region
|
||||
insp1UpdateActive = !IS_RENDERING;
|
||||
insp2UpdateActive = !IS_RENDERING;
|
||||
|
||||
|
||||
var surf = getInputData( 0);
|
||||
var pngf = getInputData(13);
|
||||
|
||||
|
@ -751,6 +754,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var user = getInputData(15);
|
||||
|
||||
inputs[| 11].setVisible(anim == 1);
|
||||
inputs[| 16].setVisible(anim == 0);
|
||||
|
||||
inputs[| 12].editWidget.minn = FIRST_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
|
||||
var anim = getInputData(3);
|
||||
var expo = getInputData(16);
|
||||
|
||||
if(anim == NODE_EXPORT_FORMAT.single) {
|
||||
if(isInLoop()) export();
|
||||
if(isInLoop() || expo) export(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ enum ARRAY_PROCESS {
|
|||
function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
attributes.array_process = ARRAY_PROCESS.loop;
|
||||
current_data = [];
|
||||
inputs_data = [];
|
||||
inputs_is_array = [];
|
||||
all_inputs = [];
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
if(!is_surface(_distMap))
|
||||
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_map = _distMap;
|
||||
|
|
|
@ -497,7 +497,7 @@ function nodeValueUnit(_nodeValue) constructor { #region
|
|||
if(is_array(base) && !is_array(value))
|
||||
return value;
|
||||
|
||||
var _val = array_create(array_length(value));
|
||||
var _val = array_clone(value);
|
||||
|
||||
switch(disp) {
|
||||
case VALUE_DISPLAY.padding :
|
||||
|
@ -790,6 +790,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
} else
|
||||
visible = inspector;
|
||||
node.will_setHeight = true;
|
||||
|
||||
return self;
|
||||
} #endregion
|
||||
|
||||
|
|
|
@ -1786,9 +1786,10 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
|
||||
function saveCurrentFrame() { #region
|
||||
var prevS = getNodePreviewSurface();
|
||||
var _node = getNodePreview();
|
||||
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();
|
||||
if(path == "") return;
|
||||
if(filename_ext(path) != ".png") path += ".png";
|
||||
|
@ -1797,7 +1798,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
} #endregion
|
||||
|
||||
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();
|
||||
if(path == "") return;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ varying vec4 v_vColour;
|
|||
uniform vec2 dimension;
|
||||
uniform float tolerance;
|
||||
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.); }
|
||||
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));
|
||||
|
||||
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(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