mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-03 08:45:17 +01:00
[Lua surface, lua compute] Fix value input not showing up in the first argument.
This commit is contained in:
parent
22ca680fe4
commit
c7e22ff2bd
5 changed files with 17 additions and 10 deletions
|
@ -185,7 +185,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
input_hash_raw = "";
|
input_hash_raw = "";
|
||||||
|
|
||||||
inputs_amount = 0;
|
inputs_amount = 0;
|
||||||
inputs_index = [];
|
|
||||||
in_cache_len = 0;
|
in_cache_len = 0;
|
||||||
inputDisplayList = [];
|
inputDisplayList = [];
|
||||||
|
|
||||||
|
@ -660,7 +659,6 @@ 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 = getInputJunctionAmount();
|
inputs_amount = getInputJunctionAmount();
|
||||||
inputs_index = [];
|
|
||||||
|
|
||||||
for( var i = 0; i < inputs_amount; i++ ) {
|
for( var i = 0; i < inputs_amount; i++ ) {
|
||||||
var _input = getInputJunctionIndex(i);
|
var _input = getInputJunctionIndex(i);
|
||||||
|
@ -669,13 +667,11 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
var _inp = inputs[_input];
|
var _inp = inputs[_input];
|
||||||
if(!is_struct(_inp) || !is_instanceof(_inp, NodeValue)) continue;
|
if(!is_struct(_inp) || !is_instanceof(_inp, NodeValue)) continue;
|
||||||
|
|
||||||
array_push(inputs_index, _input);
|
|
||||||
_inp.visible_in_list = true;
|
_inp.visible_in_list = true;
|
||||||
}
|
}
|
||||||
inputs_amount = array_length(inputs_index);
|
|
||||||
|
|
||||||
outputs_index = array_create_ext(getOutputJunctionAmount(), function(index) { return getOutputJunctionIndex(index); });
|
outputs_index = array_create_ext(getOutputJunctionAmount(), function(index) { return getOutputJunctionIndex(index); });
|
||||||
} //run_in(1, () => { updateIO() });
|
}
|
||||||
|
|
||||||
static setHeight = function() {
|
static setHeight = function() {
|
||||||
|
|
||||||
|
@ -781,6 +777,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var amo = input_display_list == -1? array_length(inputs) : array_length(input_display_list);
|
var amo = input_display_list == -1? array_length(inputs) : array_length(input_display_list);
|
||||||
|
// print($"Amo = {amo}");
|
||||||
|
|
||||||
for(var i = 0; i < amo; i++) {
|
for(var i = 0; i < amo; i++) {
|
||||||
var ind = getInputJunctionIndex(i);
|
var ind = getInputJunctionIndex(i);
|
||||||
|
@ -788,11 +785,16 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
|
|
||||||
var jun = array_safe_get(inputs, ind, noone);
|
var jun = array_safe_get(inputs, ind, noone);
|
||||||
if(jun == noone || is_undefined(jun)) continue;
|
if(jun == noone || is_undefined(jun)) continue;
|
||||||
|
|
||||||
|
// print($"{i}: {jun.isVisible()}");
|
||||||
|
// print($" {jun.visible_manual}, {jun.visible}, {jun.index}, {jun.visible_in_list}");
|
||||||
|
|
||||||
if(!jun.isVisible()) continue;
|
if(!jun.isVisible()) continue;
|
||||||
|
|
||||||
array_push(inputDisplayList, jun);
|
array_push(inputDisplayList, jun);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print($"{inputDisplayList}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(auto_input && dummy_input) array_push(inputDisplayList, dummy_input);
|
if(auto_input && dummy_input) array_push(inputDisplayList, dummy_input);
|
||||||
|
|
|
@ -27,7 +27,8 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
color = COLORS.node_blend_input;
|
color = COLORS.node_blend_input;
|
||||||
|
|
||||||
newInput(0, nodeValue_Path("Path", self, ""))
|
newInput(0, nodeValue_Path("Path", self, ""))
|
||||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "image|*.png;*.jpg" });
|
.setDisplay(VALUE_DISPLAY.path_load, { filter: "image|*.png;*.jpg" })
|
||||||
|
.rejectArray();
|
||||||
|
|
||||||
newInput(1, nodeValue_Padding("Padding", self, [0, 0, 0, 0]));
|
newInput(1, nodeValue_Padding("Padding", self, [0, 0, 0, 0]));
|
||||||
|
|
||||||
|
@ -98,6 +99,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
static step = function() {
|
static step = function() {
|
||||||
var path = path_get(getInputData(0));
|
var path = path_get(getInputData(0));
|
||||||
|
|
||||||
|
if(is_array(path)) return;
|
||||||
if(!file_exists_empty(path)) return;
|
if(!file_exists_empty(path)) return;
|
||||||
|
|
||||||
if(attributes.file_checker && file_get_modify_s(path) > edit_time) {
|
if(attributes.file_checker && file_get_modify_s(path) > edit_time) {
|
||||||
|
@ -111,6 +113,8 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var path = path_get(getInputData(0));
|
var path = path_get(getInputData(0));
|
||||||
var pad = getInputData(1);
|
var pad = getInputData(1);
|
||||||
|
|
||||||
|
if(is_array(path)) return;
|
||||||
|
|
||||||
outputs[1].setValue(path);
|
outputs[1].setValue(path);
|
||||||
updatePaths(path);
|
updatePaths(path);
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
array_resize(input_display_list, input_display_len);
|
array_resize(input_display_list, input_display_len);
|
||||||
|
|
||||||
for( var i = input_fix_len; i < array_length(inputs); i += data_length ) {
|
for( var i = input_fix_len; i < array_length(inputs); i += data_length ) {
|
||||||
if(getInputDataForce(i) != "") {
|
if(inputs[i].getValue() != "") {
|
||||||
array_push(_in, inputs[i + 0]);
|
array_push(_in, inputs[i + 0]);
|
||||||
array_push(_in, inputs[i + 1]);
|
array_push(_in, inputs[i + 1]);
|
||||||
array_push(_in, inputs[i + 2]);
|
array_push(_in, inputs[i + 2]);
|
||||||
|
@ -90,6 +90,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
|
|
||||||
refreshInputType();
|
refreshInputType();
|
||||||
createNewInput();
|
createNewInput();
|
||||||
|
refreshNodeDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
static refreshInputType = function() {
|
static refreshInputType = function() {
|
||||||
|
|
|
@ -69,7 +69,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
array_resize(input_display_list, input_display_len);
|
array_resize(input_display_list, input_display_len);
|
||||||
|
|
||||||
for( var i = input_fix_len; i < array_length(inputs); i += data_length ) {
|
for( var i = input_fix_len; i < array_length(inputs); i += data_length ) {
|
||||||
if(getInputDataForce(i) != "") {
|
if(inputs[i].getValue() != "") {
|
||||||
array_push(_in, inputs[i + 0]);
|
array_push(_in, inputs[i + 0]);
|
||||||
array_push(_in, inputs[i + 1]);
|
array_push(_in, inputs[i + 1]);
|
||||||
array_push(_in, inputs[i + 2]);
|
array_push(_in, inputs[i + 2]);
|
||||||
|
@ -94,6 +94,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
|
|
||||||
refreshInputType();
|
refreshInputType();
|
||||||
createNewInput();
|
createNewInput();
|
||||||
|
refreshNodeDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
static refreshInputType = function() {
|
static refreshInputType = function() {
|
||||||
|
|
|
@ -544,7 +544,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
if(value_from) return true;
|
if(value_from) return true;
|
||||||
if(visible_manual != 0) return visible_manual == 1;
|
if(visible_manual != 0) return visible_manual == 1;
|
||||||
if(!visible) return false;
|
if(!visible) return false;
|
||||||
|
|
||||||
if(index == -1) return true;
|
if(index == -1) return true;
|
||||||
|
|
||||||
return visible_in_list;
|
return visible_in_list;
|
||||||
|
|
Loading…
Reference in a new issue