mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffuck
This commit is contained in:
parent
9317331da5
commit
04f21339f3
20 changed files with 188 additions and 68 deletions
|
@ -1313,7 +1313,7 @@
|
||||||
{"name":"sh_grid_tri","order":3,"path":"shaders/sh_grid_tri/sh_grid_tri.yy",},
|
{"name":"sh_grid_tri","order":3,"path":"shaders/sh_grid_tri/sh_grid_tri.yy",},
|
||||||
{"name":"sh_herringbone_tile","order":5,"path":"shaders/sh_herringbone_tile/sh_herringbone_tile.yy",},
|
{"name":"sh_herringbone_tile","order":5,"path":"shaders/sh_herringbone_tile/sh_herringbone_tile.yy",},
|
||||||
{"name":"sh_image_trace","order":34,"path":"shaders/sh_image_trace/sh_image_trace.yy",},
|
{"name":"sh_image_trace","order":34,"path":"shaders/sh_image_trace/sh_image_trace.yy",},
|
||||||
{"name":"sh_invert_all","order":20,"path":"shaders/sh_invert_all/sh_invert_all.yy",},
|
{"name":"sh_mask_invert","order":20,"path":"shaders/sh_mask_invert/sh_mask_invert.yy",},
|
||||||
{"name":"sh_invert","order":17,"path":"shaders/sh_invert/sh_invert.yy",},
|
{"name":"sh_invert","order":17,"path":"shaders/sh_invert/sh_invert.yy",},
|
||||||
{"name":"sh_kuwahara_ani","order":37,"path":"shaders/sh_kuwahara_ani/sh_kuwahara_ani.yy",},
|
{"name":"sh_kuwahara_ani","order":37,"path":"shaders/sh_kuwahara_ani/sh_kuwahara_ani.yy",},
|
||||||
{"name":"sh_kuwahara","order":36,"path":"shaders/sh_kuwahara/sh_kuwahara.yy",},
|
{"name":"sh_kuwahara","order":36,"path":"shaders/sh_kuwahara/sh_kuwahara.yy",},
|
||||||
|
|
|
@ -1828,7 +1828,7 @@
|
||||||
{"id":{"name":"sh_herringbone_tile","path":"shaders/sh_herringbone_tile/sh_herringbone_tile.yy",},},
|
{"id":{"name":"sh_herringbone_tile","path":"shaders/sh_herringbone_tile/sh_herringbone_tile.yy",},},
|
||||||
{"id":{"name":"sh_image_trace","path":"shaders/sh_image_trace/sh_image_trace.yy",},},
|
{"id":{"name":"sh_image_trace","path":"shaders/sh_image_trace/sh_image_trace.yy",},},
|
||||||
{"id":{"name":"sh_interpret_number","path":"shaders/sh_interpret_number/sh_interpret_number.yy",},},
|
{"id":{"name":"sh_interpret_number","path":"shaders/sh_interpret_number/sh_interpret_number.yy",},},
|
||||||
{"id":{"name":"sh_invert_all","path":"shaders/sh_invert_all/sh_invert_all.yy",},},
|
{"id":{"name":"sh_mask_invert","path":"shaders/sh_mask_invert/sh_mask_invert.yy",},},
|
||||||
{"id":{"name":"sh_invert","path":"shaders/sh_invert/sh_invert.yy",},},
|
{"id":{"name":"sh_invert","path":"shaders/sh_invert/sh_invert.yy",},},
|
||||||
{"id":{"name":"sh_kuwahara_ani","path":"shaders/sh_kuwahara_ani/sh_kuwahara_ani.yy",},},
|
{"id":{"name":"sh_kuwahara_ani","path":"shaders/sh_kuwahara_ani/sh_kuwahara_ani.yy",},},
|
||||||
{"id":{"name":"sh_kuwahara","path":"shaders/sh_kuwahara/sh_kuwahara.yy",},},
|
{"id":{"name":"sh_kuwahara","path":"shaders/sh_kuwahara/sh_kuwahara.yy",},},
|
||||||
|
|
|
@ -31,7 +31,8 @@ function mask_modify(mask, invert = false, feather = 0) { #region
|
||||||
|
|
||||||
__temp_mask = surface_verify(__temp_mask, surface_get_width_safe(mask), surface_get_height_safe(mask));
|
__temp_mask = surface_verify(__temp_mask, surface_get_width_safe(mask), surface_get_height_safe(mask));
|
||||||
|
|
||||||
surface_set_shader(__temp_mask, invert? sh_invert_all : noone);
|
surface_set_shader(__temp_mask, sh_mask_invert);
|
||||||
|
shader_set_i("invert", invert);
|
||||||
draw_surface(mask, 0, 0);
|
draw_surface(mask, 0, 0);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
|
|
|
@ -907,6 +907,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) { #region
|
static attributeDeserialize = function(attr) { #region
|
||||||
|
struct_append(attributes, attr);
|
||||||
|
|
||||||
if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension"))
|
if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension"))
|
||||||
attributes.use_project_dimension = false;
|
attributes.use_project_dimension = false;
|
||||||
|
|
||||||
|
|
|
@ -372,6 +372,8 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) { #region
|
static attributeDeserialize = function(attr) { #region
|
||||||
|
struct_append(attributes, attr);
|
||||||
|
|
||||||
if(struct_has(attr, "layer_visible"))
|
if(struct_has(attr, "layer_visible"))
|
||||||
attributes.layer_visible = attr.layer_visible;
|
attributes.layer_visible = attr.layer_visible;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
|
@ -147,10 +147,6 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
inputs[| 7].setVisible(_outp == 4);
|
inputs[| 7].setVisible(_outp == 4);
|
||||||
|
|
||||||
inputs[| 14].setVisible(_fill == 0 && !_atlas);
|
inputs[| 14].setVisible(_fill == 0 && !_atlas);
|
||||||
|
|
||||||
var _msk = is_surface(getSingleValue(4));
|
|
||||||
inputs[| 12].setVisible(_msk);
|
|
||||||
inputs[| 12].setVisible(_msk);
|
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||||
|
|
|
@ -208,7 +208,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
static onInspector2Update = function() { #region
|
static onInspector2Update = function() { #region
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|
||||||
repeat(node_length) {
|
repeat(ds_list_size(nodes)) {
|
||||||
if(nodes[| i].hasInspector2Update())
|
if(nodes[| i].hasInspector2Update())
|
||||||
nodes[| i].inspector2Update();
|
nodes[| i].inspector2Update();
|
||||||
i++;
|
i++;
|
||||||
|
@ -219,11 +219,12 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
will_refresh = false;
|
will_refresh = false;
|
||||||
static refreshNodes = function() { #region
|
static refreshNodes = function() { #region
|
||||||
will_refresh = false;
|
will_refresh = false;
|
||||||
node_length = ds_list_size(nodes);
|
|
||||||
|
|
||||||
hasInsp1 = false;
|
hasInsp1 = false;
|
||||||
hasInsp2 = false;
|
hasInsp2 = false;
|
||||||
|
|
||||||
|
node_length = ds_list_size(nodes);
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
repeat(node_length) {
|
repeat(node_length) {
|
||||||
hasInsp1 |= nodes[| i].hasInspector1Update();
|
hasInsp1 |= nodes[| i].hasInspector1Update();
|
||||||
|
@ -231,6 +232,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getNodeBase = function() { #region
|
static getNodeBase = function() { #region
|
||||||
|
@ -330,10 +332,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
static setRenderStatus = function(result) { #region
|
static setRenderStatus = function(result) { #region
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
if(rendered == result) return;
|
|
||||||
|
|
||||||
LOG_IF(global.FLAG.render == 1, $"Set render status for {INAME} : {result}");
|
LOG_IF(global.FLAG.render == 1, $"Set render status for {INAME} : {result}");
|
||||||
rendered = result;
|
rendered = result;
|
||||||
|
if(rendered == result) return;
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
for( var i = custom_output_index, n = ds_list_size(outputs); i < n; i++ ) {
|
for( var i = custom_output_index, n = ds_list_size(outputs); i < n; i++ ) {
|
||||||
|
@ -354,6 +355,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
static isActiveDynamic = function(frame = CURRENT_FRAME) { #region
|
static isActiveDynamic = function(frame = CURRENT_FRAME) { #region
|
||||||
if(update_on_frame) return true;
|
if(update_on_frame) return true;
|
||||||
|
if(!rendered) return true;
|
||||||
|
|
||||||
for( var i = custom_input_index, n = ds_list_size(inputs); i < n; i++ )
|
for( var i = custom_input_index, n = ds_list_size(inputs); i < n; i++ )
|
||||||
if(inputs[| i].isActiveDynamic(frame) || !inputs[| i].from.rendered) return true;
|
if(inputs[| i].isActiveDynamic(frame) || !inputs[| i].from.rendered) return true;
|
||||||
|
@ -372,6 +374,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
_node.group = self;
|
_node.group = self;
|
||||||
|
|
||||||
will_refresh = true;
|
will_refresh = true;
|
||||||
|
node_length = ds_list_size(nodes);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static remove = function(_node) { #region
|
static remove = function(_node) { #region
|
||||||
|
@ -392,6 +395,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
_node.group = group;
|
_node.group = group;
|
||||||
|
|
||||||
will_refresh = true;
|
will_refresh = true;
|
||||||
|
node_length = ds_list_size(nodes);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static clearCache = function() { #region
|
static clearCache = function() { #region
|
||||||
|
@ -401,10 +405,10 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
}
|
}
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static stepBegin = function() {
|
static stepBegin = function() { #region
|
||||||
if(will_refresh) refreshNodes();
|
if(will_refresh) refreshNodes();
|
||||||
doStepBegin();
|
doStepBegin();
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() { #region
|
||||||
if(combine_render_time) {
|
if(combine_render_time) {
|
||||||
|
@ -444,19 +448,37 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static sortIO = function() { #region
|
static sortIO = function() { #region
|
||||||
for( var i = 0; i < ds_list_size(inputs); i++ )
|
var _ilen = ds_list_size(inputs);
|
||||||
array_push_unique(attributes.input_display_list, i);
|
var _iarr = attributes.input_display_list;
|
||||||
|
|
||||||
|
for( var i = 0; i < _ilen; i++ )
|
||||||
|
array_push_unique(_iarr, i);
|
||||||
|
for( var i = array_length(_iarr) - 1; i >= 0; i-- ) {
|
||||||
|
if(_iarr[i] >= _ilen) array_delete(_iarr, i, 1);
|
||||||
|
}
|
||||||
|
|
||||||
input_display_list = attributes.input_display_list;
|
input_display_list = attributes.input_display_list;
|
||||||
|
|
||||||
for( var i = 0; i < ds_list_size(outputs); i++ )
|
///////////////////////////////////////////////////////////////////
|
||||||
array_push_unique(attributes.output_display_list, i);
|
|
||||||
|
var _olen = ds_list_size(outputs);
|
||||||
|
var _oarr = attributes.output_display_list;
|
||||||
|
|
||||||
|
for( var i = 0; i < _olen; i++ )
|
||||||
|
array_push_unique(_oarr, i);
|
||||||
|
for( var i = array_length(_oarr) - 1; i >= 0; i-- ) {
|
||||||
|
if(_oarr[i] >= _olen)
|
||||||
|
array_delete(_oarr, i, 1);
|
||||||
|
}
|
||||||
output_display_list = attributes.output_display_list;
|
output_display_list = attributes.output_display_list;
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
refreshNodeDisplay();
|
refreshNodeDisplay();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getTool = function() { #region
|
static getTool = function() { #region
|
||||||
for(var i = 0; i < node_length; i++) {
|
for(var i = 0, n = ds_list_size(nodes); i < n; i++) {
|
||||||
var _node = nodes[| i];
|
var _node = nodes[| i];
|
||||||
if(!_node.active) continue;
|
if(!_node.active) continue;
|
||||||
if(_node.isTool) return _node.getTool();
|
if(_node.isTool) return _node.getTool();
|
||||||
|
@ -473,7 +495,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
var dups = ds_list_create();
|
var dups = ds_list_create();
|
||||||
|
|
||||||
for(var i = 0; i < node_length; i++) {
|
for(var i = 0, n = ds_list_size(nodes); i < n; i++) {
|
||||||
var _node = nodes[| i];
|
var _node = nodes[| i];
|
||||||
var _cnode = _node.clone(target);
|
var _cnode = _node.clone(target);
|
||||||
ds_list_add(dups, _cnode);
|
ds_list_add(dups, _cnode);
|
||||||
|
@ -506,12 +528,13 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static resetRender = function(_clearCache = false) { #region
|
static resetRender = function(_clearCache = false) { #region
|
||||||
LOG_LINE_IF(global.FLAG.render == 1, $"Reset Render for {INAME}");
|
LOG_LINE_IF(global.FLAG.render == 1, $"Reset Render for group {INAME}");
|
||||||
|
|
||||||
setRenderStatus(false);
|
setRenderStatus(false);
|
||||||
if(_clearCache) clearInputCache();
|
if(_clearCache) clearInputCache();
|
||||||
|
|
||||||
for( var i = 0; i < node_length; i++ )
|
if(reset_all_child)
|
||||||
|
for(var i = 0, n = ds_list_size(nodes); i < n; i++)
|
||||||
nodes[| i].resetRender(_clearCache);
|
nodes[| i].resetRender(_clearCache);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
@ -540,7 +563,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
static getGraphPreviewSurface = function() { #region
|
static getGraphPreviewSurface = function() { #region
|
||||||
var _output_junc = outputs[| preview_channel];
|
var _output_junc = outputs[| preview_channel];
|
||||||
|
|
||||||
for( var i = 0, n = node_length; i < n; i++ ) {
|
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {
|
||||||
if(!nodes[| i].active) continue;
|
if(!nodes[| i].active) continue;
|
||||||
if(is_instanceof(nodes[| i], Node_Group_Thumbnail))
|
if(is_instanceof(nodes[| i], Node_Group_Thumbnail))
|
||||||
_output_junc = nodes[| i].inputs[| 0];
|
_output_junc = nodes[| i].inputs[| 0];
|
||||||
|
@ -559,12 +582,85 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
static enable = function() { #region
|
static enable = function() { #region
|
||||||
active = true; timeline_item.active = true;
|
active = true; timeline_item.active = true;
|
||||||
for( var i = 0, n = node_length; i < n; i++ ) nodes[| i].enable();
|
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) nodes[| i].enable();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static disable = function() { #region
|
static disable = function() { #region
|
||||||
active = false; timeline_item.active = false;
|
active = false; timeline_item.active = false;
|
||||||
for( var i = 0, n = node_length; i < n; i++ ) nodes[| i].disable();
|
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) nodes[| i].disable();
|
||||||
|
} #endregion
|
||||||
|
|
||||||
|
static attributeSerialize = function() { #region
|
||||||
|
sortIO();
|
||||||
|
|
||||||
|
var _attr = variable_clone(attributes);
|
||||||
|
|
||||||
|
_attr.custom_input_list = [];
|
||||||
|
for( var i = custom_input_index, n = ds_list_size(inputs); i < n; i++ ) {
|
||||||
|
if(struct_has(inputs[| i], "from"))
|
||||||
|
array_push(_attr.custom_input_list, inputs[| i].from.node_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
_attr.custom_output_list = [];
|
||||||
|
for( var i = custom_output_index, n = ds_list_size(outputs); i < n; i++ ) {
|
||||||
|
if(struct_has(outputs[| i], "from"))
|
||||||
|
array_push(_attr.custom_output_list , outputs[| i].from.node_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _attr;
|
||||||
|
} #endregion
|
||||||
|
|
||||||
|
static doApplyDeserialize = function() { #region
|
||||||
|
var attr = attributes;
|
||||||
|
|
||||||
|
if(struct_has(attr, "custom_input_list")) {
|
||||||
|
var _ilist = attr.custom_input_list;
|
||||||
|
var _inarr = {};
|
||||||
|
|
||||||
|
for( var i = ds_list_size(inputs) - 1; i >= custom_input_index; i-- ) {
|
||||||
|
if(!struct_has(inputs[| i], "from")) continue;
|
||||||
|
|
||||||
|
var _frNode = inputs[| i].from.node_id;
|
||||||
|
if(array_exists(_ilist, _frNode)) {
|
||||||
|
_inarr[$ _frNode] = inputs[| i];
|
||||||
|
ds_list_delete(inputs, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(_ilist); i < n; i++ ) {
|
||||||
|
if(!struct_has(_inarr, _ilist[i])) continue;
|
||||||
|
|
||||||
|
ds_list_add(inputs, _inarr[$ _ilist[i]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(struct_has(attr, "custom_output_list")) {
|
||||||
|
var _ilist = attr.custom_output_list;
|
||||||
|
var _inarr = {};
|
||||||
|
|
||||||
|
for( var i = ds_list_size(outputs) - 1; i >= custom_output_index; i-- ) {
|
||||||
|
if(!struct_has(outputs[| i], "from")) continue;
|
||||||
|
|
||||||
|
var _frNode = outputs[| i].from.node_id;
|
||||||
|
if(array_exists(_ilist, _frNode)) {
|
||||||
|
_inarr[$ _frNode] = outputs[| i];
|
||||||
|
ds_list_delete(outputs, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(_ilist); i < n; i++ ) {
|
||||||
|
if(!struct_has(_inarr, _ilist[i])) continue;
|
||||||
|
|
||||||
|
ds_list_add(outputs, _inarr[$ _ilist[i]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var custom_input_list = [];
|
||||||
|
for( var i = custom_input_index, n = ds_list_size(inputs); i < n; i++ ) {
|
||||||
|
if(struct_has(inputs[| i], "from"))
|
||||||
|
array_push(custom_input_list, inputs[| i].from.node_id);
|
||||||
|
}
|
||||||
|
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static processSerialize = function(_map) { #region
|
static processSerialize = function(_map) { #region
|
||||||
|
|
|
@ -880,6 +880,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) { #region
|
static attributeDeserialize = function(attr) { #region
|
||||||
|
struct_append(attributes, attr);
|
||||||
|
|
||||||
if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension"))
|
if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension"))
|
||||||
attributes.use_project_dimension = false;
|
attributes.use_project_dimension = false;
|
||||||
|
|
||||||
|
|
|
@ -357,17 +357,19 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
inputs[| i].visible_in_list = false;
|
inputs[| i].visible_in_list = false;
|
||||||
|
|
||||||
inputs_amount = (input_display_list == -1 || !use_display_list)? ds_list_size(inputs) : array_length(input_display_list);
|
inputs_amount = (input_display_list == -1 || !use_display_list)? ds_list_size(inputs) : array_length(input_display_list);
|
||||||
inputs_index = array_create(inputs_amount);
|
inputs_index = [];
|
||||||
var _i = 0;
|
|
||||||
for( var i = 0; i < inputs_amount; i++ ) {
|
for( var i = 0; i < inputs_amount; i++ ) {
|
||||||
var _input = getInputJunctionIndex(i);
|
var _input = getInputJunctionIndex(i);
|
||||||
if(_input == noone) continue;
|
if(_input == noone) continue;
|
||||||
|
|
||||||
inputs_index[_i++] = _input;
|
var _inp = inputs[| _input];
|
||||||
inputs[| _input].visible_in_list = true;
|
if(!is_struct(_inp) || !is_instanceof(_inp, NodeValue)) continue;
|
||||||
|
|
||||||
|
array_push(inputs_index, _input);
|
||||||
|
_inp.visible_in_list = true;
|
||||||
}
|
}
|
||||||
inputs_amount = _i;
|
inputs_amount = array_length(inputs_index);
|
||||||
array_resize(inputs_index, inputs_amount);
|
|
||||||
|
|
||||||
outputs_amount = output_display_list == -1? ds_list_size(outputs) : array_length(output_display_list);
|
outputs_amount = output_display_list == -1? ds_list_size(outputs) : array_length(output_display_list);
|
||||||
outputs_index = array_create_ext(outputs_amount, function(index) { return getOutputJunctionIndex(index); });
|
outputs_index = array_create_ext(outputs_amount, function(index) { return getOutputJunctionIndex(index); });
|
||||||
|
@ -716,16 +718,14 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
|
|
||||||
static triggerRender = function() { #region
|
static triggerRender = function() { #region
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
//printCallStack();
|
|
||||||
LOG_IF(global.FLAG.render == 1, $"Trigger render for {self}");
|
LOG_IF(global.FLAG.render == 1, $"Trigger render for {self}");
|
||||||
|
|
||||||
setRenderStatus(false);
|
resetRender(false);
|
||||||
RENDER_PARTIAL
|
RENDER_PARTIAL
|
||||||
|
|
||||||
if(is_instanceof(group, Node_Collection) && group.reset_all_child) {
|
if(is_instanceof(group, Node_Collection)) {
|
||||||
group.resetRender();
|
group.triggerRender();
|
||||||
} else {
|
} else {
|
||||||
resetRender();
|
|
||||||
|
|
||||||
var nodes = getNextNodesRaw();
|
var nodes = getNextNodesRaw();
|
||||||
for(var i = 0; i < array_length(nodes); i++)
|
for(var i = 0; i < array_length(nodes); i++)
|
||||||
|
@ -795,6 +795,15 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
return true;
|
return true;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
static setRenderStatus = function(result) { #region
|
||||||
|
INLINE
|
||||||
|
|
||||||
|
if(rendered == result) return;
|
||||||
|
LOG_LINE_IF(global.FLAG.render == 1, $"Set render status for {self} : {result}");
|
||||||
|
|
||||||
|
rendered = result;
|
||||||
|
} #endregion
|
||||||
|
|
||||||
static getPreviousNodes = function() { #region
|
static getPreviousNodes = function() { #region
|
||||||
var prev = [];
|
var prev = [];
|
||||||
|
|
||||||
|
@ -897,15 +906,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
|
|
||||||
static onInspect = function() {}
|
static onInspect = function() {}
|
||||||
|
|
||||||
static setRenderStatus = function(result) { #region
|
|
||||||
INLINE
|
|
||||||
|
|
||||||
if(rendered == result) return;
|
|
||||||
LOG_LINE_IF(global.FLAG.render == 1, $"Set render status for {self} : {result}");
|
|
||||||
|
|
||||||
rendered = result;
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
static pointIn = function(_x, _y, _mx, _my, _s) { #region
|
static pointIn = function(_x, _y, _mx, _my, _s) { #region
|
||||||
var xx = x * _s + _x;
|
var xx = x * _s + _x;
|
||||||
var yy = y * _s + _y;
|
var yy = y * _s + _y;
|
||||||
|
@ -1616,6 +1616,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
static enable = function() { INLINE active = true; timeline_item.active = true; }
|
static enable = function() { INLINE active = true; timeline_item.active = true; }
|
||||||
static disable = function() { INLINE active = false; timeline_item.active = false; }
|
static disable = function() { INLINE active = false; timeline_item.active = false; }
|
||||||
|
|
||||||
|
static onDestroy = function() {}
|
||||||
|
|
||||||
static destroy = function(_merge = false) { #region
|
static destroy = function(_merge = false) { #region
|
||||||
if(!active) return;
|
if(!active) return;
|
||||||
disable();
|
disable();
|
||||||
|
@ -1660,10 +1662,13 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
RENDER_ALL_REORDER
|
RENDER_ALL_REORDER
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
static onRestore = function() {}
|
||||||
|
|
||||||
static restore = function() { #region
|
static restore = function() { #region
|
||||||
if(active) return;
|
if(active) return;
|
||||||
enable();
|
enable();
|
||||||
ds_list_add(group == noone? PROJECT.nodes : group.getNodeList(), self);
|
|
||||||
|
onRestore();
|
||||||
if(group) group.refreshNodes();
|
if(group) group.refreshNodes();
|
||||||
|
|
||||||
RENDER_ALL_REORDER
|
RENDER_ALL_REORDER
|
||||||
|
@ -1681,8 +1686,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
}
|
}
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static onDestroy = function() {}
|
|
||||||
|
|
||||||
static clearInputCache = function() { #region
|
static clearInputCache = function() { #region
|
||||||
for( var i = 0; i < ds_list_size(inputs); i++ )
|
for( var i = 0; i < ds_list_size(inputs); i++ )
|
||||||
inputs[| i].cache_value[0] = false;
|
inputs[| i].cache_value[0] = false;
|
||||||
|
@ -2118,7 +2121,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
static attributeDeserialize = function(attr) { #region
|
static attributeDeserialize = function(attr) { #region
|
||||||
if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension"))
|
if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension"))
|
||||||
attributes.use_project_dimension = false;
|
attributes.use_project_dimension = false;
|
||||||
struct_override(attributes, attr);
|
|
||||||
|
struct_append(attributes, attr);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static postDeserialize = function() {}
|
static postDeserialize = function() {}
|
||||||
|
|
|
@ -291,8 +291,11 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
|
|
||||||
ds_list_add(group.inputs, inParent);
|
ds_list_add(group.inputs, inParent);
|
||||||
outputs[| 0].setFrom(inParent, false, false);
|
outputs[| 0].setFrom(inParent, false, false);
|
||||||
|
|
||||||
|
if(!LOADING && !APPENDING) {
|
||||||
group.refreshNodeDisplay();
|
group.refreshNodeDisplay();
|
||||||
group.sortIO();
|
group.sortIO();
|
||||||
|
}
|
||||||
|
|
||||||
onValueUpdate(0);
|
onValueUpdate(0);
|
||||||
|
|
||||||
|
@ -379,8 +382,10 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
|
|
||||||
static onDestroy = function() { #region
|
static onDestroy = function() { #region
|
||||||
if(is_undefined(inParent)) return;
|
if(is_undefined(inParent)) return;
|
||||||
|
|
||||||
ds_list_remove(group.inputs, inParent);
|
ds_list_remove(group.inputs, inParent);
|
||||||
group.sortIO();
|
group.sortIO();
|
||||||
|
group.refreshNodes();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static ungroup = function() { #region
|
static ungroup = function() { #region
|
||||||
|
|
|
@ -79,8 +79,11 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
outParent.from = self;
|
outParent.from = self;
|
||||||
|
|
||||||
ds_list_add(group.outputs, outParent);
|
ds_list_add(group.outputs, outParent);
|
||||||
|
|
||||||
|
if(!LOADING && !APPENDING) {
|
||||||
group.refreshNodeDisplay();
|
group.refreshNodeDisplay();
|
||||||
group.sortIO();
|
group.sortIO();
|
||||||
|
}
|
||||||
|
|
||||||
outParent.setFrom(inputs[| 0]);
|
outParent.setFrom(inputs[| 0]);
|
||||||
} if(!LOADING && !APPENDING) createOutput(); #endregion
|
} if(!LOADING && !APPENDING) createOutput(); #endregion
|
||||||
|
@ -104,7 +107,6 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
if(group == noone) return;
|
if(group == noone) return;
|
||||||
|
|
||||||
createOutput(false);
|
createOutput(false);
|
||||||
group.sortIO();
|
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static doApplyDeserialize = function() { #region
|
static doApplyDeserialize = function() { #region
|
||||||
|
@ -113,8 +115,10 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
|
|
||||||
static onDestroy = function() { #region
|
static onDestroy = function() { #region
|
||||||
if(is_undefined(outParent)) return;
|
if(is_undefined(outParent)) return;
|
||||||
|
|
||||||
ds_list_remove(group.outputs, outParent);
|
ds_list_remove(group.outputs, outParent);
|
||||||
group.sortIO();
|
group.sortIO();
|
||||||
|
group.refreshNodes();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static ungroup = function() { #region
|
static ungroup = function() { #region
|
||||||
|
|
|
@ -814,6 +814,8 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
loadPin = noone;
|
loadPin = noone;
|
||||||
static attributeDeserialize = function(attr) { #region
|
static attributeDeserialize = function(attr) { #region
|
||||||
|
struct_append(attributes, attr);
|
||||||
|
|
||||||
if(struct_has(attr, "pin")) loadPin = attr.pin;
|
if(struct_has(attr, "pin")) loadPin = attr.pin;
|
||||||
if(struct_has(attr, "mesh_bound")) attributes.mesh_bound = attr.mesh_bound;;
|
if(struct_has(attr, "mesh_bound")) attributes.mesh_bound = attr.mesh_bound;;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
|
@ -756,6 +756,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) { #region
|
static attributeDeserialize = function(attr) { #region
|
||||||
|
struct_append(attributes, attr);
|
||||||
|
|
||||||
if(struct_has(attr, "mesh"))
|
if(struct_has(attr, "mesh"))
|
||||||
attributes.mesh = json_parse(attr.mesh);
|
attributes.mesh = json_parse(attr.mesh);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
|
@ -554,6 +554,8 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) { #region
|
static attributeDeserialize = function(attr) { #region
|
||||||
|
struct_append(attributes, attr);
|
||||||
|
|
||||||
if(struct_has(attr, "fixStrand"))
|
if(struct_has(attr, "fixStrand"))
|
||||||
groomed.deserialize(attr.fixStrand);
|
groomed.deserialize(attr.fixStrand);
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ function pathAnchorBox(_onModify) : widget() constructor {
|
||||||
tb[4].draw(_tx + (_tw + 4) * 2 + _bw + 8, _ty, _tw, _th, _data[4], _m);
|
tb[4].draw(_tx + (_tw + 4) * 2 + _bw + 8, _ty, _tw, _th, _data[4], _m);
|
||||||
tb[5].draw(_tx + (_tw + 4) * 3 + _bw + 8, _ty, _tw, _th, _data[5], _m);
|
tb[5].draw(_tx + (_tw + 4) * 3 + _bw + 8, _ty, _tw, _th, _data[5], _m);
|
||||||
|
|
||||||
var _linked = _data[6];
|
var _linked = array_safe_get(_data, 6);
|
||||||
var _blend = !_linked? COLORS._main_accent : COLORS._main_icon;
|
var _blend = !_linked? COLORS._main_accent : COLORS._main_icon;
|
||||||
var bx = _x + _w / 2 - _bw / 2 - 2;
|
var bx = _x + _w / 2 - _bw / 2 - 2;
|
||||||
var by = _ty + _th / 2 - _bw / 2;
|
var by = _ty + _th / 2 - _bw / 2;
|
||||||
|
|
|
@ -4,7 +4,7 @@ function check_version(path) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TESTING) return true;
|
//if(TESTING) return true;
|
||||||
|
|
||||||
var res = json_load_struct(path);
|
var res = json_load_struct(path);
|
||||||
json_save_struct(path, { version: BUILD_NUMBER });
|
json_save_struct(path, { version: BUILD_NUMBER });
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
//
|
|
||||||
// Simple passthrough fragment shader
|
|
||||||
//
|
|
||||||
varying vec2 v_vTexcoord;
|
|
||||||
varying vec4 v_vColour;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
vec4 c = texture2D( gm_BaseTexture, v_vTexcoord );
|
|
||||||
gl_FragColor = 1. - c;
|
|
||||||
}
|
|
12
shaders/sh_mask_invert/sh_mask_invert.fsh
Normal file
12
shaders/sh_mask_invert/sh_mask_invert.fsh
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
varying vec2 v_vTexcoord;
|
||||||
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
uniform int invert;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec4 c = texture2D( gm_BaseTexture, v_vTexcoord );
|
||||||
|
float m = (c.r + c.g + c.b) / 3. * c.a;
|
||||||
|
if(invert == 1) m = 1. - m;
|
||||||
|
|
||||||
|
gl_FragColor = vec4(m, m, m, 1.);
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$GMShader":"",
|
"$GMShader":"",
|
||||||
"%Name":"sh_invert_all",
|
"%Name":"sh_mask_invert",
|
||||||
"name":"sh_invert_all",
|
"name":"sh_mask_invert",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"color",
|
"name":"color",
|
||||||
"path":"folders/shader/filter/color.yy",
|
"path":"folders/shader/filter/color.yy",
|
Loading…
Reference in a new issue