mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 11:28:06 +01:00
junction as array
This commit is contained in:
parent
8103abca06
commit
0c3173c624
633 changed files with 7947 additions and 7952 deletions
|
@ -146,8 +146,8 @@
|
|||
{"name":"types","order":4,"path":"folders/nodes/values/types.yy",},
|
||||
{"name":"3d","order":31,"path":"folders/nodes/values/types/3d.yy",},
|
||||
{"name":"colors","order":32,"path":"folders/nodes/values/types/colors.yy",},
|
||||
{"name":"object","order":33,"path":"folders/nodes/values/types/object.yy",},
|
||||
{"name":"numeric","order":30,"path":"folders/nodes/values/types/numeric.yy",},
|
||||
{"name":"object","order":33,"path":"folders/nodes/values/types/object.yy",},
|
||||
{"name":"panels","order":150,"path":"folders/panels.yy",},
|
||||
{"name":"video_banner","order":11,"path":"folders/panels/_others/video_banner.yy",},
|
||||
{"name":"components","order":3,"path":"folders/panels/inspectors/components.yy",},
|
||||
|
|
|
@ -246,8 +246,8 @@
|
|||
{"$GMFolder":"","%Name":"types","folderPath":"folders/nodes/values/types.yy","name":"types","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"3d","folderPath":"folders/nodes/values/types/3d.yy","name":"3d","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"colors","folderPath":"folders/nodes/values/types/colors.yy","name":"colors","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"object","folderPath":"folders/nodes/values/types/object.yy","name":"object","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"numeric","folderPath":"folders/nodes/values/types/numeric.yy","name":"numeric","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"object","folderPath":"folders/nodes/values/types/object.yy","name":"object","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"panels","folderPath":"folders/panels.yy","name":"panels","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"_others","folderPath":"folders/panels/_others.yy","name":"_others","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"video_banner","folderPath":"folders/panels/_others/video_banner.yy","name":"video_banner","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
|
|
|
@ -155,15 +155,12 @@ event_inherited();
|
|||
}
|
||||
|
||||
var _new_node = noone;
|
||||
var _inputs = ds_list_create();
|
||||
var _outputs = ds_list_create();
|
||||
var _inputs = [];
|
||||
var _outputs = [];
|
||||
|
||||
if(is_instanceof(_node, NodeObject)) {
|
||||
_new_node = _node.build(node_target_x, node_target_y,, _param);
|
||||
if(!_new_node) {
|
||||
ds_list_destroy(_inputs); ds_list_destroy(_outputs);
|
||||
return;
|
||||
}
|
||||
if(!_new_node) return;
|
||||
|
||||
if(category == NODE_CATEGORY && _node.show_in_recent) {
|
||||
array_remove(global.RECENT_NODES, _node.node);
|
||||
|
@ -175,35 +172,22 @@ event_inherited();
|
|||
if(is_instanceof(context, Node_Collection_Inline))
|
||||
context.addNode(_new_node);
|
||||
|
||||
for( var i = 0, n = ds_list_size(_new_node.inputs); i < n; i++ )
|
||||
ds_list_add(_inputs, _new_node.inputs[| i]);
|
||||
for( var i = 0, n = array_length(_new_node.inputs); i < n; i++ )
|
||||
array_push(_inputs, _new_node.inputs[i]);
|
||||
|
||||
if(_new_node.dummy_input)
|
||||
ds_list_add(_inputs, _new_node.dummy_input);
|
||||
array_push(_inputs, _new_node.dummy_input);
|
||||
|
||||
for( var i = 0, n = ds_list_size(_new_node.outputs); i < n; i++ )
|
||||
ds_list_add(_outputs, _new_node.outputs[| i]);
|
||||
for( var i = 0, n = array_length(_new_node.outputs); i < n; i++ )
|
||||
array_push(_outputs, _new_node.outputs[i]);
|
||||
|
||||
} else if(is_instanceof(_node, NodeAction)) { ////////////////////////////////////////// NOT IMPLEMENTED
|
||||
var res = _node.build(node_target_x, node_target_y,, _param);
|
||||
|
||||
// if(_node.inputNode != noone) {
|
||||
// _inputs = res[$ _node.inputNode].inputs;
|
||||
// }
|
||||
|
||||
// if(_node.outputNode != noone) {
|
||||
// _outputs = res[$ _node.outputNode].outputs;
|
||||
// }
|
||||
|
||||
ds_list_destroy(_inputs); ds_list_destroy(_outputs);
|
||||
_node.build(node_target_x, node_target_y,, _param);
|
||||
return;
|
||||
|
||||
} else {
|
||||
var _new_list = APPEND(_node.path);
|
||||
if(_new_list == noone) {
|
||||
ds_list_destroy(_inputs); ds_list_destroy(_outputs);
|
||||
return;
|
||||
}
|
||||
if(_new_list == noone) return;
|
||||
|
||||
var tx = 99999;
|
||||
var ty = 99999;
|
||||
|
@ -225,15 +209,15 @@ event_inherited();
|
|||
|
||||
for( var i = 0; i < array_length(_new_list); i++ ) {
|
||||
var _in = _new_list[i].inputs;
|
||||
for( var j = 0; j < ds_list_size(_in); j++ ) {
|
||||
if(_in[| j].value_from == noone)
|
||||
ds_list_add(_inputs, _in[| j]);
|
||||
for( var j = 0; j < array_length(_in); j++ ) {
|
||||
if(_in[j].value_from == noone)
|
||||
array_push(_inputs, _in[j]);
|
||||
}
|
||||
|
||||
var _ot = _new_list[i].outputs;
|
||||
for( var j = 0; j < ds_list_size(_ot); j++ ) {
|
||||
if(array_empty(_ot[| j].value_to))
|
||||
ds_list_add(_outputs, _ot[| j]);
|
||||
for( var j = 0; j < array_length(_ot); j++ ) {
|
||||
if(array_empty(_ot[j].value_to))
|
||||
array_push(_outputs, _ot[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -243,18 +227,18 @@ event_inherited();
|
|||
var _call_input = node_called.connect_type == JUNCTION_CONNECT.input;
|
||||
var _junc_list = _call_input? _outputs : _inputs;
|
||||
|
||||
for(var i = 0; i < ds_list_size(_junc_list); i++) {
|
||||
var _target = _junc_list[| i];
|
||||
for(var i = 0; i < array_length(_junc_list); i++) {
|
||||
var _target = _junc_list[i];
|
||||
if(!_target.auto_connect) continue;
|
||||
|
||||
if(_call_input && node_called.isConnectableStrict(_junc_list[| i]) == 1) {
|
||||
node_called.setFrom(_junc_list[| i]);
|
||||
if(_call_input && node_called.isConnectableStrict(_junc_list[i]) == 1) {
|
||||
node_called.setFrom(_junc_list[i]);
|
||||
_new_node.x -= _new_node.w;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!_call_input && _junc_list[| i].isConnectableStrict(node_called) == 1) {
|
||||
_junc_list[| i].setFrom(node_called);
|
||||
if(!_call_input && _junc_list[i].isConnectableStrict(node_called) == 1) {
|
||||
_junc_list[i].setFrom(node_called);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -263,16 +247,16 @@ event_inherited();
|
|||
var to = junction_hovering;
|
||||
var from = junction_hovering.value_from;
|
||||
|
||||
for( var i = 0; i < ds_list_size(_inputs); i++ ) {
|
||||
var _in = _inputs[| i];
|
||||
for( var i = 0; i < array_length(_inputs); i++ ) {
|
||||
var _in = _inputs[i];
|
||||
if(_in.auto_connect && _in.isConnectableStrict(from)) {
|
||||
_in.setFrom(from);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for( var i = 0; i < ds_list_size(_outputs); i++ ) {
|
||||
var _ot = _outputs[| i];
|
||||
for( var i = 0; i < array_length(_outputs); i++ ) {
|
||||
var _ot = _outputs[i];
|
||||
if(to.isConnectableStrict(_ot)) {
|
||||
to.setFrom(_ot);
|
||||
break;
|
||||
|
@ -295,9 +279,6 @@ event_inherited();
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
ds_list_destroy(_inputs);
|
||||
ds_list_destroy(_outputs);
|
||||
}
|
||||
|
||||
catagory_pane = new scrollPane(category_width, dialog_h - ui(66), function(_y, _m) { #region catagory_pane
|
||||
|
|
|
@ -51,7 +51,7 @@ event_inherited();
|
|||
if((i == n - 1 && _m[1] > _y0) || (_m[1] > _y0 && _m[1] <= _y1) || (i == 0 && _m[1] < _y1))
|
||||
hovr = i;
|
||||
|
||||
var ind = node.inputs[| disp];
|
||||
var ind = node.inputs[disp];
|
||||
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub);
|
||||
draw_text_add(hg + ui(8), _y + hg / 2 - 1, ind.name);
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ event_inherited();
|
|||
if(node == noone) return 0;
|
||||
|
||||
var hh = line_get_height() + ui(8);
|
||||
var _h = ds_list_size(node.outputs) * hh;
|
||||
var _h = array_length(node.outputs) * hh;
|
||||
|
||||
for( var i = 0; i < ds_list_size(node.outputs); i++ ) {
|
||||
var output = node.outputs[| i];
|
||||
for( var i = 0; i < array_length(node.outputs); i++ ) {
|
||||
var output = node.outputs[i];
|
||||
var _yy = _y + hh * i;
|
||||
|
||||
if(sHOVER && sc_outputs.hover && point_in_rectangle(_m[0], _m[1], 0, _yy, sc_outputs.w, _yy + hh - 1)) {
|
||||
|
|
|
@ -123,6 +123,8 @@ _FILE_DROPPED = false;
|
|||
NodeTopoSort();
|
||||
}
|
||||
|
||||
if(!PROJECT.safeMode) array_foreach(PROJECT.allNodes, function(_node) /*=>*/ { if(!_node.active) return; _node.stepBegin(); });
|
||||
|
||||
if(LIVE_UPDATE)
|
||||
Render();
|
||||
else if(!PROJECT.safeMode) {
|
||||
|
@ -130,7 +132,6 @@ _FILE_DROPPED = false;
|
|||
|
||||
if(PROJECT.active) {
|
||||
PROJECT.animator.is_simulating = false;
|
||||
array_foreach(PROJECT.allNodes, function(_node) { if(!_node.active) return; _node.stepBegin(); });
|
||||
|
||||
if(PROGRAM_ARGUMENTS._run) {
|
||||
if(PROJECT != noone && PROJECT.path != "") {
|
||||
|
|
|
@ -350,7 +350,7 @@ enum CAMERA_PROJ {
|
|||
if(drag_prev != undefined) {
|
||||
_pos[drag_index] += (mAdj - drag_prev) / 8000;
|
||||
|
||||
if(inputs[| input_pos].setValue(_pos))
|
||||
if(inputs[input_pos].setValue(_pos))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
drag_prev = mAdj;
|
||||
|
@ -416,7 +416,7 @@ enum CAMERA_PROJ {
|
|||
var _mulp = _currQ.Mul(_currR);
|
||||
var _Nrot = new BBMOD_Matrix(_mulp.ToMatrix()).ToEuler();
|
||||
|
||||
if(inputs[| input_rot].setValue(_Nrot))
|
||||
if(inputs[input_rot].setValue(_Nrot))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
|
||||
|
@ -467,7 +467,7 @@ enum CAMERA_PROJ {
|
|||
if(drag_prev != undefined) {
|
||||
_sca[drag_index] += (mAdj - drag_prev) / 8000;
|
||||
|
||||
if(inputs[| input_sca].setValue(_sca))
|
||||
if(inputs[input_sca].setValue(_sca))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
drag_prev = mAdj;
|
||||
|
@ -486,7 +486,7 @@ enum CAMERA_PROJ {
|
|||
drag_my = _my;
|
||||
}
|
||||
|
||||
inputs[| global_pos].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[global_pos].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
|
|
@ -479,7 +479,7 @@ function __part(_node) : __particleObject() constructor {
|
|||
|
||||
#region helper
|
||||
#macro UPDATE_PART_FORWARD static updateParticleForward = function() { \
|
||||
var pt = outputs[| 0]; \
|
||||
var pt = outputs[0]; \
|
||||
for( var i = 0; i < array_length(pt.value_to); i++ ) { \
|
||||
var _n = pt.value_to[i]; \
|
||||
if(_n.value_from != pt) continue; \
|
||||
|
|
|
@ -4,9 +4,9 @@ function __Node_Base(x, y) constructor {
|
|||
|
||||
node_id = 0;
|
||||
|
||||
display_name = "";
|
||||
inputs = ds_list_create();
|
||||
outputs = ds_list_create();
|
||||
display_name = "";
|
||||
inputs = [];
|
||||
outputs = [];
|
||||
input_value_map = {};
|
||||
|
||||
active_index = -1;
|
||||
|
@ -31,8 +31,8 @@ function __Node_Base(x, y) constructor {
|
|||
var _pre_anim = is_anim_timeline;
|
||||
var _cur_anim = anim_timeline;
|
||||
|
||||
for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) {
|
||||
var _inp = inputs[| i];
|
||||
for( var i = 0, n = array_length(inputs); i < n; i++ ) {
|
||||
var _inp = inputs[i];
|
||||
if(_inp.is_anim && _inp.value_from == noone) {
|
||||
_cur_anim = true;
|
||||
break;
|
||||
|
|
|
@ -11,9 +11,9 @@ function Node_3D(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constr
|
|||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {}
|
||||
|
||||
static getPreviewObject = function() { #region
|
||||
if(ds_list_empty(outputs)) return noone;
|
||||
if(array_empty(outputs)) return noone;
|
||||
|
||||
switch(outputs[| preview_channel].type) {
|
||||
switch(outputs[preview_channel].type) {
|
||||
case VALUE_TYPE.d3Mesh :
|
||||
case VALUE_TYPE.d3Light :
|
||||
case VALUE_TYPE.d3Camera :
|
||||
|
@ -22,7 +22,7 @@ function Node_3D(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constr
|
|||
default : return noone;
|
||||
}
|
||||
|
||||
var _obj = outputs[| 0].getValue();
|
||||
var _obj = outputs[0].getValue();
|
||||
if(is_array(_obj)) _obj = array_safe_get_fast(_obj, preview_index, noone);
|
||||
|
||||
return _obj;
|
||||
|
|
|
@ -1,50 +1,50 @@
|
|||
function __Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "3D Combine";
|
||||
|
||||
inputs[| 0] = nodeValue_Dimension(self)
|
||||
inputs[0] = nodeValue_Dimension(self)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ])
|
||||
inputs[1] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ])
|
||||
inputs[2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ])
|
||||
inputs[3] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[4] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef( function() { return getInputData(2); }, VALUE_UNIT.reference)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Render scale", self, [ 1, 1 ])
|
||||
inputs[5] = nodeValue_Vector("Render scale", self, [ 1, 1 ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 6] = nodeValue_Rotation("Light direction", self, 0)
|
||||
inputs[6] = nodeValue_Rotation("Light direction", self, 0)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 7] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[7] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 8] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[8] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 9] = nodeValue_Color("Light color", self, c_white)
|
||||
inputs[9] = nodeValue_Color("Light color", self, c_white)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 10] = nodeValue_Color("Ambient color", self, c_grey)
|
||||
inputs[10] = nodeValue_Color("Ambient color", self, c_grey)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 11] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[11] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 12] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[12] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 90, 0.1 ] })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 13] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[13] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
input_display_list = [
|
||||
["Output", false], 0, 13,
|
||||
|
@ -54,19 +54,19 @@ function __Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
["Objects", true],
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D objects", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D objects", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
output_display_list = [ 0, 2, 1 ]
|
||||
|
||||
_3d_node_init(1, /*Transform*/ 4, 5, 1, 2, 3);
|
||||
|
||||
static createNewInput = function() {
|
||||
var index = ds_list_size(inputs);
|
||||
inputs[| index] = nodeValue("3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone )
|
||||
var index = array_length(inputs);
|
||||
inputs[index] = nodeValue("3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
array_push(input_display_list, index);
|
||||
|
@ -91,7 +91,7 @@ function __Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
for( var i = input_fix_len; i < array_length(inputs) - 1; i++ ) {
|
||||
var sv = getInputData(i);
|
||||
|
||||
if(is_array(sv)) {
|
||||
|
@ -125,12 +125,12 @@ function __Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
var _fov = getInputData(12);
|
||||
var _dimS = getInputData(13);
|
||||
|
||||
inputs[| 12].setVisible(_proj);
|
||||
inputs[12].setVisible(_proj);
|
||||
|
||||
for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) {
|
||||
var ind = output_display_list[i];
|
||||
var _outSurf = outputs[| ind].getValue();
|
||||
outputs[| ind].setValue(surface_verify(_outSurf, _dim[0], _dim[1]));
|
||||
var _outSurf = outputs[ind].getValue();
|
||||
outputs[ind].setValue(surface_verify(_outSurf, _dim[0], _dim[1]));
|
||||
|
||||
var pass = "diff";
|
||||
switch(ind) {
|
||||
|
|
|
@ -2,45 +2,45 @@ function __Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
name = "3D Displace";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Dimension(self);
|
||||
inputs[0] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[1] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[3] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[4] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef( function() { return getInputData(0); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 6] = nodeValue_Rotation("Light direction", self, 0);
|
||||
inputs[6] = nodeValue_Rotation("Light direction", self, 0);
|
||||
|
||||
inputs[| 7] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[7] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] });
|
||||
|
||||
inputs[| 8] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[8] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 9] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[9] = nodeValue_Color("Light color", self, c_white);
|
||||
|
||||
inputs[| 10] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
inputs[10] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
|
||||
inputs[| 11] = nodeValue("3D vertex", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3vertex, [])
|
||||
inputs[11] = nodeValue("3D vertex", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3vertex, [])
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 12] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[12] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 13] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[13] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 14] = nodeValue_Bool("Scale view with dimension", self, true);
|
||||
inputs[14] = nodeValue_Bool("Scale view with dimension", self, true);
|
||||
|
||||
inputs[| 15] = nodeValue_Surface("Displacement map", self);
|
||||
inputs[15] = nodeValue_Surface("Displacement map", self);
|
||||
|
||||
inputs[| 16] = nodeValue_Float("Strength", self, 1)
|
||||
inputs[16] = nodeValue_Float("Strength", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 4, 0.01 ] });
|
||||
|
||||
input_display_list = [ 11,
|
||||
|
@ -51,13 +51,13 @@ function __Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
["Light", true], 6, 7, 8, 9, 10,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
outputs[3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
|
||||
output_display_list = [
|
||||
0, 2, 1, 3,
|
||||
|
@ -92,7 +92,7 @@ function __Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
|
||||
static step = function() {
|
||||
var _proj = getInputData(12);
|
||||
inputs[| 13].setVisible(_proj);
|
||||
inputs[13].setVisible(_proj);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
function __Node_3D_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "3D Export";
|
||||
|
||||
inputs[| 0] = nodeValue("Vertex data", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3vertex, [] )
|
||||
inputs[0] = nodeValue("Vertex data", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3vertex, [] )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Text("Path", self, "", "Export location without '.obj' extension." )
|
||||
inputs[1] = nodeValue_Text("Path", self, "", "Export location without '.obj' extension." )
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "3d object|*.obj" });
|
||||
|
||||
inputs[| 2] = nodeValue_Bool("Export texture", self, true );
|
||||
inputs[2] = nodeValue_Bool("Export texture", self, true );
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Export", false], 1, 2,
|
||||
|
|
|
@ -2,50 +2,50 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
name = "3D Extrude";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Surface in", self);
|
||||
inputs[0] = nodeValue_Surface("Surface in", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Dimension(self);
|
||||
inputs[1] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[2] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Object rotation", self, [ 0, 180, 0 ]);
|
||||
inputs[3] = nodeValue_Vector("Object rotation", self, [ 0, 180, 0 ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Object scale", self, [ 1, 1, 0.1 ]);
|
||||
inputs[4] = nodeValue_Vector("Object scale", self, [ 1, 1, 0.1 ]);
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[5] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef( function() { return getInputData(1); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 6] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[6] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 7] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[7] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 8] = nodeValue_Trigger("Manual generate", self, false )
|
||||
inputs[8] = nodeValue_Trigger("Manual generate", self, false )
|
||||
.setDisplay(VALUE_DISPLAY.button, { name: "Generate", UI : true, onClick: function() { generateMesh(); doUpdate(); } });
|
||||
|
||||
inputs[| 9] = nodeValue_Rotation("Light direction", self, 0);
|
||||
inputs[9] = nodeValue_Rotation("Light direction", self, 0);
|
||||
|
||||
inputs[| 10] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[10] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] });
|
||||
|
||||
inputs[| 11] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[11] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 12] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[| 13] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
inputs[12] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[13] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
|
||||
inputs[| 14] = nodeValue_Surface("Height map", self);
|
||||
inputs[14] = nodeValue_Surface("Height map", self);
|
||||
|
||||
inputs[| 15] = nodeValue_Bool("Always update", self, false);
|
||||
inputs[15] = nodeValue_Bool("Always update", self, false);
|
||||
|
||||
inputs[| 16] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[16] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 17] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[17] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 18] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[18] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
inputs[| 19] = nodeValue_Bool("Smooth", self, false)
|
||||
inputs[19] = nodeValue_Bool("Smooth", self, false)
|
||||
|
||||
input_display_list = [
|
||||
["Output", false], 1, 18,
|
||||
|
@ -55,13 +55,13 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
["Light", false], 9, 10, 11, 12, 13,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function(index) { return submit_vertex(index); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function(index) { return submit_vertex(index); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
outputs[3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
|
||||
output_display_list = [
|
||||
0, 2, 1, 3
|
||||
|
@ -396,7 +396,7 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
mesh_genetated = true;
|
||||
|
||||
RENDER_ALL
|
||||
outputs[| 3].setValue(vertexObjects);
|
||||
outputs[3].setValue(vertexObjects);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
var _dimS = _data[18];
|
||||
var _smt = _data[19];
|
||||
|
||||
inputs[| 17].setVisible(_proj);
|
||||
inputs[17].setVisible(_proj);
|
||||
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
if(!is_surface(_ins)) return _outSurf;
|
||||
|
|
|
@ -2,18 +2,18 @@ function Node_3D_Light(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
name = "3D Light";
|
||||
|
||||
if(!LOADING && !APPENDING)
|
||||
inputs[| 0].setValue([ 0, 0, 1 ]);
|
||||
inputs[0].setValue([ 0, 0, 1 ]);
|
||||
|
||||
inputs[| in_d3d + 0] = nodeValue_Bool("Active", self, true);
|
||||
inputs[in_d3d + 0] = nodeValue_Bool("Active", self, true);
|
||||
|
||||
inputs[| in_d3d + 1] = nodeValue_Color("Color", self, c_white);
|
||||
inputs[in_d3d + 1] = nodeValue_Color("Color", self, c_white);
|
||||
|
||||
inputs[| in_d3d + 2] = nodeValue_Float("Intensity", self, 1)
|
||||
inputs[in_d3d + 2] = nodeValue_Float("Intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
in_light = ds_list_size(inputs);
|
||||
in_light = array_length(inputs);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Light", self, VALUE_TYPE.d3Light, noone);
|
||||
outputs[0] = nodeValue_Output("Light", self, VALUE_TYPE.d3Light, noone);
|
||||
|
||||
#macro __d3d_input_list_light ["Light", false], in_d3d + 0, in_d3d + 1, in_d3d + 2
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
function Node_3D_Mesh(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group) constructor {
|
||||
name = "3D Mesh";
|
||||
|
||||
in_mesh = ds_list_size(inputs);
|
||||
in_mesh = array_length(inputs);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Mesh", self, VALUE_TYPE.d3Mesh, noone);
|
||||
outputs[0] = nodeValue_Output("Mesh", self, VALUE_TYPE.d3Mesh, noone);
|
||||
|
||||
#macro __d3d_input_list_mesh ["Mesh", false]
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
function Node_3D_Modifier(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor {
|
||||
name = "3D Mesh Modifier";
|
||||
|
||||
inputs[| 0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
inputs[0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
in_mesh = ds_list_size(inputs);
|
||||
in_mesh = array_length(inputs);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Mesh", self, VALUE_TYPE.d3Mesh, noone);
|
||||
outputs[0] = nodeValue_Output("Mesh", self, VALUE_TYPE.d3Mesh, noone);
|
||||
|
||||
static modify_object = function(_object, _data, _matrix) { #region
|
||||
return _object;
|
||||
|
|
|
@ -1,59 +1,59 @@
|
|||
function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "3D Object";
|
||||
|
||||
inputs[| 0] = nodeValue_Text("Path", self, "")
|
||||
inputs[0] = nodeValue_Text("Path", self, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "3d object|*.obj" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue_Trigger("Generate", self, false )
|
||||
inputs[1] = nodeValue_Trigger("Generate", self, false )
|
||||
.setDisplay(VALUE_DISPLAY.button, { name: "Generate", UI : true, onClick: function() {
|
||||
updateObj();
|
||||
doUpdate();
|
||||
} });
|
||||
|
||||
inputs[| 2] = nodeValue_Dimension(self);
|
||||
inputs[2] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[3] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef( function() { return getInputData(2); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[4] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 6] = nodeValue_Rotation("Light direction", self, 0)
|
||||
inputs[6] = nodeValue_Rotation("Light direction", self, 0)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 7] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[7] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 8] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[8] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 9] = nodeValue_Color("Light color", self, c_white)
|
||||
inputs[9] = nodeValue_Color("Light color", self, c_white)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 10] = nodeValue_Color("Ambient color", self, c_grey)
|
||||
inputs[10] = nodeValue_Color("Ambient color", self, c_grey)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 11] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[11] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 12] = nodeValue_Bool("Flip UV", self, true, "Flip UV axis, can be use to fix some texture mapping error.")
|
||||
inputs[12] = nodeValue_Bool("Flip UV", self, true, "Flip UV axis, can be use to fix some texture mapping error.")
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 13] = nodeValue_Vector("Object rotation", self, [ 0, 0, 180 ]);
|
||||
inputs[13] = nodeValue_Vector("Object rotation", self, [ 0, 0, 180 ]);
|
||||
|
||||
inputs[| 14] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[14] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 15] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[15] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 16] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[16] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 90, 0.1 ] })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 17] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[17] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
input_display_list = [
|
||||
["Output", false], 2, 17,
|
||||
|
@ -63,14 +63,14 @@ function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
|||
["Light", false], 6, 7, 8, 9, 10,
|
||||
["Textures", true], 12,
|
||||
];
|
||||
input_length = ds_list_size(inputs);
|
||||
input_length = array_length(inputs);
|
||||
input_display_len = array_length(input_display_list);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
output_display_list = [
|
||||
0, 2, 1
|
||||
|
@ -97,14 +97,14 @@ function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
|||
}
|
||||
|
||||
function setPath(path) {
|
||||
inputs[| 0].setValue(path);
|
||||
inputs[0].setValue(path);
|
||||
updateObj();
|
||||
}
|
||||
|
||||
function createMaterial(m_index) {
|
||||
var index = ds_list_size(inputs);
|
||||
inputs[| index] = nodeValue_Surface(materialNames[m_index] + " texture", self, tex_surface);
|
||||
inputs[| index].setVisible(true);
|
||||
var index = array_length(inputs);
|
||||
inputs[index] = nodeValue_Surface(materialNames[m_index] + " texture", self, tex_surface);
|
||||
inputs[index].setVisible(true);
|
||||
|
||||
input_display_list[input_display_len + m_index] = index;
|
||||
|
||||
|
@ -117,13 +117,13 @@ function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
|||
var sol = Node_create_Image_path(x - (w + 64), matY + m_index * (128 + 32), mat.diff_path);
|
||||
sol.name = mat.name + " texture";
|
||||
|
||||
inputs[| index].setFrom(sol.outputs[| 0]);
|
||||
inputs[index].setFrom(sol.outputs[0]);
|
||||
} else {
|
||||
var sol = nodeBuild("Node_Solid", x - (w + 64), matY + m_index * (128 + 32));
|
||||
sol.name = mat.name + " texture";
|
||||
sol.inputs[| 1].setValue(mat.diff);
|
||||
sol.inputs[1].setValue(mat.diff);
|
||||
|
||||
inputs[| index].setFrom(sol.outputs[| 0]);
|
||||
inputs[index].setFrom(sol.outputs[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,8 +191,8 @@ function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
|||
if(do_reset_material) {
|
||||
array_resize(input_display_list, input_display_len);
|
||||
|
||||
while(ds_list_size(inputs) > input_length)
|
||||
ds_list_delete(inputs, input_length);
|
||||
while(array_length(inputs) > input_length)
|
||||
array_delete(inputs, input_length, 1);
|
||||
|
||||
for(var i = 0; i < array_length(materialNames); i++)
|
||||
createMaterial(i);
|
||||
|
@ -218,11 +218,11 @@ function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
|||
var _fov = getInputData(16);
|
||||
var _dimS = getInputData(17);
|
||||
|
||||
inputs[| 16].setVisible(_proj == 1);
|
||||
inputs[16].setVisible(_proj == 1);
|
||||
|
||||
for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) {
|
||||
var ind = output_display_list[i];
|
||||
var _outSurf = outputs[| ind].getValue();
|
||||
var _outSurf = outputs[ind].getValue();
|
||||
|
||||
var pass = "diff";
|
||||
switch(ind) {
|
||||
|
@ -246,7 +246,7 @@ function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
|||
}
|
||||
_3d_post_setup();
|
||||
|
||||
outputs[| ind].setValue(_outSurf);
|
||||
outputs[ind].setValue(_outSurf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,20 +8,20 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
preview_channel = 0;
|
||||
apply_anchor = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Vector("Position", self, [ 0, 0, 0 ], { linkable: false });
|
||||
inputs[0] = nodeValue_Vector("Position", self, [ 0, 0, 0 ], { linkable: false });
|
||||
|
||||
inputs[| 1] = nodeValue_Quaternion("Rotation", self, [ 0, 0, 0, 1 ]);
|
||||
inputs[1] = nodeValue_Quaternion("Rotation", self, [ 0, 0, 0, 1 ]);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Scale", self, [ 1, 1, 1 ]);
|
||||
inputs[2] = nodeValue_Vector("Scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Anchor", self, [ 0, 0, 0 ], {
|
||||
inputs[3] = nodeValue_Vector("Anchor", self, [ 0, 0, 0 ], {
|
||||
linkable: false,
|
||||
side_button : button(function() { apply_anchor = !apply_anchor; triggerRender(); })
|
||||
.setIcon(THEME.icon_3d_anchor, [ function() /*=>*/ {return apply_anchor} ], c_white)
|
||||
.setTooltip("Apply Position")
|
||||
});
|
||||
|
||||
in_d3d = ds_list_size(inputs);
|
||||
in_d3d = array_length(inputs);
|
||||
|
||||
#macro __d3d_input_list_transform ["Transform", false], 0, 3, 1, 2
|
||||
|
||||
|
@ -70,7 +70,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
|
||||
static drawGizmoPosition = function(index, object, _vpos, active, params, _mx, _my, _snx, _sny, _panel) { #region
|
||||
#region ---- main ----
|
||||
var _pos = inputs[| index].getValue(,,, true);
|
||||
var _pos = inputs[index].getValue(,,, true);
|
||||
var _qrot = object == noone? new BBMOD_Quaternion() : object.transform.rotation;
|
||||
var _qinv = new BBMOD_Quaternion().FromAxisAngle(new BBMOD_Vec3(1, 0, 0), 90);
|
||||
|
||||
|
@ -230,7 +230,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
for( var i = 0; i < 3; i++ )
|
||||
val[i] += prj.getIndex(i) * _dist;
|
||||
|
||||
if(inputs[| index].setValue(value_snap(val, _snx)))
|
||||
if(inputs[index].setValue(value_snap(val, _snx)))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -251,7 +251,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
for( var i = 0; i < 3; i++ )
|
||||
val[i] += _diff.getIndex(i);
|
||||
|
||||
if(inputs[| index].setValue(value_snap(val, _snx)))
|
||||
if(inputs[index].setValue(value_snap(val, _snx)))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
}
|
||||
|
@ -282,14 +282,14 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
|
||||
static drawGizmoRotation = function(index, object, _vpos, active, params, _mx, _my, _snx, _sny, _panel) { #region
|
||||
#region ---- main ----
|
||||
var _rot = inputs[| index].getValue();
|
||||
var _rot = inputs[index].getValue();
|
||||
var _qrot = object == noone? new BBMOD_Quaternion() : object.transform.rotation;
|
||||
var _qinv = new BBMOD_Quaternion().FromAxisAngle(new BBMOD_Vec3(1, 0, 0), 90);
|
||||
|
||||
var _camera = params.camera;
|
||||
var _qview = new BBMOD_Quaternion().FromEuler(_camera.focus_angle_y, -_camera.focus_angle_x, 0);
|
||||
|
||||
var _ang = inputs[| index].display_data.angle_display;
|
||||
var _ang = inputs[index].display_data.angle_display;
|
||||
var _global = _ang == QUARTERNION_DISPLAY.quarterion? tool_attribute.context : 1;
|
||||
|
||||
var _hover = noone;
|
||||
|
@ -371,7 +371,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
var _val = _currR.Mul(drag_val);
|
||||
var _Nrot = _ang == QUARTERNION_DISPLAY.quarterion? _val.ToArray() : _val.ToEuler(true);
|
||||
|
||||
if(inputs[| index].setValue(_Nrot))
|
||||
if(inputs[index].setValue(_Nrot))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
|
||||
|
@ -394,7 +394,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
static drawGizmoScale = function(index, object, _vpos, active, params, _mx, _my, _snx, _sny, _panel) { #region
|
||||
tool_attribute.context = 0;
|
||||
#region ---- main ----
|
||||
var _sca = inputs[| index].getValue(,,, true);
|
||||
var _sca = inputs[index].getValue(,,, true);
|
||||
var _qrot = object == noone? new BBMOD_Quaternion() : object.transform.rotation;
|
||||
var _qinv = new BBMOD_Quaternion().FromAxisAngle(new BBMOD_Vec3(1, 0, 0), 90);
|
||||
|
||||
|
@ -534,7 +534,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
|
||||
drag_val[drag_axis] += _dist;
|
||||
|
||||
if(inputs[| index].setValue(value_snap(drag_val, _snx)))
|
||||
if(inputs[index].setValue(value_snap(drag_val, _snx)))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -555,7 +555,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
for( var i = 0; i < 3; i++ )
|
||||
drag_val[i] += _diff.getIndex(i);
|
||||
|
||||
if(inputs[| index].setValue(value_snap(drag_val, _snx)))
|
||||
if(inputs[index].setValue(value_snap(drag_val, _snx)))
|
||||
UNDO_HOLDING = true;
|
||||
}
|
||||
}
|
||||
|
@ -584,7 +584,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
} #endregion
|
||||
|
||||
static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) {
|
||||
var _rot = inputs[| 1].display_data.angle_display;
|
||||
var _rot = inputs[1].display_data.angle_display;
|
||||
tools = _rot == QUARTERNION_DISPLAY.quarterion? tool_quate : tool_euler;
|
||||
if(_rot == QUARTERNION_DISPLAY.euler && isUsingTool("Rotate"))
|
||||
PANEL_PREVIEW.tool_current = noone;
|
||||
|
@ -593,7 +593,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
if(array_empty(object)) return;
|
||||
object = object[0];
|
||||
|
||||
var _pos = inputs[| 0].getValue(,,, true);
|
||||
var _pos = inputs[0].getValue(,,, true);
|
||||
var _vpos = new __vec3( _pos[0], _pos[1], _pos[2] );
|
||||
|
||||
if(isUsingTool("Transform")) drawGizmoPosition(0, object, _vpos, active, params, _mx, _my, _snx, _sny, _panel);
|
||||
|
|
|
@ -2,37 +2,37 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
name = "3D Plane";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Surface in", self);
|
||||
inputs[0] = nodeValue_Surface("Surface in", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[1] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[3] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Enum_Scroll("Output dimension", self, OUTPUT_SCALING.same_as_input, [ "Same as input", "Constant", "Relative to input" ])
|
||||
inputs[4] = nodeValue_Enum_Scroll("Output dimension", self, OUTPUT_SCALING.same_as_input, [ "Same as input", "Constant", "Relative to input" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Constant dimension", self, DEF_SURF);
|
||||
inputs[5] = nodeValue_Vector("Constant dimension", self, DEF_SURF);
|
||||
|
||||
inputs[| 6] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[6] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 7] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[7] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 8] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[8] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 9] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[9] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 10] = nodeValue_Vector("Texture scale", self, [ 1, 1 ]);
|
||||
inputs[10] = nodeValue_Vector("Texture scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 11] = nodeValue_Vector("Texture shift", self, [ 0, 0 ]);
|
||||
inputs[11] = nodeValue_Vector("Texture shift", self, [ 0, 0 ]);
|
||||
|
||||
inputs[| 12] = nodeValue_Int("Subdiviion", self, 1)
|
||||
inputs[12] = nodeValue_Int("Subdiviion", self, 1)
|
||||
|
||||
inputs[| 13] = nodeValue_Enum_Button("Normal axis", self, 2, [ "X", "Y", "Z" ]);
|
||||
inputs[13] = nodeValue_Enum_Button("Normal axis", self, 2, [ "X", "Y", "Z" ]);
|
||||
|
||||
input_display_list = [0,
|
||||
["Geometry", true], 13, 12,
|
||||
|
@ -42,11 +42,11 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
["Texture", false], 10, 11,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
outputs[2] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
|
||||
output_display_list = [
|
||||
0, 1, 2
|
||||
|
@ -110,9 +110,9 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
PROCESSOR_OVERLAY_CHECK
|
||||
|
||||
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
var _out = outputs[| 0].getValue();
|
||||
var _out = outputs[0].getValue();
|
||||
if(!is_surface(_out) || !surface_exists(_out)) return;
|
||||
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
|
@ -144,17 +144,17 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
|
||||
switch(_out_type) {
|
||||
case OUTPUT_SCALING.same_as_input :
|
||||
inputs[| 5].setVisible(false);
|
||||
inputs[5].setVisible(false);
|
||||
_ww = surface_get_width_safe(_data[0]);
|
||||
_hh = surface_get_height_safe(_data[0]);
|
||||
break;
|
||||
case OUTPUT_SCALING.constant :
|
||||
inputs[| 5].setVisible(true);
|
||||
inputs[5].setVisible(true);
|
||||
_ww = _out[0];
|
||||
_hh = _out[1];
|
||||
break;
|
||||
case OUTPUT_SCALING.relative :
|
||||
inputs[| 5].setVisible(true);
|
||||
inputs[5].setVisible(true);
|
||||
_ww = surface_get_width_safe(_data[0]) * _out[0];
|
||||
_hh = surface_get_height_safe(_data[0]) * _out[1];
|
||||
break;
|
||||
|
@ -185,7 +185,7 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
generate_vb();
|
||||
}
|
||||
|
||||
inputs[| 9].setVisible(_proj);
|
||||
inputs[9].setVisible(_proj);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
DRAW_CLEAR
|
||||
|
|
|
@ -2,45 +2,45 @@ function __Node_3D_Cone(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
name = "3D Cone";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Dimension(self);
|
||||
inputs[0] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[1] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[2] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[3] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[4] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 5] = nodeValue_Rotation("Light direction", self, 0);
|
||||
inputs[5] = nodeValue_Rotation("Light direction", self, 0);
|
||||
|
||||
inputs[| 6] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[6] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] });
|
||||
|
||||
inputs[| 7] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[7] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 8] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[| 9] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
inputs[8] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[9] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
|
||||
inputs[| 10] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[10] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 11] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[11] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 12] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[12] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 13] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[13] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 14] = nodeValue_Int("Sides", self, 16);
|
||||
inputs[14] = nodeValue_Int("Sides", self, 16);
|
||||
|
||||
inputs[| 15] = nodeValue_Surface("Textures base", self);
|
||||
inputs[15] = nodeValue_Surface("Textures base", self);
|
||||
|
||||
inputs[| 16] = nodeValue_Surface("Textures side", self);
|
||||
inputs[16] = nodeValue_Surface("Textures side", self);
|
||||
|
||||
inputs[| 17] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[17] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
input_display_list = [
|
||||
["Output", false], 0, 17,
|
||||
|
@ -51,13 +51,13 @@ function __Node_3D_Cone(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
["Light", false], 5, 6, 7, 8, 9,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
outputs[3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
|
||||
output_display_list = [
|
||||
0, 2, 1, 3
|
||||
|
@ -170,7 +170,7 @@ function __Node_3D_Cone(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _fov = _data[13];
|
||||
var _dimS = _data[17];
|
||||
|
||||
inputs[| 13].setVisible(_proj);
|
||||
inputs[13].setVisible(_proj);
|
||||
|
||||
var pass = "diff";
|
||||
switch(_output_index) {
|
||||
|
|
|
@ -3,51 +3,51 @@ function __Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
batch_output = false;
|
||||
dimension_index = 1;
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Main texture", self);
|
||||
inputs[0] = nodeValue_Surface("Main texture", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Dimension(self);
|
||||
inputs[1] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[2] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[3] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[4] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 5] = nodeValue_Bool("Textures per face", self, false);
|
||||
inputs[5] = nodeValue_Bool("Textures per face", self, false);
|
||||
|
||||
inputs[| 6] = nodeValue_Surface("Textures 0", self).setVisible(false);
|
||||
inputs[| 7] = nodeValue_Surface("Textures 1", self).setVisible(false);
|
||||
inputs[| 8] = nodeValue_Surface("Textures 2", self).setVisible(false);
|
||||
inputs[| 9] = nodeValue_Surface("Textures 3", self).setVisible(false);
|
||||
inputs[| 10] = nodeValue_Surface("Textures 4", self).setVisible(false);
|
||||
inputs[| 11] = nodeValue_Surface("Textures 5", self).setVisible(false);
|
||||
inputs[ 6] = nodeValue_Surface("Textures 0", self).setVisible(false);
|
||||
inputs[ 7] = nodeValue_Surface("Textures 1", self).setVisible(false);
|
||||
inputs[ 8] = nodeValue_Surface("Textures 2", self).setVisible(false);
|
||||
inputs[ 9] = nodeValue_Surface("Textures 3", self).setVisible(false);
|
||||
inputs[10] = nodeValue_Surface("Textures 4", self).setVisible(false);
|
||||
inputs[11] = nodeValue_Surface("Textures 5", self).setVisible(false);
|
||||
|
||||
inputs[| 12] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[12] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 13] = nodeValue_Rotation("Light direction", self, 0);
|
||||
inputs[13] = nodeValue_Rotation("Light direction", self, 0);
|
||||
|
||||
inputs[| 14] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[14] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] });
|
||||
|
||||
inputs[| 15] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[15] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 16] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[16] = nodeValue_Color("Light color", self, c_white);
|
||||
|
||||
inputs[| 17] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
inputs[17] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
|
||||
inputs[| 18] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[18] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 19] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[19] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 20] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[20] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 21] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[21] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 22] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[22] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
input_display_list = [
|
||||
["Output", false], 1, 22,
|
||||
|
@ -57,13 +57,13 @@ function __Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
["Light", false], 13, 14, 15, 16, 17,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function(index) { return submit_vertex(index); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function(index) { return submit_vertex(index); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
outputs[3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
|
||||
output_display_list = [
|
||||
0, 2, 1, 3
|
||||
|
@ -122,10 +122,10 @@ function __Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _fov = _data[21];
|
||||
var _dimS = _data[22];
|
||||
|
||||
inputs[| 21].setVisible(_proj);
|
||||
inputs[21].setVisible(_proj);
|
||||
|
||||
for(var i = 6; i <= 11; i++) inputs[| i].setVisible(true, _usetex);
|
||||
inputs[| 0].setVisible(true, !_usetex);
|
||||
for(var i = 6; i <= 11; i++) inputs[i].setVisible(true, _usetex);
|
||||
inputs[0].setVisible(true, !_usetex);
|
||||
|
||||
var pass = "diff";
|
||||
switch(_output_index) {
|
||||
|
|
|
@ -3,50 +3,50 @@ function __Node_3D_Cylinder(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
batch_output = false;
|
||||
dimension_index = 2;
|
||||
|
||||
inputs[| 0] = nodeValue_Int("Sides", self, 16);
|
||||
inputs[0] = nodeValue_Int("Sides", self, 16);
|
||||
|
||||
inputs[| 1] = nodeValue_Float("Thickness", self, 0.2);
|
||||
inputs[1] = nodeValue_Float("Thickness", self, 0.2);
|
||||
|
||||
inputs[| 2] = nodeValue_Dimension(self);
|
||||
inputs[2] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[3] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[4] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 6] = nodeValue_Surface("Textures top", self);
|
||||
inputs[| 7] = nodeValue_Surface("Textures bottom", self);
|
||||
inputs[| 8] = nodeValue_Surface("Textures side", self);
|
||||
inputs[6] = nodeValue_Surface("Textures top", self);
|
||||
inputs[7] = nodeValue_Surface("Textures bottom", self);
|
||||
inputs[8] = nodeValue_Surface("Textures side", self);
|
||||
|
||||
inputs[| 9] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[9] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 10] = nodeValue_Rotation("Light direction", self, 0);
|
||||
inputs[10] = nodeValue_Rotation("Light direction", self, 0);
|
||||
|
||||
inputs[| 11] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[11] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] });
|
||||
|
||||
inputs[| 12] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[12] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 13] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[| 14] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
inputs[13] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[14] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
|
||||
inputs[| 15] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[15] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 16] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[16] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 17] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[17] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 18] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[18] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 19] = nodeValue_Float("Taper", self, 1)
|
||||
inputs[19] = nodeValue_Float("Taper", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 20] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[20] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
input_display_list = [
|
||||
["Output", false], 2, 20,
|
||||
|
@ -57,13 +57,13 @@ function __Node_3D_Cylinder(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
["Light", false], 10, 11, 12, 13, 14,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
outputs[3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
|
||||
output_display_list = [
|
||||
0, 2, 1, 3
|
||||
|
@ -196,7 +196,7 @@ function __Node_3D_Cylinder(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
var _fov = _data[18];
|
||||
var _dimS = _data[20];
|
||||
|
||||
inputs[| 18].setVisible(_proj);
|
||||
inputs[18].setVisible(_proj);
|
||||
|
||||
var pass = "diff";
|
||||
switch(_output_index) {
|
||||
|
|
|
@ -3,44 +3,44 @@ function __Node_3D_Sphere(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
batch_output = false;
|
||||
dimension_index = 1;
|
||||
|
||||
inputs[| 0] = nodeValue_Vector("Subdivisions", self, [8, 4])
|
||||
inputs[0] = nodeValue_Vector("Subdivisions", self, [8, 4])
|
||||
.setTooltip("Amount of polygon in X and Y axis.");
|
||||
|
||||
inputs[| 1] = nodeValue_Dimension(self);
|
||||
inputs[1] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[2] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[3] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[4] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 5] = nodeValue_Surface("Textures", self);
|
||||
inputs[5] = nodeValue_Surface("Textures", self);
|
||||
|
||||
inputs[| 6] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[6] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 7] = nodeValue_Rotation("Light direction", self, 0);
|
||||
inputs[7] = nodeValue_Rotation("Light direction", self, 0);
|
||||
|
||||
inputs[| 8] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[8] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] });
|
||||
|
||||
inputs[| 9] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[9] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 10] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[| 11] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
inputs[10] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[11] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
|
||||
inputs[| 12] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[12] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 13] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[13] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 14] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[14] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 15] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[15] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 16] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[16] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
input_display_list = [
|
||||
["Output", false], 1, 16,
|
||||
|
@ -51,13 +51,13 @@ function __Node_3D_Sphere(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
["Light", false], 7, 8, 9, 10, 11,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
outputs[3] = nodeValue_Output("3D vertex", self, VALUE_TYPE.d3vertex, []);
|
||||
output_display_list = [
|
||||
0, 2, 1, 3
|
||||
]
|
||||
|
@ -182,7 +182,7 @@ function __Node_3D_Sphere(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
var _fov = _data[15];
|
||||
var _dimS = _data[16];
|
||||
|
||||
inputs[| 15].setVisible(_proj);
|
||||
inputs[15].setVisible(_proj);
|
||||
|
||||
var pass = "diff";
|
||||
switch(_output_index) {
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
//function Node_3D_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
// name = "3D Render";
|
||||
|
||||
// inputs[| 2] = nodeValue_Dimension(self);
|
||||
// inputs[2] = nodeValue_Dimension(self);
|
||||
|
||||
// inputs[| 3] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
// inputs[3] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
// .setUnitRef( function() { return getInputData(2); }, VALUE_UNIT.reference);
|
||||
|
||||
// inputs[| 4] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
// inputs[4] = nodeValue_Vector("Render rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
// inputs[| 5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
// inputs[5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
// inputs[| 6] = nodeValue_Float("Light direction", self, 0)
|
||||
// inputs[6] = nodeValue_Float("Light direction", self, 0)
|
||||
// .setDisplay(VALUE_DISPLAY.rotation)
|
||||
// .rejectArray();
|
||||
|
||||
// inputs[| 7] = nodeValue_Float("Light height", self, 0.5)
|
||||
// inputs[7] = nodeValue_Float("Light height", self, 0.5)
|
||||
// .setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] })
|
||||
// .rejectArray();
|
||||
|
||||
// inputs[| 8] = nodeValue_Float("Light intensity", self, 1)
|
||||
// inputs[8] = nodeValue_Float("Light intensity", self, 1)
|
||||
// .setDisplay(VALUE_DISPLAY.slider)
|
||||
// .rejectArray();
|
||||
|
||||
// inputs[| 9] = nodeValue_Color("Light color", self, c_white)
|
||||
// inputs[9] = nodeValue_Color("Light color", self, c_white)
|
||||
// .rejectArray();
|
||||
|
||||
// inputs[| 10] = nodeValue_Color("Ambient color", self, c_grey)
|
||||
// inputs[10] = nodeValue_Color("Ambient color", self, c_grey)
|
||||
// .rejectArray();
|
||||
|
||||
// inputs[| 15] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
// inputs[15] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
// .rejectArray();
|
||||
|
||||
// inputs[| 16] = nodeValue_Float("Field of view", self, 60)
|
||||
// inputs[16] = nodeValue_Float("Field of view", self, 60)
|
||||
// .setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 90, 1 ] })
|
||||
// .rejectArray();
|
||||
|
||||
// inputs[| 17] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
// inputs[17] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
// input_display_list = [
|
||||
// ["Output", false], 2, 17,
|
||||
|
@ -45,14 +45,14 @@
|
|||
// ["Light", false], 6, 7, 8, 9, 10,
|
||||
// ["Textures", true], 12,
|
||||
// ];
|
||||
// input_length = ds_list_size(inputs);
|
||||
// input_length = array_length(inputs);
|
||||
// input_display_len = array_length(input_display_list);
|
||||
|
||||
// outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
// outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
// outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
// outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
// outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
// outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
// output_display_list = [
|
||||
// 0, 2, 1
|
||||
|
@ -75,14 +75,14 @@
|
|||
// }
|
||||
|
||||
// function setPath(path) {
|
||||
// inputs[| 0].setValue(path);
|
||||
// inputs[0].setValue(path);
|
||||
// updateObj();
|
||||
// }
|
||||
|
||||
// function createMaterial(m_index) {
|
||||
// var index = ds_list_size(inputs);
|
||||
// inputs[| index] = nodeValue_Surface(materialNames[m_index] + " texture", self, tex_surface);
|
||||
// inputs[| index].setVisible(true);
|
||||
// var index = array_length(inputs);
|
||||
// inputs[index] = nodeValue_Surface(materialNames[m_index] + " texture", self, tex_surface);
|
||||
// inputs[index].setVisible(true);
|
||||
|
||||
// input_display_list[input_display_len + m_index] = index;
|
||||
|
||||
|
@ -95,13 +95,13 @@
|
|||
// var sol = Node_create_Image_path(x - (w + 64), matY + m_index * (128 + 32), mat.diff_path);
|
||||
// sol.name = mat.name + " texture";
|
||||
|
||||
// inputs[| index].setFrom(sol.outputs[| 0]);
|
||||
// inputs[index].setFrom(sol.outputs[0]);
|
||||
// } else {
|
||||
// var sol = nodeBuild("Node_Solid", x - (w + 64), matY + m_index * (128 + 32));
|
||||
// sol.name = mat.name + " texture";
|
||||
// sol.inputs[| 1].setValue(mat.diff);
|
||||
// sol.inputs[1].setValue(mat.diff);
|
||||
|
||||
// inputs[| index].setFrom(sol.outputs[| 0]);
|
||||
// inputs[index].setFrom(sol.outputs[0]);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
@ -171,8 +171,8 @@
|
|||
// if(do_reset_material) {
|
||||
// array_resize(input_display_list, input_display_len);
|
||||
|
||||
// while(ds_list_size(inputs) > input_length)
|
||||
// ds_list_delete(inputs, input_length);
|
||||
// while(array_length(inputs) > input_length)
|
||||
// array_delete(inputs, input_length, 1);
|
||||
|
||||
// for(var i = 0; i < array_length(materialNames); i++)
|
||||
// createMaterial(i);
|
||||
|
@ -198,11 +198,11 @@
|
|||
// var _fov = getInputData(16);
|
||||
// var _dimS = getInputData(17);
|
||||
|
||||
// inputs[| 16].setVisible(_proj == 1);
|
||||
// inputs[16].setVisible(_proj == 1);
|
||||
|
||||
// for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) {
|
||||
// var ind = output_display_list[i];
|
||||
// var _outSurf = outputs[| ind].getValue();
|
||||
// var _outSurf = outputs[ind].getValue();
|
||||
|
||||
// var pass = "diff";
|
||||
// switch(ind) {
|
||||
|
@ -226,7 +226,7 @@
|
|||
// }
|
||||
// _3d_post_setup();
|
||||
|
||||
// outputs[| ind].setValue(_outSurf);
|
||||
// outputs[ind].setValue(_outSurf);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
|
|
@ -1,58 +1,58 @@
|
|||
function __Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "3D Repeat";
|
||||
|
||||
inputs[| 0] = nodeValue_Dimension(self);
|
||||
inputs[0] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[1] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[3] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[4] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef( function() { return getInputData(0); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 6] = nodeValue_Rotation("Light direction", self, 0);
|
||||
inputs[6] = nodeValue_Rotation("Light direction", self, 0);
|
||||
|
||||
inputs[| 7] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[7] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] });
|
||||
|
||||
inputs[| 8] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[8] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 9] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[9] = nodeValue_Color("Light color", self, c_white);
|
||||
|
||||
inputs[| 10] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
inputs[10] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
|
||||
inputs[| 11] = nodeValue("3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone)
|
||||
inputs[11] = nodeValue("3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 12] = nodeValue_Int("Repeat", self, 1, "Amount of copies to be generated.");
|
||||
inputs[12] = nodeValue_Int("Repeat", self, 1, "Amount of copies to be generated.");
|
||||
|
||||
inputs[| 13] = nodeValue_Vector("Repeat position", self, [ 1, 0, 0 ]);
|
||||
inputs[13] = nodeValue_Vector("Repeat position", self, [ 1, 0, 0 ]);
|
||||
|
||||
inputs[| 14] = nodeValue_Vector("Repeat rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[14] = nodeValue_Vector("Repeat rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 15] = nodeValue_Vector("Repeat scale", self, [ 1, 1, 1 ]);
|
||||
inputs[15] = nodeValue_Vector("Repeat scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 16] = nodeValue_Enum_Button("Repeat pattern", self, 0, [ "Linear", "Circular" ])
|
||||
inputs[16] = nodeValue_Enum_Button("Repeat pattern", self, 0, [ "Linear", "Circular" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 17] = nodeValue_Enum_Button("Axis", self, 0, [ "x", "y", "z" ]);
|
||||
inputs[17] = nodeValue_Enum_Button("Axis", self, 0, [ "x", "y", "z" ]);
|
||||
|
||||
inputs[| 18] = nodeValue_Float("Radius", self, 1);
|
||||
inputs[18] = nodeValue_Float("Radius", self, 1);
|
||||
|
||||
inputs[| 19] = nodeValue_Rotation_Range("Rotation", self, [ 0, 360 ]);
|
||||
inputs[19] = nodeValue_Rotation_Range("Rotation", self, [ 0, 360 ]);
|
||||
|
||||
inputs[| 20] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[20] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 21] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[21] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 22] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[22] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
input_display_list = [ 11,
|
||||
["Output", false], 0, 22,
|
||||
|
@ -63,11 +63,11 @@ function __Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
];
|
||||
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D objects", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D objects", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
output_display_list = [
|
||||
0, 2, 1
|
||||
|
@ -140,12 +140,12 @@ function __Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
var _proj = getInputData(20);
|
||||
var _patt = getInputData(16);
|
||||
|
||||
inputs[| 13].setVisible(_patt == 0);
|
||||
inputs[13].setVisible(_patt == 0);
|
||||
|
||||
inputs[| 17].setVisible(_patt == 1);
|
||||
inputs[| 18].setVisible(_patt == 1);
|
||||
inputs[| 19].setVisible(_patt == 1);
|
||||
inputs[| 21].setVisible(_proj);
|
||||
inputs[17].setVisible(_patt == 1);
|
||||
inputs[18].setVisible(_patt == 1);
|
||||
inputs[19].setVisible(_patt == 1);
|
||||
inputs[21].setVisible(_proj);
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
|
@ -171,7 +171,7 @@ function __Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
for( var i = 0, n = array_length(output_display_list) - 1; i < n; i++ ) {
|
||||
var ind = output_display_list[i];
|
||||
var _outSurf = outputs[| ind].getValue();
|
||||
var _outSurf = outputs[ind].getValue();
|
||||
|
||||
var pass = "diff";
|
||||
switch(ind) {
|
||||
|
@ -187,7 +187,7 @@ function __Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
submit_vertex();
|
||||
_3d_post_setup();
|
||||
|
||||
outputs[| ind].setValue(_outSurf);
|
||||
outputs[ind].setValue(_outSurf);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,41 +2,41 @@ function __Node_3D_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
name = "3D Transform";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Dimension(self);
|
||||
inputs[0] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
inputs[1] = nodeValue_Vector("Object position", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
inputs[2] = nodeValue_Vector("Object rotation", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
inputs[3] = nodeValue_Vector("Object scale", self, [ 1, 1, 1 ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
inputs[4] = nodeValue_Vector("Render position", self, [ 0.5, 0.5 ])
|
||||
.setUnitRef( function() { return getInputData(2); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
inputs[5] = nodeValue_Vector("Render scale", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 6] = nodeValue_Rotation("Light direction", self, 0);
|
||||
inputs[6] = nodeValue_Rotation("Light direction", self, 0);
|
||||
|
||||
inputs[| 7] = nodeValue_Float("Light height", self, 0.5)
|
||||
inputs[7] = nodeValue_Float("Light height", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-1, 1, 0.01] });
|
||||
|
||||
inputs[| 8] = nodeValue_Float("Light intensity", self, 1)
|
||||
inputs[8] = nodeValue_Float("Light intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 9] = nodeValue_Color("Light color", self, c_white);
|
||||
inputs[9] = nodeValue_Color("Light color", self, c_white);
|
||||
|
||||
inputs[| 10] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
inputs[10] = nodeValue_Color("Ambient color", self, c_grey);
|
||||
|
||||
inputs[| 11] = nodeValue("3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone)
|
||||
inputs[11] = nodeValue("3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 12] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
inputs[12] = nodeValue_Enum_Button("Projection", self, 0, [ "Orthographic", "Perspective" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 13] = nodeValue_Float("Field of view", self, 60)
|
||||
inputs[13] = nodeValue_Float("Field of view", self, 60)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 90, 0.1 ] });
|
||||
|
||||
inputs[| 14] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
inputs[14] = nodeValue_Bool("Scale view with dimension", self, true)
|
||||
|
||||
input_display_list = [ 11,
|
||||
["Output", false], 0, 14,
|
||||
|
@ -45,11 +45,11 @@ function __Node_3D_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
["Light", true], 6, 7, 8, 9, 10,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
outputs[1] = nodeValue_Output("3D scene", self, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
outputs[2] = nodeValue_Output("Normal pass", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
output_display_list = [
|
||||
0, 2, 1
|
||||
|
@ -82,7 +82,7 @@ function __Node_3D_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
|
||||
static step = function() {
|
||||
var _proj = getInputData(12);
|
||||
inputs[| 13].setVisible(_proj);
|
||||
inputs[13].setVisible(_proj);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
|
|
|
@ -20,47 +20,47 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
setDimension(96, 48);
|
||||
seed = 1;
|
||||
|
||||
inputs[| 0] = nodeValue_Particle("Particles", self, -1 )
|
||||
inputs[0] = nodeValue_Particle("Particles", self, -1 )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Area("Area", self, DEF_AREA)
|
||||
inputs[1] = nodeValue_Area("Area", self, DEF_AREA)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 2] = nodeValue("Falloff", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_01 )
|
||||
inputs[2] = nodeValue("Falloff", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_01 )
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Falloff distance", self, 4 )
|
||||
inputs[3] = nodeValue_Float("Falloff distance", self, 4 )
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Effect Vector", self, [ -1, 0 ] )
|
||||
inputs[4] = nodeValue_Vector("Effect Vector", self, [ -1, 0 ] )
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 5] = nodeValue_Float("Strength", self, 1 )
|
||||
inputs[5] = nodeValue_Float("Strength", self, 1 )
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 6] = nodeValue_Rotation_Range("Rotate particle", self, [ 0, 0 ] )
|
||||
inputs[6] = nodeValue_Rotation_Range("Rotate particle", self, [ 0, 0 ] )
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 7] = nodeValue_Vec2_Range("Scale particle", self, [ 0, 0, 0, 0 ] , { linked : true })
|
||||
inputs[7] = nodeValue_Vec2_Range("Scale particle", self, [ 0, 0, 0, 0 ] , { linked : true })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 8] = nodeValue_Int("Seed", self, seed_random(6))
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[| 8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) })
|
||||
inputs[8] = nodeValue_Int("Seed", self, seed_random(6))
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) })
|
||||
.rejectArray();
|
||||
|
||||
effector_input_length = ds_list_size(inputs);
|
||||
effector_input_length = array_length(inputs);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Area", false], 1, 2, 3,
|
||||
["Effect", false], 8, 4, 5, 6, 7,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Particles", self, VALUE_TYPE.particle, -1 );
|
||||
outputs[0] = nodeValue_Output("Particles", self, VALUE_TYPE.particle, -1 );
|
||||
|
||||
UPDATE_PART_FORWARD
|
||||
|
||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
||||
inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
|
||||
var area = getInputData(1);
|
||||
var cx = _x + area[0] * _s;
|
||||
|
@ -162,7 +162,7 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
static update = function(frame = CURRENT_FRAME) { #region
|
||||
var val = getInputData(0);
|
||||
outputs[| 0].setValue(val);
|
||||
outputs[0].setValue(val);
|
||||
if(val == -1) return;
|
||||
|
||||
if(!is_array(val) || array_length(val) == 0) return;
|
||||
|
@ -172,7 +172,7 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
affect(val[i][j]);
|
||||
}
|
||||
|
||||
var jun = outputs[| 0];
|
||||
var jun = outputs[0];
|
||||
for(var j = 0; j < array_length(jun.value_to); j++) {
|
||||
if(jun.value_to[j].value_from == jun)
|
||||
jun.value_to[j].node.doUpdate();
|
||||
|
|
|
@ -44,12 +44,12 @@ function Node_Custom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
shader.fs = d3d11_shader_compile_ps($"{path}/{info.shader_fs}", "main", "ps_4_0");
|
||||
if(!d3d11_shader_exists(shader.fs)) noti_warning(d3d11_get_error_string());
|
||||
|
||||
ds_list_clear(inputs);
|
||||
ds_list_clear(outputs);
|
||||
inputs = [];
|
||||
outputs = [];
|
||||
|
||||
for( var i = 0, n = array_length(info.inputs); i < n; i++ ) {
|
||||
var _input = info.inputs[i];
|
||||
inputs[| i] = nodeValue(_input.name, self, JUNCTION_CONNECT.input, value_type_from_string(_input.type), _input.value)
|
||||
inputs[i] = nodeValue(_input.name, self, JUNCTION_CONNECT.input, value_type_from_string(_input.type), _input.value)
|
||||
.setVisible(_input.show_in_inspector, _input.show_in_graph);
|
||||
input_index_map[? _input.name] = i;
|
||||
|
||||
|
@ -62,7 +62,7 @@ function Node_Custom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
for( var i = 0, n = array_length(info.outputs); i < n; i++ ) {
|
||||
var _output = info.outputs[i];
|
||||
outputs[| i] = nodeValue_Output(_output.name, self, value_type_from_string(_output.type), _output.value)
|
||||
outputs[i] = nodeValue_Output(_output.name, self, value_type_from_string(_output.type), _output.value)
|
||||
.setVisible(_output.show_in_graph);
|
||||
output_index_map[? _output.name] = i;
|
||||
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
function NodeModule(parent) constructor {
|
||||
self.parent = parent;
|
||||
|
||||
inputs = ds_list_create();
|
||||
inputs = [];
|
||||
|
||||
load_map = -1;
|
||||
load_scale = false;
|
||||
|
||||
static isLeaf = function() { #region
|
||||
for( var i = 0, n = ds_list_size(inputs); i < n; i++ ) {
|
||||
var _inp = inputs[| i];
|
||||
static isLeaf = function() {
|
||||
for( var i = 0, n = array_length(inputs); i < n; i++ ) {
|
||||
var _inp = inputs[i];
|
||||
if(_inp.value_from != noone) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static drawConnections = function(params = {}, _inputs = []) { #region
|
||||
for(var i = 0; i < ds_list_size(inputs); i++) {
|
||||
var jun = inputs[| i];
|
||||
static drawConnections = function(params = {}, _inputs = []) {
|
||||
for(var i = 0; i < array_length(inputs); i++) {
|
||||
var jun = inputs[i];
|
||||
|
||||
if(jun.value_from == noone) continue;
|
||||
if(!jun.value_from.node.active) continue;
|
||||
|
@ -25,50 +25,50 @@ function NodeModule(parent) constructor {
|
|||
|
||||
if(i >= 0) array_push(_inputs, jun);
|
||||
}
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static isRendered = function() { #region //Check if every input is ready (updated)
|
||||
for(var j = 0; j < ds_list_size(inputs); j++)
|
||||
if(!inputs[| j].isRendered()) return false;
|
||||
static isRendered = function() { //Check if every input is ready (updated)
|
||||
for(var j = 0; j < array_length(inputs); j++)
|
||||
if(!inputs[j].isRendered()) return false;
|
||||
|
||||
return true;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static resetCache = function() { #region
|
||||
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
||||
if(!is_instanceof(inputs[| i], NodeValue)) continue;
|
||||
inputs[| i].resetCache();
|
||||
static resetCache = function() {
|
||||
for( var i = 0; i < array_length(inputs); i++ ) {
|
||||
if(!is_instanceof(inputs[i], NodeValue)) continue;
|
||||
inputs[i].resetCache();
|
||||
}
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static serialize = function(scale = false, preset = false) { #region
|
||||
static serialize = function(scale = false, preset = false) {
|
||||
var _map = {};
|
||||
|
||||
var _inputs = [];
|
||||
for(var i = 0; i < ds_list_size(inputs); i++)
|
||||
array_push(_inputs, inputs[| i].serialize(scale, preset));
|
||||
for(var i = 0; i < array_length(inputs); i++)
|
||||
array_push(_inputs, inputs[i].serialize(scale, preset));
|
||||
_map.inputs = _inputs;
|
||||
|
||||
_map.outputs = [];
|
||||
|
||||
return _map;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static deserialize = function(_map, scale = false, preset = false) { #region
|
||||
static deserialize = function(_map, scale = false, preset = false) {
|
||||
load_map = _map;
|
||||
load_scale = scale;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static applyDeserialize = function(preset = false) { #region
|
||||
static applyDeserialize = function(preset = false) {
|
||||
var _inputs = load_map.inputs;
|
||||
var amo = min(ds_list_size(inputs), array_length(_inputs));
|
||||
var amo = min(array_length(inputs), array_length(_inputs));
|
||||
|
||||
for(var i = 0; i < amo; i++)
|
||||
inputs[| i].applyDeserialize(_inputs[i], load_scale, preset);
|
||||
} #endregion
|
||||
inputs[i].applyDeserialize(_inputs[i], load_scale, preset);
|
||||
}
|
||||
|
||||
static connect = function() { #region
|
||||
for(var i = 0; i < ds_list_size(inputs); i++)
|
||||
inputs[| i].connect(false);
|
||||
} #endregion
|
||||
static connect = function() {
|
||||
for(var i = 0; i < array_length(inputs); i++)
|
||||
inputs[i].connect(false);
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
function Node_Process_Template(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "";
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("", self);
|
||||
inputs[0] = nodeValue_Surface("", self);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [ 0 ];
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ enum SHADER_UNIFORM {
|
|||
|
||||
function addShaderProp(_type = undefined, _key = undefined) {
|
||||
INLINE
|
||||
var _ind = ds_list_size(inputs) - 1;
|
||||
var _ind = array_length(inputs) - 1;
|
||||
shader_data[_ind] = _type == undefined? 0 : { type: _type, key: _key };
|
||||
}
|
||||
|
||||
|
@ -16,14 +16,14 @@ function Node_Shader(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
shader = noone;
|
||||
shader_data = [];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
static setShader = function(_data) { #region
|
||||
for( var i = 0, n = array_length(shader_data); i < n; i++ ) {
|
||||
var _dat = shader_data[i];
|
||||
if(_dat == 0) continue;
|
||||
|
||||
var _inp = inputs[| i];
|
||||
var _inp = inputs[i];
|
||||
|
||||
switch(_dat.type) {
|
||||
case SHADER_UNIFORM.integer : shader_set_i(_dat.key, _data[i]); break;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Shader_Generator(_x, _y, _group = noone) : Node_Shader(_x, _y, _group) constructor {
|
||||
name = "";
|
||||
|
||||
inputs[| 0] = nodeValue_Dimension(self);
|
||||
inputs[0] = nodeValue_Dimension(self);
|
||||
addShaderProp(SHADER_UNIFORM.float, "u_resolution");
|
||||
|
||||
attribute_surface_depth();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_Shader_Processor(_x, _y, _group = noone) : Node_Shader(_x, _y, _group) constructor {
|
||||
name = "";
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Surface in", self);
|
||||
inputs[0] = nodeValue_Surface("Surface in", self);
|
||||
addShaderProp();
|
||||
|
||||
attribute_surface_depth();
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
function Node_Template(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "";
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("", self);
|
||||
inputs[0] = nodeValue_Surface("", self);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [ 0 ];
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
static processData = function(_output, _data, _index) { return noone; }
|
||||
|
||||
function preProcess(_outindex) {
|
||||
var _out = outputs[| _outindex].getValue();
|
||||
var _out = outputs[_outindex].getValue();
|
||||
|
||||
if(process_amount == 0) //render single data
|
||||
return processData(_out, inputs_data, _outindex);
|
||||
|
@ -17,12 +17,12 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
else if(array_length(_out) != process_amount)
|
||||
array_resize(_out, process_amount);
|
||||
|
||||
var _data = array_create(ds_list_size(inputs));
|
||||
var _data = array_create(array_length(inputs));
|
||||
for(var l = 0; l < process_amount; l++) {
|
||||
for(var i = 0; i < ds_list_size(inputs); i++) { //input prepare
|
||||
for(var i = 0; i < array_length(inputs); i++) { //input prepare
|
||||
var _in = inputs_data[i];
|
||||
|
||||
if(!inputs[| i].isArray(_in)) {
|
||||
if(!inputs[i].isArray(_in)) {
|
||||
_data[i] = inputs_data[i];
|
||||
continue;
|
||||
}
|
||||
|
@ -47,23 +47,23 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
|
||||
static update = function() {
|
||||
process_amount = 0;
|
||||
inputs_data = array_create(ds_list_size(inputs));
|
||||
inputs_data = array_create(array_length(inputs));
|
||||
|
||||
for(var i = 0; i < ds_list_size(inputs); i++) { //pre-collect current input data
|
||||
inputs_data[i] = inputs[| i].getValue();
|
||||
for(var i = 0; i < array_length(inputs); i++) { //pre-collect current input data
|
||||
inputs_data[i] = inputs[i].getValue();
|
||||
|
||||
if(!is_array(inputs_data[i])) continue;
|
||||
if(array_length(inputs_data[i]) == 0) continue;
|
||||
if(!inputs[| i].isArray(inputs_data[i])) continue;
|
||||
if(!inputs[i].isArray(inputs_data[i])) continue;
|
||||
|
||||
if(typeArray(inputs[| i].display_type)) {
|
||||
if(typeArray(inputs[i].display_type)) {
|
||||
process_amount = max(process_amount, array_length(inputs_data[i][0]));
|
||||
} else
|
||||
process_amount = max(process_amount, array_length(inputs_data[i]));
|
||||
}
|
||||
|
||||
for(var i = 0; i < ds_list_size(outputs); i++) {
|
||||
outputs[| i].setValue(preProcess(i));
|
||||
for(var i = 0; i < array_length(outputs); i++) {
|
||||
outputs[i].setValue(preProcess(i));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,123 +2,123 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
name = "Spawner";
|
||||
update_on_frame = true;
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Particle sprite", self);
|
||||
inputs[0] = nodeValue_Surface("Particle sprite", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Int("Spawn delay", self, 4, "Frames delay between each particle spawn." );
|
||||
inputs[1] = nodeValue_Int("Spawn delay", self, 4, "Frames delay between each particle spawn." );
|
||||
|
||||
inputs[| 2] = nodeValue_Range("Spawn amount", self, [ 2, 2 ] , { linked : true })
|
||||
inputs[2] = nodeValue_Range("Spawn amount", self, [ 2, 2 ] , { linked : true })
|
||||
.setTooltip("Amount of particle spawn in that frame.");
|
||||
|
||||
inputs[| 3] = nodeValue_Area("Spawn area", self, DEF_AREA );
|
||||
inputs[3] = nodeValue_Area("Spawn area", self, DEF_AREA );
|
||||
|
||||
inputs[| 4] = nodeValue_Enum_Scroll("Spawn distribution", self, 0, [ "Area", "Border", "Map" ] );
|
||||
inputs[4] = nodeValue_Enum_Scroll("Spawn distribution", self, 0, [ "Area", "Border", "Map" ] );
|
||||
|
||||
inputs[| 5] = nodeValue_Range("Lifespan", self, [ 20, 30 ] );
|
||||
inputs[5] = nodeValue_Range("Lifespan", self, [ 20, 30 ] );
|
||||
|
||||
inputs[| 6] = nodeValue_Rotation_Random("Spawn direction", self, [ 0, 45, 135, 0, 0 ] );
|
||||
inputs[6] = nodeValue_Rotation_Random("Spawn direction", self, [ 0, 45, 135, 0, 0 ] );
|
||||
|
||||
inputs[| 7] = nodeValue_Range("Acceleration", self, [ 0, 0 ] , { linked : true });
|
||||
inputs[7] = nodeValue_Range("Acceleration", self, [ 0, 0 ] , { linked : true });
|
||||
|
||||
inputs[| 8] = nodeValue_Rotation_Random("Orientation", self, [ 0, 0, 0, 0, 0 ] );
|
||||
inputs[8] = nodeValue_Rotation_Random("Orientation", self, [ 0, 0, 0, 0, 0 ] );
|
||||
|
||||
inputs[| 9] = nodeValue_Range("Rotational speed", self, [ 0, 0 ] , { linked : true });
|
||||
inputs[9] = nodeValue_Range("Rotational speed", self, [ 0, 0 ] , { linked : true });
|
||||
|
||||
inputs[| 10] = nodeValue_Vec2_Range("Spawn scale", self, [ 1, 1, 1, 1 ] , { linked : true });
|
||||
inputs[10] = nodeValue_Vec2_Range("Spawn scale", self, [ 1, 1, 1, 1 ] , { linked : true });
|
||||
|
||||
inputs[| 11] = nodeValue("Scale over time", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
inputs[11] = nodeValue("Scale over time", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
|
||||
inputs[| 12] = nodeValue_Gradient("Color over lifetime", self, new gradientObject(cola(c_white)));
|
||||
inputs[12] = nodeValue_Gradient("Color over lifetime", self, new gradientObject(cola(c_white)));
|
||||
|
||||
inputs[| 13] = nodeValue_Range("Alpha", self, [ 1, 1 ], { linked : true });
|
||||
inputs[13] = nodeValue_Range("Alpha", self, [ 1, 1 ], { linked : true });
|
||||
|
||||
inputs[| 14] = nodeValue("Alpha over time", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11);
|
||||
inputs[14] = nodeValue("Alpha over time", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11);
|
||||
|
||||
inputs[| 15] = nodeValue_Bool("Rotate by direction", self, false, "Make the particle rotates to follow its movement.");
|
||||
inputs[15] = nodeValue_Bool("Rotate by direction", self, false, "Make the particle rotates to follow its movement.");
|
||||
|
||||
inputs[| 16] = nodeValue_Enum_Button("Spawn type", self, 0, [ "Stream", "Burst", "Trigger" ]);
|
||||
inputs[16] = nodeValue_Enum_Button("Spawn type", self, 0, [ "Stream", "Burst", "Trigger" ]);
|
||||
|
||||
inputs[| 17] = nodeValue_Range("Spawn size", self, [ 1, 1 ] , { linked : true });
|
||||
inputs[17] = nodeValue_Range("Spawn size", self, [ 1, 1 ] , { linked : true });
|
||||
|
||||
inputs[| 18] = nodeValue_Range("Spawn velocity", self, [ 1, 2 ] );
|
||||
inputs[18] = nodeValue_Range("Spawn velocity", self, [ 1, 2 ] );
|
||||
|
||||
inputs[| 19] = nodeValue_Range("Gravity", self, [ 0, 0 ] , { linked : true });
|
||||
inputs[19] = nodeValue_Range("Gravity", self, [ 0, 0 ] , { linked : true });
|
||||
|
||||
inputs[| 20] = nodeValue_Vector("Direction wiggle", self, [ 0, 0 ] , { label: [ "Amplitude", "Period" ], linkable: false, per_line: true });
|
||||
inputs[20] = nodeValue_Vector("Direction wiggle", self, [ 0, 0 ] , { label: [ "Amplitude", "Period" ], linkable: false, per_line: true });
|
||||
|
||||
inputs[| 21] = nodeValue_Bool("Loop", self, true );
|
||||
inputs[21] = nodeValue_Bool("Loop", self, true );
|
||||
|
||||
inputs[| 22] = nodeValue_Enum_Scroll("Surface array", self, 0, [ "Random", "Order", "Animation", "Scale" ])
|
||||
inputs[22] = nodeValue_Enum_Scroll("Surface array", self, 0, [ "Random", "Order", "Animation", "Scale" ])
|
||||
.setTooltip("Whether to select image from an array in order, at random, or treat array as animation.")
|
||||
.setVisible(false);
|
||||
|
||||
inputs[| 23] = nodeValue_Range("Animation speed", self, [ 1, 1 ] , { linked : true })
|
||||
inputs[23] = nodeValue_Range("Animation speed", self, [ 1, 1 ] , { linked : true })
|
||||
.setVisible(false);
|
||||
|
||||
inputs[| 24] = nodeValue_Enum_Button("Scatter", self, 1, [ "Uniform", "Random" ]);
|
||||
inputs[24] = nodeValue_Enum_Button("Scatter", self, 1, [ "Uniform", "Random" ]);
|
||||
|
||||
inputs[| 25] = nodeValue_Int("Boundary data", self, [])
|
||||
inputs[25] = nodeValue_Int("Boundary data", self, [])
|
||||
.setArrayDepth(1)
|
||||
.setVisible(false, true);
|
||||
|
||||
inputs[| 26] = nodeValue_Enum_Button("On animation end", self, ANIM_END_ACTION.loop, [ "Loop", "Ping pong", "Destroy" ])
|
||||
inputs[26] = nodeValue_Enum_Button("On animation end", self, ANIM_END_ACTION.loop, [ "Loop", "Ping pong", "Destroy" ])
|
||||
.setVisible(false);
|
||||
|
||||
inputs[| 27] = nodeValue_Bool("Spawn", self, true);
|
||||
inputs[27] = nodeValue_Bool("Spawn", self, true);
|
||||
|
||||
inputs[| 28] = nodeValue_Gradient("Random blend", self, new gradientObject(cola(c_white)));
|
||||
inputs[28] = nodeValue_Gradient("Random blend", self, new gradientObject(cola(c_white)));
|
||||
|
||||
inputs[| 29] = nodeValue_Bool("Directed from center", self, false, "Make particle move away from the spawn center.");
|
||||
inputs[29] = nodeValue_Bool("Directed from center", self, false, "Make particle move away from the spawn center.");
|
||||
|
||||
inputs[| 30] = nodeValue_Surface("Distribution map", self)
|
||||
inputs[30] = nodeValue_Surface("Distribution map", self)
|
||||
|
||||
inputs[| 31] = nodeValue_Surface("Atlas", self, [])
|
||||
inputs[31] = nodeValue_Surface("Atlas", self, [])
|
||||
.setArrayDepth(1);
|
||||
|
||||
inputs[| 32] = nodeValue_Float("Seed", self, seed_random(6))
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[| 32].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
||||
inputs[32] = nodeValue_Float("Seed", self, seed_random(6))
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[32].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
||||
|
||||
inputs[| 33] = nodeValue_Rotation("Gravity direction", self, -90);
|
||||
inputs[33] = nodeValue_Rotation("Gravity direction", self, -90);
|
||||
|
||||
inputs[| 34] = nodeValue_Range("Turning", self, [ 0, 0 ] , { linked : true });
|
||||
inputs[34] = nodeValue_Range("Turning", self, [ 0, 0 ] , { linked : true });
|
||||
|
||||
inputs[| 35] = nodeValue_Bool("Turn both directions", self, false, "Apply randomized 1, -1 multiplier to the turning speed." );
|
||||
inputs[35] = nodeValue_Bool("Turn both directions", self, false, "Apply randomized 1, -1 multiplier to the turning speed." );
|
||||
|
||||
inputs[| 36] = nodeValue_Float("Turn scale with speed", self, false );
|
||||
inputs[36] = nodeValue_Float("Turn scale with speed", self, false );
|
||||
|
||||
inputs[| 37] = nodeValue_Bool("Collide ground", self, false );
|
||||
inputs[37] = nodeValue_Bool("Collide ground", self, false );
|
||||
|
||||
inputs[| 38] = nodeValue_Float("Ground offset", self, 0 );
|
||||
inputs[38] = nodeValue_Float("Ground offset", self, 0 );
|
||||
|
||||
inputs[| 39] = nodeValue_Float("Bounce amount", self, 0.5 )
|
||||
inputs[39] = nodeValue_Float("Bounce amount", self, 0.5 )
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 40] = nodeValue_Float("Bounce friction", self, 0.1, "Apply horizontal friction once particle stop bouncing." )
|
||||
inputs[40] = nodeValue_Float("Bounce friction", self, 0.1, "Apply horizontal friction once particle stop bouncing." )
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 41] = nodeValue_Vector("Position wiggle", self, [ 0, 0 ] , { label: [ "Amplitude", "Period" ], linkable: false, per_line: true });
|
||||
inputs[41] = nodeValue_Vector("Position wiggle", self, [ 0, 0 ] , { label: [ "Amplitude", "Period" ], linkable: false, per_line: true });
|
||||
|
||||
inputs[| 42] = nodeValue_Vector("Rotation wiggle", self, [ 0, 0 ] , { label: [ "Amplitude", "Period" ], linkable: false, per_line: true });
|
||||
inputs[42] = nodeValue_Vector("Rotation wiggle", self, [ 0, 0 ] , { label: [ "Amplitude", "Period" ], linkable: false, per_line: true });
|
||||
|
||||
inputs[| 43] = nodeValue_Vector("Scale wiggle", self, [ 0, 0 ] , { label: [ "Amplitude", "Period" ], linkable: false, per_line: true });
|
||||
inputs[43] = nodeValue_Vector("Scale wiggle", self, [ 0, 0 ] , { label: [ "Amplitude", "Period" ], linkable: false, per_line: true });
|
||||
|
||||
inputs[| 44] = nodeValue_Trigger("Spawn", self, false )
|
||||
inputs[44] = nodeValue_Trigger("Spawn", self, false )
|
||||
.setDisplay(VALUE_DISPLAY.button, { name: "Trigger" });
|
||||
|
||||
inputs[| 45] = nodeValue_Bool("Follow Path", self, false );
|
||||
inputs[45] = nodeValue_Bool("Follow Path", self, false );
|
||||
|
||||
inputs[| 46] = nodeValue_PathNode("Path", self, noone );
|
||||
inputs[46] = nodeValue_PathNode("Path", self, noone );
|
||||
|
||||
inputs[| 47] = nodeValue("Path Deviation", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
inputs[47] = nodeValue("Path Deviation", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
|
||||
inputs[| 48] = nodeValue_Trigger("Reset Seed", self, false )
|
||||
inputs[48] = nodeValue_Trigger("Reset Seed", self, false )
|
||||
.setDisplay(VALUE_DISPLAY.button, { name: "Trigger" })
|
||||
|
||||
inputs[| 49] = nodeValue_Bool("Stretch Animation", self, false );
|
||||
inputs[49] = nodeValue_Bool("Stretch Animation", self, false );
|
||||
|
||||
for (var i = 2, n = ds_list_size(inputs); i < n; i++)
|
||||
inputs[| i].rejectArray();
|
||||
for (var i = 2, n = array_length(inputs); i < n; i++)
|
||||
inputs[i].rejectArray();
|
||||
|
||||
input_len = ds_list_size(inputs);
|
||||
input_len = array_length(inputs);
|
||||
|
||||
input_display_list = [ 32, 48,
|
||||
["Sprite", false], 0, 22, 23, 49, 26,
|
||||
|
@ -396,12 +396,10 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
} #endregion
|
||||
|
||||
static runVFX = function(_time = CURRENT_FRAME, _render = true) { #region
|
||||
var _spawn_delay = inputs[| 1].getValue(_time);
|
||||
var _spawn_type = inputs[| 16].getValue(_time);
|
||||
var _spawn_active = inputs[| 27].getValue(_time);
|
||||
var _spawn_trig = inputs[| 44].getValue(_time);
|
||||
|
||||
//print($"{_time} : {_spawn_trig} | {ds_list_to_array(inputs[| 44].animator.values)}");
|
||||
var _spawn_delay = inputs[1].getValue(_time);
|
||||
var _spawn_type = inputs[16].getValue(_time);
|
||||
var _spawn_active = inputs[27].getValue(_time);
|
||||
var _spawn_trig = inputs[44].getValue(_time);
|
||||
|
||||
getInputs(_time);
|
||||
getSurfaceCache();
|
||||
|
@ -440,35 +438,35 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
var _spwTyp = getInputData(16);
|
||||
var _usePth = getInputData(45);
|
||||
|
||||
inputs[| 6].setVisible(!_dirAng);
|
||||
inputs[ 6].setVisible(!_dirAng);
|
||||
|
||||
inputs[| 24].setVisible(_dist < 2);
|
||||
inputs[24].setVisible(_dist < 2);
|
||||
|
||||
inputs[| 30].setVisible(_dist == 2, _dist == 2);
|
||||
inputs[30].setVisible(_dist == 2, _dist == 2);
|
||||
|
||||
inputs[| 35].setVisible(_turn[0] != 0 && _turn[1] != 0);
|
||||
inputs[| 36].setVisible(_turn[0] != 0 && _turn[1] != 0);
|
||||
inputs[35].setVisible(_turn[0] != 0 && _turn[1] != 0);
|
||||
inputs[36].setVisible(_turn[0] != 0 && _turn[1] != 0);
|
||||
|
||||
inputs[| 22].setVisible(false);
|
||||
inputs[| 23].setVisible(false);
|
||||
inputs[| 26].setVisible(false);
|
||||
inputs[| 49].setVisible(false);
|
||||
inputs[22].setVisible(false);
|
||||
inputs[23].setVisible(false);
|
||||
inputs[26].setVisible(false);
|
||||
inputs[49].setVisible(false);
|
||||
|
||||
inputs[| 46].setVisible(true, _usePth);
|
||||
inputs[46].setVisible(true, _usePth);
|
||||
|
||||
inputs[| 1].setVisible(_spwTyp < 2);
|
||||
if(_spwTyp == 0) inputs[| 1].name = "Spawn delay";
|
||||
else if(_spwTyp == 1) inputs[| 1].name = "Spawn frame";
|
||||
inputs[1].setVisible(_spwTyp < 2);
|
||||
if(_spwTyp == 0) inputs[1].name = "Spawn delay";
|
||||
else if(_spwTyp == 1) inputs[1].name = "Spawn frame";
|
||||
|
||||
inputs[| 44].setVisible(_spwTyp == 2);
|
||||
inputs[44].setVisible(_spwTyp == 2);
|
||||
|
||||
if(is_array(_inSurf)) {
|
||||
inputs[| 22].setVisible(true);
|
||||
inputs[22].setVisible(true);
|
||||
var _type = getInputData(22);
|
||||
if(_type == 2) {
|
||||
inputs[| 23].setVisible(true);
|
||||
inputs[| 26].setVisible(true);
|
||||
inputs[| 49].setVisible(true);
|
||||
inputs[23].setVisible(true);
|
||||
inputs[26].setVisible(true);
|
||||
inputs[49].setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -483,7 +481,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
var _flag = is_instanceof(_spr, SurfaceAtlas)? 0b0001 : 0b0011;
|
||||
|
||||
inputs[| 3].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag);
|
||||
inputs[3].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag);
|
||||
if(onDrawOverlay != -1)
|
||||
onDrawOverlay(active, _x, _y, _s, _mx, _my);
|
||||
} #endregion
|
||||
|
|
|
@ -7,7 +7,7 @@ function Node_Smoke(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
if(_update) update(frame);
|
||||
//print($"Update {frame}: {name}");
|
||||
|
||||
var outJunc = outputs[| 0];
|
||||
var outJunc = outputs[0];
|
||||
for( var i = 0; i < array_length(outJunc.value_to); i++ ) {
|
||||
var _to = outJunc.value_to[i];
|
||||
if(_to.value_from != outJunc) continue;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#macro STRAND_EFFECTOR_POST \
|
||||
} \
|
||||
} \
|
||||
outputs[| 0].setValue(_str);
|
||||
outputs[0].setValue(_str);
|
||||
|
||||
function _Node_Strand_Affector(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Affector";
|
||||
|
@ -40,23 +40,23 @@ function _Node_Strand_Affector(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
icon = THEME.strandSim;
|
||||
setDimension(96, 48);
|
||||
|
||||
inputs[| 0] = nodeValue("Strand", self, JUNCTION_CONNECT.input, VALUE_TYPE.strands, noone)
|
||||
inputs[0] = nodeValue("Strand", self, JUNCTION_CONNECT.input, VALUE_TYPE.strands, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Enum_Scroll("Shape", self, 0, [ "Point", "Band" ]);
|
||||
inputs[1] = nodeValue_Enum_Scroll("Shape", self, 0, [ "Point", "Band" ]);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Position", self, [ 0, 0 ]);
|
||||
inputs[2] = nodeValue_Vector("Position", self, [ 0, 0 ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Range", self, 4);
|
||||
inputs[3] = nodeValue_Float("Range", self, 4);
|
||||
|
||||
inputs[| 4] = nodeValue_Rotation("Direction", self, 0);
|
||||
inputs[4] = nodeValue_Rotation("Direction", self, 0);
|
||||
|
||||
inputs[| 5] = nodeValue_Float("Falloff", self, 0.2)
|
||||
inputs[5] = nodeValue_Float("Falloff", self, 0.2)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Strand", self, VALUE_TYPE.strands, noone);
|
||||
outputs[0] = nodeValue_Output("Strand", self, VALUE_TYPE.strands, noone);
|
||||
|
||||
input_fix_len = ds_list_size(inputs);
|
||||
input_fix_len = array_length(inputs);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Shape", false], 1, 2, 3, 4, 5,
|
||||
|
@ -139,14 +139,14 @@ function _Node_Strand_Affector(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
draw_line_dashed(px0, py0, px1, py1);
|
||||
}
|
||||
|
||||
active &= inputs[| 2].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
active &= inputs[| 4].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
active &= inputs[| 3].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
active &= inputs[2].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
active &= inputs[4].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
active &= inputs[3].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
var _typ = getInputData(1);
|
||||
inputs[| 4].setVisible(_typ == 1);
|
||||
inputs[4].setVisible(_typ == 1);
|
||||
|
||||
STRAND_EFFECTOR_PRE
|
||||
// add effect (pnt, mulp)
|
||||
|
|
|
@ -9,20 +9,20 @@ function argumentRenderer(_typeArray = []) {
|
|||
var hh = ui(8);
|
||||
var _th = TEXTBOX_HEIGHT + ui(4);
|
||||
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) {
|
||||
var _jType = inputs[| i + 1];
|
||||
for( var i = input_fix_len; i < array_length(inputs); i += data_length ) {
|
||||
var _jType = inputs[i + 1];
|
||||
var _h = 0;
|
||||
|
||||
_jType.editWidget.setFocusHover(_focus, _hover);
|
||||
_jType.editWidget.draw(tx, ty, ui(128), _th, _jType.display_data.data[_jType.showValue()], _m, argument_renderer.rx, argument_renderer.ry);
|
||||
|
||||
var _jName = inputs[| i + 0];
|
||||
var _jName = inputs[i + 0];
|
||||
_jName.editWidget.setFocusHover(_focus, _hover);
|
||||
_jName.editWidget.draw(tx + ui(128 + 8), ty, _w - ui(128 + 8), _th, _jName.showValue(), _m, _jName.display_type);
|
||||
|
||||
_h += _th + ui(8);
|
||||
|
||||
var _jValue = inputs[| i + 2];
|
||||
var _jValue = inputs[i + 2];
|
||||
if(argument_renderer.showValue && _jValue.editWidget != noone) {
|
||||
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub);
|
||||
draw_text_add(tx + ui(8), ty + _th + ui(8 + 6), __txt("Value"));
|
||||
|
@ -42,11 +42,11 @@ function argumentRenderer(_typeArray = []) {
|
|||
});
|
||||
|
||||
argument_renderer.register = function(parent = noone) {
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) {
|
||||
inputs[| i + 1].editWidget.register(parent);
|
||||
inputs[| i + 0].editWidget.register(parent);
|
||||
if(inputs[| i + 2].editWidget != noone)
|
||||
inputs[| i + 2].editWidget.register(parent);
|
||||
for( var i = input_fix_len; i < array_length(inputs); i += data_length ) {
|
||||
inputs[i + 1].editWidget.register(parent);
|
||||
inputs[i + 0].editWidget.register(parent);
|
||||
if(inputs[i + 2].editWidget != noone)
|
||||
inputs[i + 2].editWidget.register(parent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,8 +63,8 @@ function canvas_tool_node(canvas, node) : canvas_tool() constructor {
|
|||
|
||||
setColor = true;
|
||||
|
||||
for( var i = 0, n = ds_list_size(nodeObject.inputs); i < n; i++ ) {
|
||||
var _in = nodeObject.inputs[| i];
|
||||
for( var i = 0, n = array_length(nodeObject.inputs); i < n; i++ ) {
|
||||
var _in = nodeObject.inputs[i];
|
||||
if(_in.type == VALUE_TYPE.surface || _in.name == "Dimension")
|
||||
inputJunction = _in;
|
||||
|
||||
|
@ -75,8 +75,8 @@ function canvas_tool_node(canvas, node) : canvas_tool() constructor {
|
|||
|
||||
}
|
||||
|
||||
for( var i = 0, n = ds_list_size(nodeObject.outputs); i < n; i++ ) {
|
||||
var _in = nodeObject.outputs[| i];
|
||||
for( var i = 0, n = array_length(nodeObject.outputs); i < n; i++ ) {
|
||||
var _in = nodeObject.outputs[i];
|
||||
if(_in.type == VALUE_TYPE.surface) {
|
||||
outputJunction = _in;
|
||||
break;
|
||||
|
|
|
@ -114,7 +114,7 @@ function canvas_tool_resize() : canvas_tool() constructor {
|
|||
surface_free(_canvas_surface);
|
||||
}
|
||||
|
||||
node.inputs[| 0].setValue([_sw, _sh]);
|
||||
node.inputs[0].setValue([_sw, _sh]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ function cmd_submit(command) { #region
|
|||
var glb = PROJECT.globalNode;
|
||||
|
||||
if(glb.inputExist(key)) {
|
||||
for( var i = 0; i < ds_list_size(glb.inputs); i++ ) {
|
||||
var _inp = glb.inputs[| i];
|
||||
for( var i = 0; i < array_length(glb.inputs); i++ ) {
|
||||
var _inp = glb.inputs[i];
|
||||
if(_inp.name != key) continue;
|
||||
|
||||
if(_inp.type == VALUE_TYPE.text || _inp.type == VALUE_TYPE.path) {
|
||||
|
|
|
@ -122,8 +122,8 @@ function Action(_type, _object, _data, _trigger = 0) constructor {
|
|||
var _vt = _dl.value_to;
|
||||
_nd.enable();
|
||||
|
||||
for (var j = 0, m = ds_list_size(_nd.outputs); j < m; j++) {
|
||||
var _out = _nd.outputs[| j];
|
||||
for (var j = 0, m = array_length(_nd.outputs); j < m; j++) {
|
||||
var _out = _nd.outputs[j];
|
||||
var _too = _vt[j];
|
||||
|
||||
for (var k = 0, p = array_length(_too); k < p; k++)
|
||||
|
@ -135,7 +135,7 @@ function Action(_type, _object, _data, _trigger = 0) constructor {
|
|||
|
||||
for (var i = 0, n = array_length(_connectTo); i < n; i++)
|
||||
for (var j = 0, m = array_length(_connectTo[i]); j < m; j++)
|
||||
_connectTo[i][j].setFrom(obj.outputs[| i]);
|
||||
_connectTo[i][j].setFrom(obj.outputs[i]);
|
||||
|
||||
break;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
LATEST_VERSION = 11700;
|
||||
VERSION = 11790;
|
||||
SAVE_VERSION = 11700;
|
||||
VERSION_STRING = "1.17.10.001";
|
||||
VERSION_STRING = "1.17.10.002";
|
||||
BUILD_NUMBER = 11790;
|
||||
|
||||
HOTKEYS = ds_map_create();
|
||||
|
|
|
@ -17,7 +17,7 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
|||
|
||||
if(var_editing) {
|
||||
var del = noone;
|
||||
if(ds_list_size(_node.inputs)) {
|
||||
if(array_length(_node.inputs)) {
|
||||
yy += ui(8);
|
||||
hh += ui(8);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
|||
var wd_x = xx;
|
||||
var wd_w = ww;
|
||||
|
||||
var _len = ds_list_size(_node.inputs);
|
||||
var _len = array_length(_node.inputs);
|
||||
var _ins = var_drag_insert;
|
||||
var_drag_insert = _len;
|
||||
|
||||
|
@ -35,7 +35,7 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
|||
var_drag_shift = lerp_float(var_drag_shift, (var_dragging != noone) * 48, 4);
|
||||
|
||||
for( var j = 0; j < _len; j++ ) {
|
||||
var _inpu = _node.inputs[| j];
|
||||
var _inpu = _node.inputs[j];
|
||||
var _edit = _inpu.editor;
|
||||
|
||||
var _wd_x = wd_x + (var_drag_disp == j) * var_drag_shift;
|
||||
|
@ -96,11 +96,11 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
|||
|
||||
if(var_dragging != noone) {
|
||||
if(var_drag_insert != var_dragging) {
|
||||
var _inp = _node.inputs[| var_dragging];
|
||||
ds_list_delete(_node.inputs, var_dragging);
|
||||
var _inp = _node.inputs[var_dragging];
|
||||
array_delete(_node.inputs, var_dragging, 1);
|
||||
|
||||
if(var_drag_insert > var_dragging) var_drag_insert--;
|
||||
ds_list_insert(_node.inputs, var_drag_insert, _inp);
|
||||
array_insert(_node.inputs, var_drag_insert, _inp);
|
||||
|
||||
var_dragging = var_drag_insert;
|
||||
var_drag_disp = var_drag_insert;
|
||||
|
@ -111,16 +111,16 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
|||
}
|
||||
|
||||
if(del != noone)
|
||||
ds_list_delete(_node.inputs, del);
|
||||
array_delete(_node.inputs, del, 1);
|
||||
} else {
|
||||
for( var j = 0; j < ds_list_size(_node.inputs); j++ ) {
|
||||
var widg = drawWidget(xx, yy, ww, _m, _node.inputs[| j], true, focus, hover, _scrollPane, rx, ry);
|
||||
for( var j = 0; j < array_length(_node.inputs); j++ ) {
|
||||
var widg = drawWidget(xx, yy, ww, _m, _node.inputs[j], true, focus, hover, _scrollPane, rx, ry);
|
||||
var widH = widg[0];
|
||||
var mbRight = widg[1];
|
||||
var widHov = widg[2];
|
||||
|
||||
if(hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + ww, yy + widH))
|
||||
_HOVERING_ELEMENT = _node.inputs[| j];
|
||||
_HOVERING_ELEMENT = _node.inputs[j];
|
||||
|
||||
yy += lb_h + widH + padd;
|
||||
hh += lb_h + widH + padd;
|
||||
|
|
|
@ -71,7 +71,7 @@ function hlsl_document_parser(prompt, node = noone) {
|
|||
var params = [];
|
||||
var lines = string_split(prompt, "\n");
|
||||
|
||||
for( var i = node.input_fix_len, n = ds_list_size(node.inputs); i < n; i += node.data_length ) {
|
||||
for( var i = node.input_fix_len, n = array_length(node.inputs); i < n; i += node.data_length ) {
|
||||
var _arg_name = node.getInputData(i + 0);
|
||||
var _arg_type = node.getInputData(i + 1);
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
function __init_mask_modifier(_mask_index) { #region
|
||||
var _ind = ds_list_size(inputs);
|
||||
var _ind = array_length(inputs);
|
||||
|
||||
inputs[| _ind + 0] = nodeValue_Bool("Invert mask", self, false);
|
||||
inputs[_ind + 0] = nodeValue_Bool("Invert mask", self, false);
|
||||
|
||||
inputs[| _ind + 1] = nodeValue_Float("Mask feather", self, 0)
|
||||
inputs[_ind + 1] = nodeValue_Float("Mask feather", self, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 32, 0.1] });
|
||||
|
||||
__mask_index = _mask_index;
|
||||
|
@ -14,8 +14,8 @@ function __init_mask_modifier(_mask_index) { #region
|
|||
|
||||
function __step_mask_modifier() { #region
|
||||
var _msk = is_surface(getSingleValue(__mask_index));
|
||||
inputs[| __mask_mod_index + 0].setVisible(_msk);
|
||||
inputs[| __mask_mod_index + 1].setVisible(_msk);
|
||||
inputs[__mask_mod_index + 0].setVisible(_msk);
|
||||
inputs[__mask_mod_index + 1].setVisible(_msk);
|
||||
} #endregion
|
||||
|
||||
function __process_mask_modifier(data) { #region
|
||||
|
|
|
@ -4,22 +4,22 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
is_simulation = true;
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Surface", self);
|
||||
inputs[0] = nodeValue_Surface("Surface", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Int("Delay Amounts", self, 4);
|
||||
inputs[1] = nodeValue_Int("Delay Amounts", self, 4);
|
||||
|
||||
inputs[| 2] = nodeValue_Int("Delay Frames", self, 1);
|
||||
inputs[2] = nodeValue_Int("Delay Frames", self, 1);
|
||||
|
||||
inputs[| 3] = nodeValue_Palette("Blend over Delay", self, [ c_white ]);
|
||||
inputs[3] = nodeValue_Palette("Blend over Delay", self, [ c_white ]);
|
||||
|
||||
inputs[| 4] = nodeValue("Alpha over Delay", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11);
|
||||
inputs[4] = nodeValue("Alpha over Delay", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11);
|
||||
|
||||
inputs[| 5] = nodeValue_Enum_Scroll("Palette Select", self, 0, [ "Loop", "Pingpong", "Random" ]);
|
||||
inputs[5] = nodeValue_Enum_Scroll("Palette Select", self, 0, [ "Loop", "Pingpong", "Random" ]);
|
||||
|
||||
inputs[| 6] = nodeValue_Int("Seed", self, seed_random(6))
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[| 6].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
||||
inputs[6] = nodeValue_Int("Seed", self, seed_random(6))
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[6].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Delay", false], 1, 2,
|
||||
|
@ -34,7 +34,7 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
static step = function() {
|
||||
var _psel = getInputData(5);
|
||||
|
||||
inputs[| 6].setVisible(_psel == 2);
|
||||
inputs[6].setVisible(_psel == 2);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
@ -53,7 +53,7 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
var _sw = surface_get_width_safe(_surf);
|
||||
var _sh = surface_get_height_safe(_surf);
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
var _outSurf = outputs[0].getValue();
|
||||
_outSurf = surface_verify(_outSurf, _sw, _sh);
|
||||
|
||||
var cc, aa;
|
||||
|
@ -79,6 +79,6 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
}
|
||||
surface_reset_target();
|
||||
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
outputs[0].setValue(_outSurf);
|
||||
}
|
||||
}
|
|
@ -15,55 +15,55 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
uniform_band = shader_get_uniform(shader, "band");
|
||||
uniform_attn = shader_get_uniform(shader, "atten");
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Surface in", self);
|
||||
inputs[0] = nodeValue_Surface("Surface in", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Enum_Scroll("Light shape", self, 0, [ new scrollItem("Point", s_node_2d_light_shape, 0),
|
||||
inputs[1] = nodeValue_Enum_Scroll("Light shape", self, 0, [ new scrollItem("Point", s_node_2d_light_shape, 0),
|
||||
new scrollItem("Line", s_node_2d_light_shape, 1),
|
||||
new scrollItem("Line asymmetric", s_node_2d_light_shape, 2),
|
||||
new scrollItem("Spot", s_node_2d_light_shape, 3), ]);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Center", self, [ 16, 16 ])
|
||||
inputs[2] = nodeValue_Vector("Center", self, [ 16, 16 ])
|
||||
.setUnitRef(function(index) { return getDimension(index); });
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Range", self, 16);
|
||||
inputs[3] = nodeValue_Float("Range", self, 16);
|
||||
|
||||
inputs[| 4] = nodeValue_Float("Intensity", self, 1)
|
||||
inputs[4] = nodeValue_Float("Intensity", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 5] = nodeValue_Color("Color", self, c_white);
|
||||
inputs[5] = nodeValue_Color("Color", self, c_white);
|
||||
|
||||
inputs[| 6] = nodeValue_Vector("Start", self, [ 16, 16 ]);
|
||||
inputs[6] = nodeValue_Vector("Start", self, [ 16, 16 ]);
|
||||
|
||||
inputs[| 7] = nodeValue_Vector("Finish", self, [ 32, 16 ]);
|
||||
inputs[7] = nodeValue_Vector("Finish", self, [ 32, 16 ]);
|
||||
|
||||
inputs[| 8] = nodeValue_Int("Sweep", self, 15)
|
||||
inputs[8] = nodeValue_Int("Sweep", self, 15)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-80, 80, 0.1] });
|
||||
|
||||
inputs[| 9] = nodeValue_Int("Sweep end", self, 0)
|
||||
inputs[9] = nodeValue_Int("Sweep end", self, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [-80, 80, 0.1] });
|
||||
|
||||
inputs[| 10] = nodeValue_Int("Banding", self, 0)
|
||||
inputs[10] = nodeValue_Int("Banding", self, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 16, 0.1] });
|
||||
|
||||
inputs[| 11] = nodeValue_Enum_Scroll("Attenuation", self, 0,
|
||||
inputs[11] = nodeValue_Enum_Scroll("Attenuation", self, 0,
|
||||
[ new scrollItem("Quadratic", s_node_curve, 0),
|
||||
new scrollItem("Invert quadratic", s_node_curve, 1),
|
||||
new scrollItem("Linear", s_node_curve, 2), ])
|
||||
.setTooltip("Control how light fade out over distance.");
|
||||
|
||||
inputs[| 12] = nodeValue_Int("Radial banding", self, 0)
|
||||
inputs[12] = nodeValue_Int("Radial banding", self, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 16, 0.1] });
|
||||
|
||||
inputs[| 13] = nodeValue_Rotation("Radial start", self, 0);
|
||||
inputs[13] = nodeValue_Rotation("Radial start", self, 0);
|
||||
|
||||
inputs[| 14] = nodeValue_Float("Radial band ratio", self, 0.5)
|
||||
inputs[14] = nodeValue_Float("Radial band ratio", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 15] = nodeValue_Bool("Active", self, true);
|
||||
inputs[15] = nodeValue_Bool("Active", self, true);
|
||||
active_index = 15;
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[| 1] = nodeValue_Output("Light only", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[1] = nodeValue_Output("Light only", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [ 15, 0,
|
||||
["Shape", false], 1, 2, 6, 7, 8, 9,
|
||||
|
@ -85,14 +85,14 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var px = _x + pos[0] * _s;
|
||||
var py = _y + pos[1] * _s;
|
||||
|
||||
var hv = inputs[| 2].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||
var hv = inputs[| 3].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||
var hv = inputs[2].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||
var hv = inputs[3].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||
break;
|
||||
case LIGHT_SHAPE_2D.line :
|
||||
case LIGHT_SHAPE_2D.line_asym :
|
||||
case LIGHT_SHAPE_2D.spot :
|
||||
var hv = inputs[| 6].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||
var hv = inputs[| 7].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||
var hv = inputs[6].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||
var hv = inputs[7].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -104,41 +104,41 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
switch(_shape) {
|
||||
case LIGHT_SHAPE_2D.point :
|
||||
inputs[| 2].setVisible(true);
|
||||
inputs[| 3].setVisible(true);
|
||||
inputs[| 6].setVisible(false);
|
||||
inputs[| 7].setVisible(false);
|
||||
inputs[| 8].setVisible(false);
|
||||
inputs[| 9].setVisible(false);
|
||||
inputs[2].setVisible(true);
|
||||
inputs[3].setVisible(true);
|
||||
inputs[6].setVisible(false);
|
||||
inputs[7].setVisible(false);
|
||||
inputs[8].setVisible(false);
|
||||
inputs[9].setVisible(false);
|
||||
|
||||
inputs[| 12].setVisible(true);
|
||||
inputs[| 13].setVisible(true);
|
||||
inputs[| 14].setVisible(true);
|
||||
inputs[12].setVisible(true);
|
||||
inputs[13].setVisible(true);
|
||||
inputs[14].setVisible(true);
|
||||
break;
|
||||
case LIGHT_SHAPE_2D.line :
|
||||
case LIGHT_SHAPE_2D.line_asym :
|
||||
inputs[| 2].setVisible(false);
|
||||
inputs[| 3].setVisible(true);
|
||||
inputs[| 6].setVisible(true);
|
||||
inputs[| 7].setVisible(true);
|
||||
inputs[| 8].setVisible(true);
|
||||
inputs[| 9].setVisible(_shape == LIGHT_SHAPE_2D.line_asym);
|
||||
inputs[2].setVisible(false);
|
||||
inputs[3].setVisible(true);
|
||||
inputs[6].setVisible(true);
|
||||
inputs[7].setVisible(true);
|
||||
inputs[8].setVisible(true);
|
||||
inputs[9].setVisible(_shape == LIGHT_SHAPE_2D.line_asym);
|
||||
|
||||
inputs[| 12].setVisible(false);
|
||||
inputs[| 13].setVisible(false);
|
||||
inputs[| 14].setVisible(false);
|
||||
inputs[12].setVisible(false);
|
||||
inputs[13].setVisible(false);
|
||||
inputs[14].setVisible(false);
|
||||
break;
|
||||
case LIGHT_SHAPE_2D.spot :
|
||||
inputs[| 2].setVisible(false);
|
||||
inputs[| 3].setVisible(false);
|
||||
inputs[| 6].setVisible(true);
|
||||
inputs[| 7].setVisible(true);
|
||||
inputs[| 8].setVisible(true);
|
||||
inputs[| 9].setVisible(false);
|
||||
inputs[2].setVisible(false);
|
||||
inputs[3].setVisible(false);
|
||||
inputs[6].setVisible(true);
|
||||
inputs[7].setVisible(true);
|
||||
inputs[8].setVisible(true);
|
||||
inputs[9].setVisible(false);
|
||||
|
||||
inputs[| 12].setVisible(false);
|
||||
inputs[| 13].setVisible(false);
|
||||
inputs[| 14].setVisible(false);
|
||||
inputs[12].setVisible(false);
|
||||
inputs[13].setVisible(false);
|
||||
inputs[14].setVisible(false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,66 +18,66 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
|
||||
global.SKY_SPHERE = new __3dUVSphere(0.5, 16, 8, true);
|
||||
|
||||
inputs[| in_d3d + 0] = nodeValue_Int("FOV", self, 60 )
|
||||
inputs[in_d3d + 0] = nodeValue_Int("FOV", self, 60 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 10, 90, 0.1 ] });
|
||||
|
||||
inputs[| in_d3d + 1] = nodeValue_Vector("Clipping Distance", self, [ 1, 10 ] );
|
||||
inputs[in_d3d + 1] = nodeValue_Vector("Clipping Distance", self, [ 1, 10 ] );
|
||||
|
||||
inputs[| in_d3d + 2] = nodeValue_Dimension(self);
|
||||
inputs[in_d3d + 2] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| in_d3d + 3] = nodeValue_Enum_Button("Projection", self, 1 , [ "Perspective", "Orthographic" ]);
|
||||
inputs[in_d3d + 3] = nodeValue_Enum_Button("Projection", self, 1 , [ "Perspective", "Orthographic" ]);
|
||||
|
||||
inputs[| in_d3d + 4] = nodeValue_D3Scene("Scene", self, noone )
|
||||
inputs[in_d3d + 4] = nodeValue_D3Scene("Scene", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_d3d + 5] = nodeValue_Color("Ambient Light", self, c_dkgrey );
|
||||
inputs[in_d3d + 5] = nodeValue_Color("Ambient Light", self, c_dkgrey );
|
||||
|
||||
inputs[| in_d3d + 6] = nodeValue_Bool("Show Background", self, false );
|
||||
inputs[in_d3d + 6] = nodeValue_Bool("Show Background", self, false );
|
||||
|
||||
inputs[| in_d3d + 7] = nodeValue_Enum_Button("Backface Culling", self, 2 , [ "None", "CW", "CCW" ]);
|
||||
inputs[in_d3d + 7] = nodeValue_Enum_Button("Backface Culling", self, 2 , [ "None", "CW", "CCW" ]);
|
||||
|
||||
inputs[| in_d3d + 8] = nodeValue_Float("Orthographic Scale", self, 0.5 )
|
||||
inputs[in_d3d + 8] = nodeValue_Float("Orthographic Scale", self, 0.5 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0.01, 4, 0.01 ] });
|
||||
|
||||
inputs[| in_d3d + 9] = nodeValue_Enum_Scroll("Postioning Mode", self, 2, [ "Position + Rotation", "Position + Lookat", "Lookat + Rotation" ] );
|
||||
inputs[in_d3d + 9] = nodeValue_Enum_Scroll("Postioning Mode", self, 2, [ "Position + Rotation", "Position + Lookat", "Lookat + Rotation" ] );
|
||||
|
||||
inputs[| in_d3d + 10] = nodeValue_Vector("Lookat Position", self, [ 0, 0, 0 ] );
|
||||
inputs[in_d3d + 10] = nodeValue_Vector("Lookat Position", self, [ 0, 0, 0 ] );
|
||||
|
||||
inputs[| in_d3d + 11] = nodeValue_Rotation("Roll", self, 0);
|
||||
inputs[in_d3d + 11] = nodeValue_Rotation("Roll", self, 0);
|
||||
|
||||
inputs[| in_d3d + 12] = nodeValue_Rotation("Horizontal Angle", self, 45 );
|
||||
inputs[in_d3d + 12] = nodeValue_Rotation("Horizontal Angle", self, 45 );
|
||||
|
||||
inputs[| in_d3d + 13] = nodeValue_Float("Vertical Angle", self, 30 )
|
||||
inputs[in_d3d + 13] = nodeValue_Float("Vertical Angle", self, 30 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 90, 0.1] });
|
||||
|
||||
inputs[| in_d3d + 14] = nodeValue_Float("Distance", self, 4 );
|
||||
inputs[in_d3d + 14] = nodeValue_Float("Distance", self, 4 );
|
||||
|
||||
inputs[| in_d3d + 15] = nodeValue_Bool("Gamma Adjust", self, false );
|
||||
inputs[in_d3d + 15] = nodeValue_Bool("Gamma Adjust", self, false );
|
||||
|
||||
inputs[| in_d3d + 16] = nodeValue_Surface("Environment Texture", self);
|
||||
inputs[in_d3d + 16] = nodeValue_Surface("Environment Texture", self);
|
||||
|
||||
inputs[| in_d3d + 17] = nodeValue_Bool("Ambient Occlusion", self, false );
|
||||
inputs[in_d3d + 17] = nodeValue_Bool("Ambient Occlusion", self, false );
|
||||
|
||||
inputs[| in_d3d + 18] = nodeValue_Float("AO Radius", self, 0.25 );
|
||||
inputs[in_d3d + 18] = nodeValue_Float("AO Radius", self, 0.25 );
|
||||
|
||||
inputs[| in_d3d + 19] = nodeValue_Float("AO Bias", self, 0.05 );
|
||||
inputs[in_d3d + 19] = nodeValue_Float("AO Bias", self, 0.05 );
|
||||
|
||||
inputs[| in_d3d + 20] = nodeValue_Float("AO Strength", self, 1. )
|
||||
inputs[in_d3d + 20] = nodeValue_Float("AO Strength", self, 1. )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0.01, 4, 0.01 ] });
|
||||
|
||||
inputs[| in_d3d + 21] = nodeValue_Int("Round Normal", self, 0 )
|
||||
inputs[in_d3d + 21] = nodeValue_Int("Round Normal", self, 0 )
|
||||
.setWindows();
|
||||
|
||||
inputs[| in_d3d + 22] = nodeValue_Enum_Button("Blend mode", self, 0 , [ "Normal", "Additive" ]);
|
||||
inputs[in_d3d + 22] = nodeValue_Enum_Button("Blend mode", self, 0 , [ "Normal", "Additive" ]);
|
||||
|
||||
in_cam = ds_list_size(inputs);
|
||||
in_cam = array_length(inputs);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone );
|
||||
outputs[0] = nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone );
|
||||
|
||||
outputs[| 1] = nodeValue_Output("Normal", self, VALUE_TYPE.surface, noone )
|
||||
outputs[1] = nodeValue_Output("Normal", self, VALUE_TYPE.surface, noone )
|
||||
.setVisible(false);
|
||||
|
||||
outputs[| 2] = nodeValue_Output("Depth", self, VALUE_TYPE.surface, noone )
|
||||
outputs[2] = nodeValue_Output("Depth", self, VALUE_TYPE.surface, noone )
|
||||
.setVisible(false);
|
||||
|
||||
input_display_list = [ in_d3d + 4,
|
||||
|
@ -104,7 +104,7 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
}
|
||||
|
||||
static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) {
|
||||
var _rot = inputs[| 1].display_data.angle_display;
|
||||
var _rot = inputs[1].display_data.angle_display;
|
||||
tools = _rot == QUARTERNION_DISPLAY.quarterion? tool_quate : tool_euler;
|
||||
if(_rot == QUARTERNION_DISPLAY.euler && isUsingTool("Rotate"))
|
||||
PANEL_PREVIEW.tool_current = noone;
|
||||
|
@ -113,13 +113,13 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
if(array_empty(object)) return;
|
||||
object = object[0];
|
||||
|
||||
var _pos = inputs[| 0].getValue(,,, true);
|
||||
var _pos = inputs[0].getValue(,,, true);
|
||||
var _vpos = new __vec3( _pos[0], _pos[1], _pos[2] );
|
||||
|
||||
if(isUsingTool("Transform")) drawGizmoPosition(0, object, _vpos, active, params, _mx, _my, _snx, _sny, _panel);
|
||||
else if(isUsingTool("Rotate")) drawGizmoRotation(1, object, _vpos, active, params, _mx, _my, _snx, _sny, _panel);
|
||||
else if(isUsingTool("Move Target")) {
|
||||
var _lkpos = inputs[| in_d3d + 10].getValue(,,, true);
|
||||
var _lkpos = inputs[in_d3d + 10].getValue(,,, true);
|
||||
var _lkvpos = new __vec3( _lkpos[0], _lkpos[1], _lkpos[2] );
|
||||
|
||||
drawGizmoPosition(in_d3d + 10, noone, _lkvpos, active, params, _mx, _my, _snx, _sny, _panel);
|
||||
|
@ -131,7 +131,7 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
}
|
||||
|
||||
#region draw result
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
var _outSurf = outputs[0].getValue();
|
||||
if(is_array(_outSurf)) _outSurf = array_safe_get_fast(_outSurf, 0);
|
||||
if(!is_surface(_outSurf)) return;
|
||||
|
||||
|
@ -162,20 +162,20 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
var _posm = getInputData(in_d3d + 9);
|
||||
var _ao = getInputData(in_d3d + 17);
|
||||
|
||||
inputs[| in_d3d + 0].setVisible(_proj == 0);
|
||||
inputs[| in_d3d + 8].setVisible(_proj == 1);
|
||||
inputs[in_d3d + 0].setVisible(_proj == 0);
|
||||
inputs[in_d3d + 8].setVisible(_proj == 1);
|
||||
|
||||
inputs[| 0].setVisible(_posm == 0 || _posm == 1);
|
||||
inputs[| 1].setVisible(_posm == 0);
|
||||
inputs[| in_d3d + 10].setVisible(_posm == 1 || _posm == 2);
|
||||
inputs[| in_d3d + 11].setVisible(_posm == 1);
|
||||
inputs[| in_d3d + 12].setVisible(_posm == 2);
|
||||
inputs[| in_d3d + 13].setVisible(_posm == 2);
|
||||
inputs[| in_d3d + 14].setVisible(_posm == 2);
|
||||
inputs[0].setVisible(_posm == 0 || _posm == 1);
|
||||
inputs[1].setVisible(_posm == 0);
|
||||
inputs[in_d3d + 10].setVisible(_posm == 1 || _posm == 2);
|
||||
inputs[in_d3d + 11].setVisible(_posm == 1);
|
||||
inputs[in_d3d + 12].setVisible(_posm == 2);
|
||||
inputs[in_d3d + 13].setVisible(_posm == 2);
|
||||
inputs[in_d3d + 14].setVisible(_posm == 2);
|
||||
|
||||
inputs[| in_d3d + 18].setVisible(_ao);
|
||||
inputs[| in_d3d + 19].setVisible(_ao);
|
||||
inputs[| in_d3d + 20].setVisible(_ao);
|
||||
inputs[in_d3d + 18].setVisible(_ao);
|
||||
inputs[in_d3d + 19].setVisible(_ao);
|
||||
inputs[in_d3d + 20].setVisible(_ao);
|
||||
|
||||
switch(_posm) {
|
||||
case 0 :
|
||||
|
@ -304,9 +304,9 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
#endregion
|
||||
|
||||
#region submit
|
||||
var _render = outputs[| 0].getValue();
|
||||
var _normal = outputs[| 1].getValue();
|
||||
var _depth = outputs[| 2].getValue();
|
||||
var _render = outputs[0].getValue();
|
||||
var _normal = outputs[1].getValue();
|
||||
var _depth = outputs[2].getValue();
|
||||
var _bgSurf = _dbg? scene.renderBackground(_dim[0], _dim[1]) : noone;
|
||||
|
||||
_render = surface_verify(_render, _dim[0], _dim[1]);
|
||||
|
|
|
@ -5,31 +5,31 @@ function Node_3D_Camera_Set(_x, _y, _group = noone) : Node_3D_Camera(_x, _y, _gr
|
|||
light_key = new __3dLightDirectional();
|
||||
light_fill = new __3dLightDirectional();
|
||||
|
||||
inputs[| in_cam + 0] = nodeValue_Rotation("L1 H angle", self, 30)
|
||||
inputs[in_cam + 0] = nodeValue_Rotation("L1 H angle", self, 30)
|
||||
.setName("Horizontal angle");
|
||||
|
||||
inputs[| in_cam + 1] = nodeValue_Float("L1 V angle", self, 45 )
|
||||
inputs[in_cam + 1] = nodeValue_Float("L1 V angle", self, 45 )
|
||||
.setName("Vertical angle")
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 90, 0.1] });
|
||||
|
||||
inputs[| in_cam + 2] = nodeValue_Color("L1 Color", self, c_white )
|
||||
inputs[in_cam + 2] = nodeValue_Color("L1 Color", self, c_white )
|
||||
.setName("Color")
|
||||
|
||||
inputs[| in_cam + 3] = nodeValue_Float("L1 Intensity", self, 1 )
|
||||
inputs[in_cam + 3] = nodeValue_Float("L1 Intensity", self, 1 )
|
||||
.setName("Intensity")
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| in_cam + 4] = nodeValue_Rotation("L2 H angle", self, -45)
|
||||
inputs[in_cam + 4] = nodeValue_Rotation("L2 H angle", self, -45)
|
||||
.setName("Horizontal angle");
|
||||
|
||||
inputs[| in_cam + 5] = nodeValue_Float("L2 V angle", self, 45 )
|
||||
inputs[in_cam + 5] = nodeValue_Float("L2 V angle", self, 45 )
|
||||
.setName("Vertical angle")
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 90, 0.1] });
|
||||
|
||||
inputs[| in_cam + 6] = nodeValue_Color("L2 Color", self, c_white )
|
||||
inputs[in_cam + 6] = nodeValue_Color("L2 Color", self, c_white )
|
||||
.setName("Color")
|
||||
|
||||
inputs[| in_cam + 7] = nodeValue_Float("L2 Intensity", self, 0.25 )
|
||||
inputs[in_cam + 7] = nodeValue_Float("L2 Intensity", self, 0.25 )
|
||||
.setName("Intensity")
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
function Node_3D_Depth(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Depth";
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Base Texture", self);
|
||||
inputs[0] = nodeValue_Surface("Base Texture", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Surface("Depth", self);
|
||||
inputs[1] = nodeValue_Surface("Depth", self);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Rotation", self, [0, 0, 0] );
|
||||
inputs[2] = nodeValue_Vector("Rotation", self, [0, 0, 0] );
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [
|
||||
["Texture", false], 0, 1,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
function Node_3D_Instancer(_x, _y, _group = noone) : Node_3D_Modifier(_x, _y, _group) constructor {
|
||||
name = "3D Instancer";
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Int("Amounts", self, 1);
|
||||
inputs[in_mesh + 0] = nodeValue_Int("Amounts", self, 1);
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_Vector("Positions", self, [ 0, 0, 0 ])
|
||||
inputs[in_mesh + 1] = nodeValue_Vector("Positions", self, [ 0, 0, 0 ])
|
||||
.setArrayDepth(1);
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
|
|
|
@ -3,13 +3,13 @@ function Node_3D_Light_Directional(_x, _y, _group = noone) : Node_3D_Light(_x, _
|
|||
|
||||
object_class = __3dLightDirectional;
|
||||
|
||||
inputs[| in_light + 0] = nodeValue_Bool("Cast Shadow", self, false);
|
||||
inputs[in_light + 0] = nodeValue_Bool("Cast Shadow", self, false);
|
||||
|
||||
inputs[| in_light + 1] = nodeValue_Int("Shadow Map Size", self, 1024);
|
||||
inputs[in_light + 1] = nodeValue_Int("Shadow Map Size", self, 1024);
|
||||
|
||||
inputs[| in_light + 2] = nodeValue_Int("Shadow Map Scale", self, 4);
|
||||
inputs[in_light + 2] = nodeValue_Int("Shadow Map Scale", self, 4);
|
||||
|
||||
inputs[| in_light + 3] = nodeValue_Float("Shadow Bias", self, .001);
|
||||
inputs[in_light + 3] = nodeValue_Float("Shadow Bias", self, .001);
|
||||
|
||||
input_display_list = [
|
||||
["Transform", false], 0,
|
||||
|
|
|
@ -3,15 +3,15 @@ function Node_3D_Light_Point(_x, _y, _group = noone) : Node_3D_Light(_x, _y, _gr
|
|||
|
||||
object_class = __3dLightPoint;
|
||||
|
||||
inputs[| in_light + 0] = nodeValue_Float("Radius", self, 4)
|
||||
inputs[in_light + 0] = nodeValue_Float("Radius", self, 4)
|
||||
|
||||
inputs[| in_light + 1] = nodeValue_Bool("Cast Shadow", self, false)
|
||||
inputs[in_light + 1] = nodeValue_Bool("Cast Shadow", self, false)
|
||||
.setWindows();
|
||||
|
||||
inputs[| in_light + 2] = nodeValue_Int("Shadow Map Size", self, 1024)
|
||||
inputs[in_light + 2] = nodeValue_Int("Shadow Map Size", self, 1024)
|
||||
.setWindows();
|
||||
|
||||
inputs[| in_light + 3] = nodeValue_Float("Shadow Bias", self, .001)
|
||||
inputs[in_light + 3] = nodeValue_Float("Shadow Bias", self, .001)
|
||||
.setWindows();
|
||||
|
||||
input_display_list = [
|
||||
|
|
|
@ -2,30 +2,30 @@ function Node_3D_Material(_x, _y, _group = noone) : Node_3D(_x, _y, _group) cons
|
|||
name = "3D Material";
|
||||
solid_surf = noone;
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Texture", self)
|
||||
inputs[0] = nodeValue_Surface("Texture", self)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Float("Diffuse", self, 1 )
|
||||
inputs[1] = nodeValue_Float("Diffuse", self, 1 )
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Specular", self, 0 )
|
||||
inputs[2] = nodeValue_Float("Specular", self, 0 )
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Shininess", self, 1 );
|
||||
inputs[3] = nodeValue_Float("Shininess", self, 1 );
|
||||
|
||||
inputs[| 4] = nodeValue_Bool("Metalic", self, false );
|
||||
inputs[4] = nodeValue_Bool("Metalic", self, false );
|
||||
|
||||
inputs[| 5] = nodeValue_Surface("Normal Map", self);
|
||||
inputs[5] = nodeValue_Surface("Normal Map", self);
|
||||
|
||||
inputs[| 6] = nodeValue_Float("Normal Strength", self, 1 )
|
||||
inputs[6] = nodeValue_Float("Normal Strength", self, 1 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 2, 0.01 ] });
|
||||
|
||||
inputs[| 7] = nodeValue_Float("Roughness", self, 1 )
|
||||
inputs[7] = nodeValue_Float("Roughness", self, 1 )
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 8] = nodeValue_Bool("Anti aliasing", self, false );
|
||||
inputs[8] = nodeValue_Bool("Anti aliasing", self, false );
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Material", self, VALUE_TYPE.d3Material, noone);
|
||||
outputs[0] = nodeValue_Output("Material", self, VALUE_TYPE.d3Material, noone);
|
||||
|
||||
input_display_list = [ 0, 8,
|
||||
["Properties", false], 1, 2, 3, 4, 7,
|
||||
|
@ -66,7 +66,7 @@ function Node_3D_Material(_x, _y, _group = noone) : Node_3D(_x, _y, _group) cons
|
|||
if(!previewable) return;
|
||||
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
var _mat = outputs[| 0].getValue();
|
||||
var _mat = outputs[0].getValue();
|
||||
|
||||
if(_mat == noone) return;
|
||||
|
||||
|
|
|
@ -3,16 +3,16 @@ function Node_3D_Mesh_Cone(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group
|
|||
|
||||
object_class = __3dCone;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Int("Side", self, 8 )
|
||||
inputs[in_mesh + 0] = nodeValue_Int("Side", self, 8 )
|
||||
.setValidator(VV_min(3));
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_D3Material("Material Bottom", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 1] = nodeValue_D3Material("Material Bottom", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_D3Material("Material Side", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 2] = nodeValue_D3Material("Material Side", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_Bool("Smooth Side", self, false );
|
||||
inputs[in_mesh + 3] = nodeValue_Bool("Smooth Side", self, false );
|
||||
|
||||
input_display_list = [
|
||||
__d3d_input_list_mesh, in_mesh + 0, in_mesh + 3,
|
||||
|
|
|
@ -2,24 +2,24 @@ function Node_3D_Mesh_Cube(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group
|
|||
name = "3D Cube";
|
||||
object_class = noone;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Bool("Material per side", self, false );
|
||||
inputs[in_mesh + 0] = nodeValue_Bool("Material per side", self, false );
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 1] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_D3Material("Material Bottom", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 2] = nodeValue_D3Material("Material Bottom", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_D3Material("Material Left", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 3] = nodeValue_D3Material("Material Left", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 4] = nodeValue_D3Material("Material Right", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 4] = nodeValue_D3Material("Material Right", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 5] = nodeValue_D3Material("Material Back", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 5] = nodeValue_D3Material("Material Back", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 6] = nodeValue_D3Material("Material Front", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 6] = nodeValue_D3Material("Material Front", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
input_display_list = [
|
||||
|
@ -35,13 +35,13 @@ function Node_3D_Mesh_Cube(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group
|
|||
static step = function() {
|
||||
var _mat_side = getInputData(in_mesh + 0);
|
||||
|
||||
inputs[| in_mesh + 1].name = _mat_side? "Material Top" : "Material";
|
||||
inputs[| in_mesh + 1].setVisible(true, true);
|
||||
inputs[| in_mesh + 2].setVisible(_mat_side, _mat_side);
|
||||
inputs[| in_mesh + 3].setVisible(_mat_side, _mat_side);
|
||||
inputs[| in_mesh + 4].setVisible(_mat_side, _mat_side);
|
||||
inputs[| in_mesh + 5].setVisible(_mat_side, _mat_side);
|
||||
inputs[| in_mesh + 6].setVisible(_mat_side, _mat_side);
|
||||
inputs[in_mesh + 1].name = _mat_side? "Material Top" : "Material";
|
||||
inputs[in_mesh + 1].setVisible(true, true);
|
||||
inputs[in_mesh + 2].setVisible(_mat_side, _mat_side);
|
||||
inputs[in_mesh + 3].setVisible(_mat_side, _mat_side);
|
||||
inputs[in_mesh + 4].setVisible(_mat_side, _mat_side);
|
||||
inputs[in_mesh + 5].setVisible(_mat_side, _mat_side);
|
||||
inputs[in_mesh + 6].setVisible(_mat_side, _mat_side);
|
||||
}
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
|
|
|
@ -3,21 +3,21 @@ function Node_3D_Mesh_Cylinder(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _g
|
|||
|
||||
object_class = __3dCylinder;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Int("Side", self, 8 )
|
||||
inputs[in_mesh + 0] = nodeValue_Int("Side", self, 8 )
|
||||
.setValidator(VV_min(3));
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_D3Material("Material Top", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 1] = nodeValue_D3Material("Material Top", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_D3Material("Material Bottom", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 2] = nodeValue_D3Material("Material Bottom", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_D3Material("Material Side", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 3] = nodeValue_D3Material("Material Side", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 4] = nodeValue_Bool("Smooth Side", self, false );
|
||||
inputs[in_mesh + 4] = nodeValue_Bool("Smooth Side", self, false );
|
||||
|
||||
inputs[| in_mesh + 5] = nodeValue_Bool("End caps", self, true );
|
||||
inputs[in_mesh + 5] = nodeValue_Bool("End caps", self, true );
|
||||
|
||||
input_display_list = [
|
||||
__d3d_input_list_mesh, in_mesh + 0, in_mesh + 4, in_mesh + 5,
|
||||
|
@ -28,8 +28,8 @@ function Node_3D_Mesh_Cylinder(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _g
|
|||
static step = function() { #region
|
||||
var _caps = getInputData(in_mesh + 5);
|
||||
|
||||
inputs[| in_mesh + 1].setVisible(_caps, _caps);
|
||||
inputs[| in_mesh + 2].setVisible(_caps, _caps);
|
||||
inputs[in_mesh + 1].setVisible(_caps, _caps);
|
||||
inputs[in_mesh + 2].setVisible(_caps, _caps);
|
||||
} #endregion
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
function Node_3D_Mesh_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Mesh Export";
|
||||
|
||||
inputs[| 0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
inputs[0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Text("Paths", self, "")
|
||||
inputs[1] = nodeValue_Text("Paths", self, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "Obj (.obj)|*.obj" })
|
||||
.setVisible(true);
|
||||
|
||||
inputs[| 2] = nodeValue_Bool("Export Texture", self, true);
|
||||
inputs[2] = nodeValue_Bool("Export Texture", self, true);
|
||||
|
||||
inputs[| 3] = nodeValue_Bool("Invert UV", self, false);
|
||||
inputs[3] = nodeValue_Bool("Invert UV", self, false);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Export", false], 1, 2, 3,
|
||||
|
|
|
@ -3,25 +3,25 @@ function Node_3D_Mesh_Extrude(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _gr
|
|||
|
||||
object_class = __3dSurfaceExtrude;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_D3Material("Front Surface", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 0] = nodeValue_D3Material("Front Surface", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_Surface("Front Height", self);
|
||||
inputs[in_mesh + 1] = nodeValue_Surface("Front Height", self);
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_Bool("Smooth", self, false)
|
||||
inputs[in_mesh + 2] = nodeValue_Bool("Smooth", self, false)
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_Bool("Always update", self, false);
|
||||
inputs[in_mesh + 3] = nodeValue_Bool("Always update", self, false);
|
||||
|
||||
inputs[| in_mesh + 4] = nodeValue_Bool("Double Side", self, false);
|
||||
inputs[in_mesh + 4] = nodeValue_Bool("Double Side", self, false);
|
||||
|
||||
inputs[| in_mesh + 5] = nodeValue_D3Material("Back Surface", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 5] = nodeValue_D3Material("Back Surface", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 6] = nodeValue_Surface("Back Height", self);
|
||||
inputs[in_mesh + 6] = nodeValue_Surface("Back Height", self);
|
||||
|
||||
inputs[| in_mesh + 7] = nodeValue_Slider_Range("Front Height Level", self, [ 0, 1 ]);
|
||||
inputs[in_mesh + 7] = nodeValue_Slider_Range("Front Height Level", self, [ 0, 1 ]);
|
||||
|
||||
inputs[| in_mesh + 8] = nodeValue_Slider_Range("Back Height Level", self, [ 0, 1 ]);
|
||||
inputs[in_mesh + 8] = nodeValue_Slider_Range("Back Height Level", self, [ 0, 1 ]);
|
||||
|
||||
input_display_list = [ in_mesh + 3,
|
||||
__d3d_input_list_mesh,
|
||||
|
@ -45,8 +45,8 @@ function Node_3D_Mesh_Extrude(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _gr
|
|||
static step = function() {
|
||||
var _double = getSingleValue(in_mesh + 4);
|
||||
|
||||
inputs[| in_mesh + 5].setVisible(true, _double);
|
||||
inputs[| in_mesh + 6].setVisible(true, _double);
|
||||
inputs[in_mesh + 5].setVisible(true, _double);
|
||||
inputs[in_mesh + 6].setVisible(true, _double);
|
||||
}
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||
|
|
|
@ -25,17 +25,17 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
|||
object = noone;
|
||||
object_class = __3dObject;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Text("File Path", self, "" )
|
||||
inputs[in_mesh + 0] = nodeValue_Text("File Path", self, "" )
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "3d object|*.obj" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_Bool("Flip UV", self, true, "Flip UV axis, can be use to fix some texture mapping error.")
|
||||
inputs[in_mesh + 1] = nodeValue_Bool("Flip UV", self, true, "Flip UV axis, can be use to fix some texture mapping error.")
|
||||
.rejectArray();
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_Float("Import Scale", self, 1)
|
||||
inputs[in_mesh + 2] = nodeValue_Float("Import Scale", self, 1)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_Enum_Scroll("Axis", self, 0, [ "XYZ", "XZ-Y", "X-ZY" ])
|
||||
inputs[in_mesh + 3] = nodeValue_Enum_Scroll("Axis", self, 0, [ "XYZ", "XZ-Y", "X-ZY" ])
|
||||
.rejectArray();
|
||||
|
||||
input_display_list = [
|
||||
|
@ -65,15 +65,15 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
|||
|
||||
static onInspector1Update = function() {
|
||||
current_path = "";
|
||||
outputs[| 0].setValue(noone);
|
||||
outputs[0].setValue(noone);
|
||||
}
|
||||
|
||||
function setPath(path) { inputs[| in_mesh + 0].setValue(path); }
|
||||
function setPath(path) { inputs[in_mesh + 0].setValue(path); }
|
||||
|
||||
static createNewInput = function(index = -1) { #region
|
||||
if(index == -1) index = ds_list_size(inputs);
|
||||
if(index == -1) index = array_length(inputs);
|
||||
|
||||
inputs[| index] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
inputs[index] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
} #endregion
|
||||
|
||||
|
@ -81,7 +81,7 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
|||
var index = input_fix_len + m_index;
|
||||
|
||||
input_display_list[input_display_len + m_index] = index;
|
||||
if(index < ds_list_size(inputs)) return;
|
||||
if(index < array_length(inputs)) return;
|
||||
|
||||
createNewInput(index);
|
||||
|
||||
|
@ -89,19 +89,19 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
|||
|
||||
var matY = y - (array_length(materials) - 1) / 2 * (128 + 32);
|
||||
var mat = materials[m_index];
|
||||
inputs[| index].name = materialNames[m_index] + " Material";
|
||||
inputs[index].name = materialNames[m_index] + " Material";
|
||||
|
||||
if(file_exists_empty(mat.diff_path)) {
|
||||
var sol = Node_create_Image_path(x - (w + 128), matY + m_index * (128 + 32), mat.diff_path);
|
||||
sol.name = mat.name + " texture";
|
||||
|
||||
inputs[| index].setFrom(sol.outputs[| 0]);
|
||||
inputs[index].setFrom(sol.outputs[0]);
|
||||
} else {
|
||||
var sol = nodeBuild("Node_Solid", x - (w + 128), matY + m_index * (128 + 32));
|
||||
sol.name = mat.name + " texture";
|
||||
sol.inputs[| 1].setValue(cola(mat.diff));
|
||||
sol.inputs[1].setValue(cola(mat.diff));
|
||||
|
||||
inputs[| index].setFrom(sol.outputs[| 0]);
|
||||
inputs[index].setFrom(sol.outputs[0]);
|
||||
}
|
||||
} #endregion
|
||||
|
||||
|
@ -109,8 +109,8 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
|||
if(!file_exists_empty(_path)) return;
|
||||
current_path = _path;
|
||||
|
||||
var _scale = inputs[| in_mesh + 2].getValue();
|
||||
var _axis = inputs[| in_mesh + 3].getValue();
|
||||
var _scale = inputs[in_mesh + 2].getValue();
|
||||
var _axis = inputs[in_mesh + 3].getValue();
|
||||
|
||||
readObj_init(_scale, _axis);
|
||||
|
||||
|
@ -178,8 +178,8 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
|||
array_resize(input_display_list, input_display_len);
|
||||
|
||||
var _overflow = input_fix_len + array_length(materialNames);
|
||||
while(ds_list_size(inputs) > _overflow)
|
||||
ds_list_delete(inputs, _overflow);
|
||||
while(array_length(inputs) > _overflow)
|
||||
array_delete(inputs, _overflow, 1);
|
||||
|
||||
for(var i = 0; i < array_length(materialNames); i++)
|
||||
createMaterial(i);
|
||||
|
|
|
@ -3,35 +3,35 @@ function Node_3D_Mesh_Path_Extrude(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y
|
|||
|
||||
object_class = __3dPathExtrude;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_PathNode("Path", self, noone )
|
||||
inputs[in_mesh + 0] = nodeValue_PathNode("Path", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_Int("Side", self, 8 )
|
||||
inputs[in_mesh + 1] = nodeValue_Int("Side", self, 8 )
|
||||
.setValidator(VV_min(2));
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_D3Material("Material Side", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 2] = nodeValue_D3Material("Material Side", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_D3Material("Material Cap", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 3] = nodeValue_D3Material("Material Cap", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 4] = nodeValue_Bool("Smooth", self, false );
|
||||
inputs[in_mesh + 4] = nodeValue_Bool("Smooth", self, false );
|
||||
|
||||
inputs[| in_mesh + 5] = nodeValue_Bool("End caps", self, true );
|
||||
inputs[in_mesh + 5] = nodeValue_Bool("End caps", self, true );
|
||||
|
||||
inputs[| in_mesh + 6] = nodeValue_Int("Subdivision", self, 8 )
|
||||
inputs[in_mesh + 6] = nodeValue_Int("Subdivision", self, 8 )
|
||||
.setValidator(VV_min(2));
|
||||
|
||||
inputs[| in_mesh + 7] = nodeValue_Float("Radius", self, 0.25 )
|
||||
inputs[in_mesh + 7] = nodeValue_Float("Radius", self, 0.25 )
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| in_mesh + 8] = nodeValue("Radius Over Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
inputs[in_mesh + 8] = nodeValue("Radius Over Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
|
||||
inputs[| in_mesh + 9] = nodeValue_Vector("Texture Scale", self, [ 1, 1 ] );
|
||||
inputs[in_mesh + 9] = nodeValue_Vector("Texture Scale", self, [ 1, 1 ] );
|
||||
|
||||
inputs[| in_mesh + 10] = nodeValue_Bool("Loop", self, false );
|
||||
inputs[in_mesh + 10] = nodeValue_Bool("Loop", self, false );
|
||||
|
||||
inputs[| in_mesh + 11] = nodeValue_Bool("Inverted", self, false );
|
||||
inputs[in_mesh + 11] = nodeValue_Bool("Inverted", self, false );
|
||||
|
||||
input_display_list = [
|
||||
["Path", false], in_mesh + 0, in_mesh + 10,
|
||||
|
@ -43,7 +43,7 @@ function Node_3D_Mesh_Path_Extrude(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y
|
|||
static step = function() {
|
||||
var _caps = getInputData(in_mesh + 5);
|
||||
|
||||
inputs[| in_mesh + 3].setVisible(_caps, _caps);
|
||||
inputs[in_mesh + 3].setVisible(_caps, _caps);
|
||||
}
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
|
|
|
@ -3,15 +3,15 @@ function Node_3D_Mesh_Plane(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _grou
|
|||
|
||||
object_class = __3dPlane;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 0] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_Enum_Button("Normal", self, 2 , [ "X", "Y", "Z" ]);
|
||||
inputs[in_mesh + 1] = nodeValue_Enum_Button("Normal", self, 2 , [ "X", "Y", "Z" ]);
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_Bool("Both side", self, false )
|
||||
inputs[in_mesh + 2] = nodeValue_Bool("Both side", self, false )
|
||||
.rejectArray();
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_D3Material("Back Material", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 3] = nodeValue_D3Material("Back Material", self, new __d3dMaterial())
|
||||
|
||||
input_display_list = [
|
||||
__d3d_input_list_mesh, in_mesh + 1,
|
||||
|
@ -20,9 +20,9 @@ function Node_3D_Mesh_Plane(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _grou
|
|||
]
|
||||
|
||||
static preGetInputs = function() {
|
||||
var _both = inputs[| in_mesh + 2].getValue();
|
||||
var _both = inputs[in_mesh + 2].getValue();
|
||||
|
||||
inputs[| in_mesh + 3].setVisible(_both, _both);
|
||||
inputs[in_mesh + 3].setVisible(_both, _both);
|
||||
}
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||
|
|
|
@ -3,13 +3,13 @@ function Node_3D_Mesh_Sphere_Ico(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
|||
|
||||
object_class = __3dICOSphere;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Int("Subdivision", self, 1 )
|
||||
inputs[in_mesh + 0] = nodeValue_Int("Subdivision", self, 1 )
|
||||
.setValidator(VV_min(0));
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 1] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_Bool("Smooth Normal", self, false );
|
||||
inputs[in_mesh + 2] = nodeValue_Bool("Smooth Normal", self, false );
|
||||
|
||||
input_display_list = [
|
||||
__d3d_input_list_mesh, in_mesh + 0, in_mesh + 2,
|
||||
|
|
|
@ -3,16 +3,16 @@ function Node_3D_Mesh_Sphere_UV(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _
|
|||
|
||||
object_class = __3dUVSphere;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Int("Horizontal Slices", self, 8 )
|
||||
inputs[in_mesh + 0] = nodeValue_Int("Horizontal Slices", self, 8 )
|
||||
.setValidator(VV_min(2));
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_Int("Vertical Slices", self, 16 )
|
||||
inputs[in_mesh + 1] = nodeValue_Int("Vertical Slices", self, 16 )
|
||||
.setValidator(VV_min(3));
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 2] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_Bool("Smooth Normal", self, false );
|
||||
inputs[in_mesh + 3] = nodeValue_Bool("Smooth Normal", self, false );
|
||||
|
||||
input_display_list = [
|
||||
__d3d_input_list_mesh, in_mesh + 0, in_mesh + 1, in_mesh + 3,
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
function Node_3D_Mesh_Stack_Slice(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Slice Stack";
|
||||
|
||||
inputs[| 0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
inputs[0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Output Dimension", self, [ 16, 16 ]);
|
||||
inputs[1] = nodeValue_Vector("Output Dimension", self, [ 16, 16 ]);
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Scale", self, 1);
|
||||
inputs[2] = nodeValue_Float("Scale", self, 1);
|
||||
|
||||
inputs[| 3] = nodeValue_Int("Slices", self, 4);
|
||||
inputs[3] = nodeValue_Int("Slices", self, 4);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("BBOX Padding", self, [ 0, 0, 0 ]);
|
||||
inputs[4] = nodeValue_Vector("BBOX Padding", self, [ 0, 0, 0 ]);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Outputs", self, VALUE_TYPE.surface, [])
|
||||
outputs[0] = nodeValue_Output("Outputs", self, VALUE_TYPE.surface, [])
|
||||
.setArrayDepth(1);
|
||||
|
||||
mesh_data = new Inspector_Label("", f_code);
|
||||
|
@ -208,7 +208,7 @@ function Node_3D_Mesh_Stack_Slice(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
if(_mesh == noone) return;
|
||||
if(!is_instanceof(_mesh, __3dObject)) return;
|
||||
|
||||
var _surfs = outputs[| 0].getValue();
|
||||
var _surfs = outputs[0].getValue();
|
||||
_surfs = array_verify(_surfs, slicesAmo);
|
||||
|
||||
for(var i = 0; i < slicesAmo; i++) {
|
||||
|
@ -217,7 +217,7 @@ function Node_3D_Mesh_Stack_Slice(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
}
|
||||
|
||||
surfaces = _surfs;
|
||||
outputs[| 0].setValue(_surfs);
|
||||
outputs[0].setValue(_surfs);
|
||||
|
||||
splicing = force || dimensions != params.dim || slicesAmo != params.slic;
|
||||
splice_progress = 0;
|
||||
|
|
|
@ -3,21 +3,21 @@ function Node_3D_Mesh_Terrain(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _gr
|
|||
|
||||
object_class = __3dTerrain;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 0] = nodeValue_D3Material("Material", self, new __d3dMaterial())
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_Enum_Button("Input type", self, 0 , [ "Surface", "Array" ]);
|
||||
inputs[in_mesh + 1] = nodeValue_Enum_Button("Input type", self, 0 , [ "Surface", "Array" ]);
|
||||
|
||||
inputs[| in_mesh + 2] = nodeValue_Surface("Height map", self);
|
||||
inputs[in_mesh + 2] = nodeValue_Surface("Height map", self);
|
||||
|
||||
inputs[| in_mesh + 3] = nodeValue_Int("Subdivision", self, 4 );
|
||||
inputs[in_mesh + 3] = nodeValue_Int("Subdivision", self, 4 );
|
||||
|
||||
inputs[| in_mesh + 4] = nodeValue_Float("Height array", self, [] )
|
||||
inputs[in_mesh + 4] = nodeValue_Float("Height array", self, [] )
|
||||
.setArrayDepth(2);
|
||||
|
||||
inputs[| in_mesh + 5] = nodeValue_Bool("Smooth", self, false );
|
||||
inputs[in_mesh + 5] = nodeValue_Bool("Smooth", self, false );
|
||||
|
||||
inputs[| in_mesh + 6] = nodeValue_Slider_Range("Front Height Level", self, [ 0, 1 ]);
|
||||
inputs[in_mesh + 6] = nodeValue_Slider_Range("Front Height Level", self, [ 0, 1 ]);
|
||||
|
||||
input_display_list = [
|
||||
__d3d_input_list_transform,
|
||||
|
@ -28,8 +28,8 @@ function Node_3D_Mesh_Terrain(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _gr
|
|||
static step = function() { #region
|
||||
var _inT = getInputData(in_mesh + 1);
|
||||
|
||||
inputs[| in_mesh + 2].setVisible(_inT == 0, _inT == 0);
|
||||
inputs[| in_mesh + 4].setVisible(_inT == 1, _inT == 1);
|
||||
inputs[in_mesh + 2].setVisible(_inT == 0, _inT == 0);
|
||||
inputs[in_mesh + 4].setVisible(_inT == 1, _inT == 1);
|
||||
} #endregion
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_3D_Particle(_x, _y, _group = noone) : Node_3D_Modifier(_x, _y, _gr
|
|||
name = "3D Particle";
|
||||
update_on_frame = true;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Int("Amounts", self, 1);
|
||||
inputs[in_mesh + 0] = nodeValue_Int("Amounts", self, 1);
|
||||
|
||||
part_pool_size = 128;
|
||||
parts = array_create(part_pool_size);
|
||||
|
|
|
@ -5,21 +5,21 @@ function Node_3D_Point_Affector(_x, _y, _group = noone) : Node_3D_Object(_x, _y,
|
|||
gizmo_plane = [ new __3dGizmoPlaneFalloff(,, 0.75) ];
|
||||
gizmo_object = noone;
|
||||
|
||||
inputs[| in_d3d + 0] = nodeValue_Vector("Points", self, [ 0, 0, 0 ])
|
||||
inputs[in_d3d + 0] = nodeValue_Vector("Points", self, [ 0, 0, 0 ])
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_d3d + 1] = nodeValue_Vector("Initial value", self, [ 0, 0, 0 ]);
|
||||
inputs[in_d3d + 1] = nodeValue_Vector("Initial value", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| in_d3d + 2] = nodeValue_Vector("Final value", self, [ 0, 0, 0 ]);
|
||||
inputs[in_d3d + 2] = nodeValue_Vector("Final value", self, [ 0, 0, 0 ]);
|
||||
|
||||
inputs[| in_d3d + 3] = nodeValue_Float("Falloff distance", self, 0.5);
|
||||
inputs[in_d3d + 3] = nodeValue_Float("Falloff distance", self, 0.5);
|
||||
|
||||
inputs[| in_d3d + 4] = nodeValue("Falloff curve", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_01);
|
||||
inputs[in_d3d + 4] = nodeValue("Falloff curve", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_01);
|
||||
|
||||
inputs[| in_d3d + 5] = nodeValue_Enum_Scroll("Shape", self, 0, [ new scrollItem("Sphere", s_node_3d_affector_shape, 0),
|
||||
inputs[in_d3d + 5] = nodeValue_Enum_Scroll("Shape", self, 0, [ new scrollItem("Sphere", s_node_3d_affector_shape, 0),
|
||||
new scrollItem("Plane", s_node_3d_affector_shape, 1), ]);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Output", self, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
outputs[0] = nodeValue_Output("Output", self, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
input_display_list = [
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
function Node_3D_Repeat(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor {
|
||||
name = "3D Repeat";
|
||||
|
||||
inputs[| 0] = nodeValue_D3Mesh("Objects", self, noone)
|
||||
inputs[0] = nodeValue_D3Mesh("Objects", self, noone)
|
||||
.setArrayDepth(1)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Enum_Button("Object Mode", self, 0 , [ "Duplicate", "Array" ] )
|
||||
inputs[1] = nodeValue_Enum_Button("Object Mode", self, 0 , [ "Duplicate", "Array" ] )
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 2] = nodeValue_Int("Amount", self, 1 );
|
||||
inputs[2] = nodeValue_Int("Amount", self, 1 );
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Starting Position", self, [ 0, 0, 0 ] );
|
||||
inputs[3] = nodeValue_Vector("Starting Position", self, [ 0, 0, 0 ] );
|
||||
|
||||
inputs[| 4] = nodeValue_Quaternion("Starting Rotation", self, [ 0, 0, 0, 1 ] );
|
||||
inputs[4] = nodeValue_Quaternion("Starting Rotation", self, [ 0, 0, 0, 1 ] );
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Starting Scale", self, [ 1, 1, 1 ] );
|
||||
inputs[5] = nodeValue_Vector("Starting Scale", self, [ 1, 1, 1 ] );
|
||||
|
||||
inputs[| 6] = nodeValue_Vector("Shift Position", self, [ 0, 0, 0 ] );
|
||||
inputs[6] = nodeValue_Vector("Shift Position", self, [ 0, 0, 0 ] );
|
||||
|
||||
inputs[| 7] = nodeValue_Quaternion("Shift Rotation", self, [ 0, 0, 0, 1 ] );
|
||||
inputs[7] = nodeValue_Quaternion("Shift Rotation", self, [ 0, 0, 0, 1 ] );
|
||||
|
||||
inputs[| 8] = nodeValue_Vector("Shift Scale", self, [ 0, 0, 0 ] );
|
||||
inputs[8] = nodeValue_Vector("Shift Scale", self, [ 0, 0, 0 ] );
|
||||
|
||||
inputs[| 9] = nodeValue_Float("Positions", self, [] )
|
||||
inputs[9] = nodeValue_Float("Positions", self, [] )
|
||||
.setArrayDepth(2);
|
||||
|
||||
inputs[| 10] = nodeValue_Float("Rotations", self, [] )
|
||||
inputs[10] = nodeValue_Float("Rotations", self, [] )
|
||||
.setArrayDepth(2);
|
||||
|
||||
inputs[| 11] = nodeValue_Float("Scales", self, [] )
|
||||
inputs[11] = nodeValue_Float("Scales", self, [] )
|
||||
.setArrayDepth(2);
|
||||
|
||||
inputs[| 12] = nodeValue_Bool("Use Instance", self, true )
|
||||
inputs[12] = nodeValue_Bool("Use Instance", self, true )
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Scene", self, VALUE_TYPE.d3Scene, noone);
|
||||
outputs[0] = nodeValue_Output("Scene", self, VALUE_TYPE.d3Scene, noone);
|
||||
|
||||
input_display_list = [
|
||||
["Objects", false], 0, 3, 4, 5,
|
||||
|
@ -45,9 +45,9 @@ function Node_3D_Repeat(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
static step = function() { #region
|
||||
var _mode = getSingleValue(1);
|
||||
|
||||
inputs[| 0].setArrayDepth(_mode == 1);
|
||||
inputs[0].setArrayDepth(_mode == 1);
|
||||
|
||||
inputs[| 2].setVisible(_mode == 0);
|
||||
inputs[2].setVisible(_mode == 0);
|
||||
} #endregion
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_3D_Round_Vertex(_x, _y, _group = noone) : Node_3D_Modifier(_x, _y, _group) constructor {
|
||||
name = "Discretize vertex";
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Float("Step", self, 0.1)
|
||||
inputs[in_mesh + 0] = nodeValue_Float("Step", self, 0.1)
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
var _obj = _data[0];
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
function Node_3D_Scene(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor {
|
||||
name = "3D Scene";
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Scene", self, VALUE_TYPE.d3Scene, noone);
|
||||
outputs[0] = nodeValue_Output("Scene", self, VALUE_TYPE.d3Scene, noone);
|
||||
|
||||
object_lists = [];
|
||||
|
||||
static createNewInput = function() {
|
||||
var index = ds_list_size(inputs);
|
||||
inputs[| index] = nodeValue_D3Mesh("Object", self, noone)
|
||||
var index = array_length(inputs);
|
||||
inputs[index] = nodeValue_D3Mesh("Object", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
return inputs[| index];
|
||||
return inputs[index];
|
||||
} setDynamicInput(1, true, VALUE_TYPE.d3Mesh);
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||
var _scene = new __3dGroup();
|
||||
|
||||
for( var i = input_fix_len, n = ds_list_size(inputs); i < n; i += data_length ) {
|
||||
for( var i = input_fix_len, n = array_length(inputs); i < n; i += data_length ) {
|
||||
var _obj = _data[i];
|
||||
if(is_instanceof(_obj, __3dObject) || is_instanceof(_obj, __3dGroup))
|
||||
_scene.addObject(_obj);
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
function Node_3D_Set_Material(_x, _y, _group = noone) : Node_3D_Modifier(_x, _y, _group) constructor {
|
||||
name = "Set Material";
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_D3Material("Materials", self, new __d3dMaterial())
|
||||
inputs[in_mesh + 0] = nodeValue_D3Material("Materials", self, new __d3dMaterial())
|
||||
.setVisible(true, true)
|
||||
.setArrayDepth(1);
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue_Bool("Single material", self, true)
|
||||
inputs[in_mesh + 1] = nodeValue_Bool("Single material", self, true)
|
||||
|
||||
static preGetInputs = function() { #region
|
||||
var _sing = inputs[| in_mesh + 1].getValue();
|
||||
inputs[| in_mesh + 0].setArrayDepth(_sing? 0 : 1);
|
||||
var _sing = inputs[in_mesh + 1].getValue();
|
||||
inputs[in_mesh + 0].setArrayDepth(_sing? 0 : 1);
|
||||
} #endregion
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
function Node_3D_Transform(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group) constructor {
|
||||
name = "Transform";
|
||||
|
||||
inputs[| in_d3d + 0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
inputs[in_d3d + 0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Mesh", self, VALUE_TYPE.d3Mesh, noone);
|
||||
outputs[0] = nodeValue_Output("Mesh", self, VALUE_TYPE.d3Mesh, noone);
|
||||
|
||||
input_display_list = [ in_d3d + 0,
|
||||
["Transform", false], 0, 1, 2,
|
||||
|
|
|
@ -19,7 +19,7 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
|||
projMat = matrix_build_projection_ortho(1, 1, 0.001, 10);
|
||||
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue_Surface("Surface", self)
|
||||
inputs[in_mesh + 0] = nodeValue_Surface("Surface", self)
|
||||
.setVisible(true, true);
|
||||
|
||||
input_display_list = [
|
||||
|
@ -27,14 +27,14 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
|||
__d3d_input_list_transform,
|
||||
]
|
||||
|
||||
outputs[| 0].setVisible(false);
|
||||
outputs[| 1] = nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0].setVisible(false);
|
||||
outputs[1] = nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
output_display_list = [ 1 ]
|
||||
|
||||
static onDrawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) {
|
||||
#region draw result
|
||||
var _outSurf = outputs[| 1].getValue();
|
||||
var _outSurf = outputs[1].getValue();
|
||||
if(is_array(_outSurf)) _outSurf = array_safe_get_fast(_outSurf, preview_index);
|
||||
if(!is_surface(_outSurf)) return;
|
||||
|
||||
|
@ -103,7 +103,7 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
|||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover = false, _focus = false) { #region
|
||||
if(!previewable) return;
|
||||
|
||||
var _surf = outputs[| 1].getValue();
|
||||
var _surf = outputs[1].getValue();
|
||||
if(is_array(_surf)) _surf = array_safe_get_fast(_surf, preview_index);
|
||||
if(!is_surface(_surf)) return;
|
||||
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
function Node_3D_Transform_Scene(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor {
|
||||
name = "Transform Scene";
|
||||
|
||||
inputs[| 0] = nodeValue_D3Scene("Scene", self, noone)
|
||||
inputs[0] = nodeValue_D3Scene("Scene", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Float("Position", self, [])
|
||||
inputs[1] = nodeValue_Float("Position", self, [])
|
||||
.setArrayDepth(2);
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Rotation", self, [])
|
||||
inputs[2] = nodeValue_Float("Rotation", self, [])
|
||||
.setArrayDepth(2);
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Scale", self, [])
|
||||
inputs[3] = nodeValue_Float("Scale", self, [])
|
||||
.setArrayDepth(2);
|
||||
|
||||
inputs[| 4] = nodeValue_Enum_Scroll("Positioning type", self, 0, [ "Additive", "Override" ]);
|
||||
inputs[4] = nodeValue_Enum_Scroll("Positioning type", self, 0, [ "Additive", "Override" ]);
|
||||
|
||||
inputs[| 5] = nodeValue_Enum_Scroll("Rotating type", self, 0, [ "Additive", "Override" ]);
|
||||
inputs[5] = nodeValue_Enum_Scroll("Rotating type", self, 0, [ "Additive", "Override" ]);
|
||||
|
||||
inputs[| 6] = nodeValue_Enum_Scroll("Scaling type", self, 0, [ "Additive", "Multiplicative", "Override" ]);
|
||||
inputs[6] = nodeValue_Enum_Scroll("Scaling type", self, 0, [ "Additive", "Multiplicative", "Override" ]);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Scene", self, VALUE_TYPE.d3Scene, noone);
|
||||
outputs[0] = nodeValue_Output("Scene", self, VALUE_TYPE.d3Scene, noone);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Transform", false], 1, 2, 3,
|
||||
|
@ -80,7 +80,7 @@ function Node_3D_Transform_Scene(_x, _y, _group = noone) : Node_3D(_x, _y, _grou
|
|||
} #endregion
|
||||
|
||||
static getPreviewObject = function() { #region
|
||||
var _obj = outputs[| 0].getValue();
|
||||
var _obj = outputs[0].getValue();
|
||||
if(is_array(_obj)) _obj = array_safe_get_fast(_obj, preview_index, noone);
|
||||
|
||||
return _obj;
|
||||
|
|
|
@ -2,16 +2,16 @@ function Node_3D_UV_Remap(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _grou
|
|||
name = "UV Remap";
|
||||
gizmo = new __3dGizmoPlane();
|
||||
|
||||
inputs[| in_d3d + 0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
inputs[in_d3d + 0] = nodeValue_D3Mesh("Mesh", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| in_d3d + 1] = nodeValue_Int("Target subobject", self, -1)
|
||||
inputs[in_d3d + 1] = nodeValue_Int("Target subobject", self, -1)
|
||||
.setArrayDepth(1);
|
||||
|
||||
inputs[| in_d3d + 2] = nodeValue_Int("Bake UV", self, 0)
|
||||
inputs[in_d3d + 2] = nodeValue_Int("Bake UV", self, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, { name: "Bake", onClick: function() { attributes.bakedUV = !attributes.bakedUV; triggerRender(); } });
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Mesh", self, VALUE_TYPE.d3Mesh, noone);
|
||||
outputs[0] = nodeValue_Output("Mesh", self, VALUE_TYPE.d3Mesh, noone);
|
||||
|
||||
input_display_list = [
|
||||
["Transform", false], 0, 1, 2,
|
||||
|
@ -31,7 +31,7 @@ function Node_3D_UV_Remap(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _grou
|
|||
modify_object_index = 0;
|
||||
|
||||
static step = function() { #region
|
||||
inputs[| in_d3d + 2].editWidget.text = attributes.bakedUV? "Unbake" : "Bake";
|
||||
inputs[in_d3d + 2].editWidget.text = attributes.bakedUV? "Unbake" : "Bake";
|
||||
} #endregion
|
||||
|
||||
static modify_object = function(_object, _data, _matrix) { #region
|
||||
|
|
|
@ -3,17 +3,17 @@ function Node_3DSurf(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
cached_object = [];
|
||||
object_class = dynaSurf_3d;
|
||||
|
||||
inputs[| 0] = nodeValue_D3Scene("Scene", self, noone)
|
||||
inputs[0] = nodeValue_D3Scene("Scene", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Base Dimension", self, DEF_SURF);
|
||||
inputs[1] = nodeValue_Vector("Base Dimension", self, DEF_SURF);
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Vertical Angle", self, 45 )
|
||||
inputs[2] = nodeValue_Float("Vertical Angle", self, 45 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 90, 0.1] });
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Distance", self, 4 );
|
||||
inputs[3] = nodeValue_Float("Distance", self, 4 );
|
||||
|
||||
outputs[| 0] = nodeValue_Output("3DSurf", self, VALUE_TYPE.dynaSurface, noone);
|
||||
outputs[0] = nodeValue_Output("3DSurf", self, VALUE_TYPE.dynaSurface, noone);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Camera", false], 1, 2, 3,
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Nine Slice";
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Surface in", self);
|
||||
inputs[0] = nodeValue_Surface("Surface in", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Dimension(self);
|
||||
inputs[1] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 2] = nodeValue_Padding("Splice", self, [ 0, 0, 0, 0 ])
|
||||
inputs[2] = nodeValue_Padding("Splice", self, [ 0, 0, 0, 0 ])
|
||||
.setUnitRef(function(index) { return getDimension(index); });
|
||||
|
||||
inputs[| 3] = nodeValue_Enum_Scroll("Filling modes", self, 0, [ "Scale", "Repeat" ]);
|
||||
inputs[3] = nodeValue_Enum_Scroll("Filling modes", self, 0, [ "Scale", "Repeat" ]);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
attribute_surface_depth();
|
||||
attribute_interpolation();
|
||||
|
@ -27,7 +27,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
if(is_array(s)) s = s[0];
|
||||
|
||||
if(!is_surface(s)) return;
|
||||
inputs[| 1].setValue( [ surface_get_width_safe(s), surface_get_height_safe(s) ] );
|
||||
inputs[1].setValue( [ surface_get_width_safe(s), surface_get_height_safe(s) ] );
|
||||
}
|
||||
|
||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
|
@ -63,7 +63,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
else vv = drag_sv - (_my - drag_my) / _s;
|
||||
|
||||
_splice[drag_side] = vv;
|
||||
if(inputs[| 2].setValue(_splice))
|
||||
if(inputs[2].setValue(_splice))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
|
@ -72,7 +72,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
}
|
||||
}
|
||||
|
||||
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
return;
|
||||
|
||||
if(distance_to_line_infinite(_mx, _my, sp_r, -hh, sp_r, hh) < 12) {
|
||||
|
|
|
@ -2,13 +2,13 @@ function Node_FFT(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) const
|
|||
name = "FFT";
|
||||
setDimension(96, 72);
|
||||
|
||||
inputs[| 0] = nodeValue_Float("Data", self, [])
|
||||
inputs[0] = nodeValue_Float("Data", self, [])
|
||||
.setArrayDepth(1)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Enum_Scroll("Preprocess Function", self, 0, [ "None", "Hann" ]);
|
||||
inputs[1] = nodeValue_Enum_Scroll("Preprocess Function", self, 0, [ "None", "Hann" ]);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Array", self, VALUE_TYPE.float, [])
|
||||
outputs[0] = nodeValue_Output("Array", self, VALUE_TYPE.float, [])
|
||||
.setArrayDepth(1);
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
|
|
|
@ -6,17 +6,17 @@ function Node_FLIP_Add_Rigidbody(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue("Objects", self, JUNCTION_CONNECT.input, VALUE_TYPE.rigid, [] )
|
||||
inputs[1] = nodeValue("Objects", self, JUNCTION_CONNECT.input, VALUE_TYPE.rigid, [] )
|
||||
.setVisible(true, true);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Collider", false], 1,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
|
||||
obstracle = new FLIP_Obstracle();
|
||||
index = 0;
|
||||
|
@ -30,7 +30,7 @@ function Node_FLIP_Add_Rigidbody(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
var domain = getInputData(0);
|
||||
if(!instance_exists(domain)) return;
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
|
||||
var _objects = getInputData(1);
|
||||
if(array_empty(_objects)) return;
|
||||
|
|
|
@ -22,27 +22,27 @@ function Node_FLIP_Apply_Force(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
inputs[1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
.setUnitRef(function(index) { return getDimension(); });
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Radius", self, 4 )
|
||||
inputs[2] = nodeValue_Float("Radius", self, 4 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 0.1] });
|
||||
|
||||
inputs[| 3] = nodeValue_Enum_Scroll("Shape", self, 0 , [ new scrollItem("Circle", s_node_shape_circle, 0), new scrollItem("Rectangle", s_node_shape_rectangle, 0), ]);
|
||||
inputs[3] = nodeValue_Enum_Scroll("Shape", self, 0 , [ new scrollItem("Circle", s_node_shape_circle, 0), new scrollItem("Rectangle", s_node_shape_rectangle, 0), ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Size", self, [ 4, 4 ] );
|
||||
inputs[4] = nodeValue_Vector("Size", self, [ 4, 4 ] );
|
||||
|
||||
inputs[| 5] = nodeValue_Surface("Texture", self)
|
||||
inputs[5] = nodeValue_Surface("Texture", self)
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Collider", false], 3, 2, 4,
|
||||
["Obstracle", false], 1, 5,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
|
||||
obstracle = new FLIP_Obstracle();
|
||||
index = 0;
|
||||
|
@ -81,22 +81,22 @@ function Node_FLIP_Apply_Force(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
if(_shp == 0) draw_circle(_px, _py, _r, true);
|
||||
else if(_shp == 1) draw_rectangle(_px - _w, _py - _h, _px + _w, _py + _h, true);
|
||||
|
||||
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
var _shp = getInputData(3);
|
||||
|
||||
inputs[| 2].setVisible(_shp == 0);
|
||||
inputs[| 4].setVisible(_shp == 1);
|
||||
inputs[2].setVisible(_shp == 0);
|
||||
inputs[4].setVisible(_shp == 1);
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
var domain = getInputData(0);
|
||||
if(!instance_exists(domain)) return;
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
|
||||
var _posit = getInputData(1);
|
||||
var _rad = getInputData(2);
|
||||
|
|
|
@ -6,26 +6,26 @@ function Node_FLIP_Apply_Velocity(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
inputs[1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
.setUnitRef(function(index) { return getDimension(); });
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Radius", self, 4 )
|
||||
inputs[2] = nodeValue_Float("Radius", self, 4 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 0.1] });
|
||||
|
||||
inputs[| 3] = nodeValue_Vector("Velocity", self, [ 0, 0 ] );
|
||||
inputs[3] = nodeValue_Vector("Velocity", self, [ 0, 0 ] );
|
||||
|
||||
inputs[| 4] = nodeValue_Enum_Scroll("Shape", self, 0 , [ new scrollItem("Circle", s_node_shape_circle, 0), new scrollItem("Rectangle", s_node_shape_rectangle, 0) ]);
|
||||
inputs[4] = nodeValue_Enum_Scroll("Shape", self, 0 , [ new scrollItem("Circle", s_node_shape_circle, 0), new scrollItem("Rectangle", s_node_shape_rectangle, 0) ]);
|
||||
|
||||
inputs[| 5] = nodeValue_Vector("Size", self, [ 4, 4 ] );
|
||||
inputs[5] = nodeValue_Vector("Size", self, [ 4, 4 ] );
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Velocity", false], 4, 1, 2, 5, 3,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
|
||||
static getDimension = function() {
|
||||
var domain = getInputData(0);
|
||||
|
@ -60,23 +60,23 @@ function Node_FLIP_Apply_Velocity(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
draw_line_width2(_px, _py, _vx, _vy, 6, 2);
|
||||
draw_set_alpha(1);
|
||||
|
||||
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) { hover = false; active = false; }
|
||||
//if(inputs[| 3].drawOverlay(hover, active, _px, _py, _s, _mx, _my, _snx, _sny)) { hover = false; active = false; }
|
||||
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) { hover = false; active = false; }
|
||||
//if(inputs[3].drawOverlay(hover, active, _px, _py, _s, _mx, _my, _snx, _sny)) { hover = false; active = false; }
|
||||
|
||||
} #endregion
|
||||
|
||||
static step = function() { #region
|
||||
var _shp = getInputData(4);
|
||||
|
||||
inputs[| 2].setVisible(_shp == 0);
|
||||
inputs[| 5].setVisible(_shp == 1);
|
||||
inputs[2].setVisible(_shp == 0);
|
||||
inputs[5].setVisible(_shp == 1);
|
||||
} #endregion
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) { #region
|
||||
var domain = getInputData(0);
|
||||
if(!instance_exists(domain)) return;
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
|
||||
var _posit = getInputData(1);
|
||||
var _rad = getInputData(2);
|
||||
|
|
|
@ -6,23 +6,23 @@ function Node_FLIP_Destroy(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
inputs[1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
.setUnitRef(function(index) { return getDimension(); });
|
||||
|
||||
inputs[| 2] = nodeValue_Enum_Scroll("Shape", self, 0 , [ new scrollItem("Circle", s_node_shape_circle, 0), new scrollItem("Rectangle", s_node_shape_rectangle, 0), ]);
|
||||
inputs[2] = nodeValue_Enum_Scroll("Shape", self, 0 , [ new scrollItem("Circle", s_node_shape_circle, 0), new scrollItem("Rectangle", s_node_shape_rectangle, 0), ]);
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Radius", self, 4 )
|
||||
inputs[3] = nodeValue_Float("Radius", self, 4 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 0.1] });
|
||||
|
||||
inputs[| 4] = nodeValue_Vector("Size", self, [ 4, 4 ] );
|
||||
inputs[4] = nodeValue_Vector("Size", self, [ 4, 4 ] );
|
||||
|
||||
inputs[| 5] = nodeValue_Float("Ratio", self, 1 )
|
||||
inputs[5] = nodeValue_Float("Ratio", self, 1 )
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
|
||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
||||
var _pos = getInputData(1);
|
||||
|
@ -41,22 +41,22 @@ function Node_FLIP_Destroy(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
if(_shp == 0) draw_circle(_px, _py, _r, true);
|
||||
else if(_shp == 1) draw_rectangle(_px - _w, _py - _h, _px + _w, _py + _h, true);
|
||||
|
||||
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
|
||||
} #endregion
|
||||
|
||||
static step = function() { #region
|
||||
var _shp = getInputData(2);
|
||||
|
||||
inputs[| 3].setVisible(_shp == 0);
|
||||
inputs[| 4].setVisible(_shp == 1);
|
||||
inputs[3].setVisible(_shp == 0);
|
||||
inputs[4].setVisible(_shp == 1);
|
||||
} #endregion
|
||||
|
||||
static update = function() { #region
|
||||
var domain = getInputData(0);
|
||||
if(!instance_exists(domain)) return;
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
|
||||
var _pos = getInputData(1);
|
||||
var _shp = getInputData(2);
|
||||
|
|
|
@ -7,38 +7,38 @@ function Node_FLIP_Domain(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
manual_ungroupable = false;
|
||||
update_on_frame = true;
|
||||
|
||||
inputs[| 0] = nodeValue_Dimension(self);
|
||||
inputs[0] = nodeValue_Dimension(self);
|
||||
|
||||
inputs[| 1] = nodeValue_Int("Particle Size", self, 1);
|
||||
inputs[1] = nodeValue_Int("Particle Size", self, 1);
|
||||
|
||||
inputs[| 2] = nodeValue_Int("Particle Density", self, 10);
|
||||
inputs[2] = nodeValue_Int("Particle Density", self, 10);
|
||||
|
||||
inputs[| 3] = nodeValue_Float("FLIP Ratio", self, 0.8)
|
||||
inputs[3] = nodeValue_Float("FLIP Ratio", self, 0.8)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 4] = nodeValue_Float("Resolve accelerator", self, 1.5);
|
||||
inputs[4] = nodeValue_Float("Resolve accelerator", self, 1.5);
|
||||
|
||||
inputs[| 5] = nodeValue_Int("Iteration", self, 8);
|
||||
inputs[5] = nodeValue_Int("Iteration", self, 8);
|
||||
|
||||
inputs[| 6] = nodeValue_Float("Damping", self, 0.8)
|
||||
inputs[6] = nodeValue_Float("Damping", self, 0.8)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 7] = nodeValue_Float("Gravity", self, 5);
|
||||
inputs[7] = nodeValue_Float("Gravity", self, 5);
|
||||
|
||||
inputs[| 8] = nodeValue_Float("Time Step", self, 0.05);
|
||||
inputs[8] = nodeValue_Float("Time Step", self, 0.05);
|
||||
|
||||
inputs[| 9] = nodeValue_Toggle("Wall", self, 0b1111, { data: [ "T", "B", "L", "R" ] });
|
||||
inputs[9] = nodeValue_Toggle("Wall", self, 0b1111, { data: [ "T", "B", "L", "R" ] });
|
||||
|
||||
inputs[| 10] = nodeValue_Float("Viscosity", self, 0.)
|
||||
inputs[10] = nodeValue_Float("Viscosity", self, 0.)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01 ] });
|
||||
|
||||
inputs[| 11] = nodeValue_Float("Friction", self, 0.)
|
||||
inputs[11] = nodeValue_Float("Friction", self, 0.)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 12] = nodeValue_Float("Wall Elasticity", self, 0.)
|
||||
inputs[12] = nodeValue_Float("Wall Elasticity", self, 0.)
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 2, 0.01 ] });
|
||||
|
||||
inputs[| 13] = nodeValue_Rotation("Gravity Direction", self, 0);
|
||||
inputs[13] = nodeValue_Rotation("Gravity Direction", self, 0);
|
||||
|
||||
input_display_list = [
|
||||
["Domain", false], 0, 1, 9, 12,
|
||||
|
@ -46,7 +46,7 @@ function Node_FLIP_Domain(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
["Physics", false], 7, 13, 10, 11,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone);
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone);
|
||||
|
||||
#region attributes
|
||||
array_push(attributeEditors, "FLIP Solver");
|
||||
|
@ -99,7 +99,7 @@ function Node_FLIP_Domain(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
static step = function() {
|
||||
var _col = getInputData(9);
|
||||
|
||||
inputs[| 12].setVisible(_col);
|
||||
inputs[12].setVisible(_col);
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
|
@ -158,7 +158,7 @@ function Node_FLIP_Domain(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
domain.update();
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
|
|
|
@ -11,8 +11,8 @@ function Node_FLIP_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline
|
|||
var _spawn = nodeBuild("Node_FLIP_Spawner", x + 160, y);
|
||||
var _render = nodeBuild("Node_FLIP_Render", x + 320, y);
|
||||
|
||||
_spawn.inputs[| 0].setFrom(_domain.outputs[| 0]);
|
||||
_render.inputs[| 0].setFrom(_spawn.outputs[| 0]);
|
||||
_spawn.inputs[0].setFrom(_domain.outputs[0]);
|
||||
_render.inputs[0].setFrom(_spawn.outputs[0]);
|
||||
|
||||
addNode(_domain);
|
||||
addNode(_spawn);
|
||||
|
|
|
@ -5,34 +5,34 @@ function Node_FLIP_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone)
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Float("Merge threshold", self, 0.75)
|
||||
inputs[1] = nodeValue_Float("Merge threshold", self, 0.75)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 2] = nodeValue_Range("Lifespan", self, [ 0, 0 ], { linked : true });
|
||||
inputs[2] = nodeValue_Range("Lifespan", self, [ 0, 0 ], { linked : true });
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Particle expansion", self, 20);
|
||||
inputs[3] = nodeValue_Float("Particle expansion", self, 20);
|
||||
|
||||
inputs[| 4] = nodeValue_Bool("Draw obstracles", self, true);
|
||||
inputs[4] = nodeValue_Bool("Draw obstracles", self, true);
|
||||
|
||||
inputs[| 5] = nodeValue_Surface("Fluid particle", self);
|
||||
inputs[5] = nodeValue_Surface("Fluid particle", self);
|
||||
|
||||
inputs[| 6] = nodeValue_Enum_Scroll("Render type", self, 0, [ new scrollItem("Particle", s_node_flip_render, 0),
|
||||
inputs[6] = nodeValue_Enum_Scroll("Render type", self, 0, [ new scrollItem("Particle", s_node_flip_render, 0),
|
||||
new scrollItem("Line", s_node_flip_render, 1), ] );
|
||||
|
||||
inputs[| 7] = nodeValue_Bool("Threshold", self, true);
|
||||
inputs[7] = nodeValue_Bool("Threshold", self, true);
|
||||
|
||||
inputs[| 8] = nodeValue_Bool("Additive", self, true);
|
||||
inputs[8] = nodeValue_Bool("Additive", self, true);
|
||||
|
||||
inputs[| 9] = nodeValue_Slider_Range("Alpha", self, [ 1, 1 ]);
|
||||
inputs[9] = nodeValue_Slider_Range("Alpha", self, [ 1, 1 ]);
|
||||
|
||||
inputs[| 10] = nodeValue_Int("Segments", self, 1);
|
||||
inputs[10] = nodeValue_Int("Segments", self, 1);
|
||||
|
||||
inputs[| 11] = nodeValue_Gradient("Color Over Velocity", self, new gradientObject(cola(c_white)));
|
||||
inputs[11] = nodeValue_Gradient("Color Over Velocity", self, new gradientObject(cola(c_white)));
|
||||
|
||||
inputs[| 12] = nodeValue_Range("Velocity Map", self, [ 0, 10 ]);
|
||||
inputs[12] = nodeValue_Range("Velocity Map", self, [ 0, 10 ]);
|
||||
|
||||
input_display_list = [ 0, 5,
|
||||
["Rendering", false], 6, 10, 3, 4, 9,
|
||||
|
@ -40,7 +40,7 @@ function Node_FLIP_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
["Post Processing", false], 8, 7, 1,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
seed = irandom_range(100000, 999999);
|
||||
temp_surface = [ noone ];
|
||||
|
@ -83,10 +83,10 @@ function Node_FLIP_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
var _typ = getInputData(6);
|
||||
var _thr = getInputData(7);
|
||||
|
||||
inputs[| 1].setVisible(_typ == 0 && _thr);
|
||||
inputs[| 3].setVisible(_typ == 0);
|
||||
inputs[| 5].setVisible(_typ == 0, _typ == 0);
|
||||
inputs[| 10].setVisible(_typ == 1);
|
||||
inputs[ 1].setVisible(_typ == 0 && _thr);
|
||||
inputs[ 3].setVisible(_typ == 0);
|
||||
inputs[ 5].setVisible(_typ == 0, _typ == 0);
|
||||
inputs[10].setVisible(_typ == 1);
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
|
@ -109,7 +109,7 @@ function Node_FLIP_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
var _cvl = getInputData(11);
|
||||
var _vlr = getInputData(12);
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
var _outSurf = outputs[0].getValue();
|
||||
var _maxpart = domain.maxParticles;
|
||||
var _padd = domain.particleSize;
|
||||
var _ww = domain.width - _padd * 2;
|
||||
|
@ -118,7 +118,7 @@ function Node_FLIP_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
_outSurf = surface_verify(_outSurf, _ww, _hh);
|
||||
temp_surface[0] = surface_verify(temp_surface[0], _ww, _hh);
|
||||
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
outputs[0].setValue(_outSurf);
|
||||
|
||||
var _x, _y, _px, _py, _r, _l, _a, _v, _sx, _sy;
|
||||
var _rad = domain.particleRadius * _exp;
|
||||
|
|
|
@ -6,22 +6,22 @@ function Node_FLIP_Repel(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
inputs[1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
.setUnitRef(function(index) { return getDimension(); });
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Radius", self, 4 );
|
||||
inputs[2] = nodeValue_Float("Radius", self, 4 );
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Strength", self, 4 )
|
||||
inputs[3] = nodeValue_Float("Strength", self, 4 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 16, 0.1 ] });
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Repel", false], 1, 2, 3,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
|
||||
static getDimension = function() { #region
|
||||
var domain = getInputData(0);
|
||||
|
@ -42,7 +42,7 @@ function Node_FLIP_Repel(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
draw_set_color(COLORS._main_accent);
|
||||
draw_circle_prec(_px, _py, _r, true, 32);
|
||||
|
||||
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) { hover = false; active = false; }
|
||||
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) { hover = false; active = false; }
|
||||
|
||||
} #endregion
|
||||
|
||||
|
@ -54,7 +54,7 @@ function Node_FLIP_Repel(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
var domain = getInputData(0);
|
||||
if(!instance_exists(domain)) return;
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
|
||||
var _posit = getInputData(1);
|
||||
var _rad = getInputData(2);
|
||||
|
|
|
@ -6,45 +6,45 @@ function Node_FLIP_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Enum_Scroll("Spawn Shape", self, 0 , [ new scrollItem("Circle", s_node_shape_circle, 0), new scrollItem("Rectangle", s_node_shape_rectangle, 0), "Surface" ]);
|
||||
inputs[1] = nodeValue_Enum_Scroll("Spawn Shape", self, 0 , [ new scrollItem("Circle", s_node_shape_circle, 0), new scrollItem("Rectangle", s_node_shape_rectangle, 0), "Surface" ]);
|
||||
|
||||
inputs[| 2] = nodeValue_Vector("Spawn Position", self, [ 0.5, 0.25 ] )
|
||||
inputs[2] = nodeValue_Vector("Spawn Position", self, [ 0.5, 0.25 ] )
|
||||
.setUnitRef(function(index) { return getDimension(); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 3] = nodeValue_Enum_Button("Spawn Type", self, 0 , [ "Stream", "Splash" ]);
|
||||
inputs[3] = nodeValue_Enum_Button("Spawn Type", self, 0 , [ "Stream", "Splash" ]);
|
||||
|
||||
inputs[| 4] = nodeValue_Int("Spawn Frame", self, 0 );
|
||||
inputs[4] = nodeValue_Int("Spawn Frame", self, 0 );
|
||||
|
||||
inputs[| 5] = nodeValue_Float("Spawn Amount", self, 8 );
|
||||
inputs[5] = nodeValue_Float("Spawn Amount", self, 8 );
|
||||
|
||||
inputs[| 6] = nodeValue_Range("Spawn Velocity", self, [ 0, 0 ] );
|
||||
inputs[6] = nodeValue_Range("Spawn Velocity", self, [ 0, 0 ] );
|
||||
|
||||
inputs[| 7] = nodeValue_Surface("Spawn Surface", self);
|
||||
inputs[7] = nodeValue_Surface("Spawn Surface", self);
|
||||
|
||||
inputs[| 8] = nodeValue_Float("Spawn Radius", self, 2 )
|
||||
inputs[8] = nodeValue_Float("Spawn Radius", self, 2 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 0.1] });
|
||||
|
||||
inputs[| 9] = nodeValue_Int("Seed", self, seed_random(6))
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[| 9].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
||||
inputs[9] = nodeValue_Int("Seed", self, seed_random(6))
|
||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[9].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
||||
|
||||
inputs[| 10] = nodeValue_Rotation_Random("Spawn Direction", self, [ 0, 45, 135, 0, 0 ] );
|
||||
inputs[10] = nodeValue_Rotation_Random("Spawn Direction", self, [ 0, 45, 135, 0, 0 ] );
|
||||
|
||||
inputs[| 11] = nodeValue_Float("Inherit Velocity", self, 0 )
|
||||
inputs[11] = nodeValue_Float("Inherit Velocity", self, 0 )
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 12] = nodeValue_Int("Spawn Duration", self, 1 );
|
||||
inputs[12] = nodeValue_Int("Spawn Duration", self, 1 );
|
||||
|
||||
inputs[| 13] = nodeValue_Vector("Spawn Szie", self, [ 2, 2 ] );
|
||||
inputs[13] = nodeValue_Vector("Spawn Szie", self, [ 2, 2 ] );
|
||||
|
||||
input_display_list = [ 0, 9,
|
||||
["Spawner", false], 1, 7, 8, 13, 2, 3, 4, 12, 5,
|
||||
["Physics", false], 10, 6, 11,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
|
||||
spawn_amo = 0;
|
||||
prev_position = [ 0, 0 ];
|
||||
|
@ -79,7 +79,7 @@ function Node_FLIP_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
draw_surface_ext(_surf, _px - _sw * _s / 2, _py - _sh * _s / 2, _s, _s, 0, c_white, 0.5);
|
||||
}
|
||||
|
||||
if(inputs[| 2].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[2].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
|
||||
} #endregion
|
||||
|
||||
|
@ -94,19 +94,19 @@ function Node_FLIP_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
var _shp = getInputData(1);
|
||||
var _typ = getInputData(3);
|
||||
|
||||
inputs[| 4].setVisible(_typ == 1);
|
||||
inputs[| 12].setVisible(_typ == 1);
|
||||
inputs[ 4].setVisible(_typ == 1);
|
||||
inputs[12].setVisible(_typ == 1);
|
||||
|
||||
inputs[| 7].setVisible(_shp == 2, _shp == 2);
|
||||
inputs[| 8].setVisible(_shp == 0);
|
||||
inputs[| 13].setVisible(_shp == 1);
|
||||
inputs[ 7].setVisible(_shp == 2, _shp == 2);
|
||||
inputs[ 8].setVisible(_shp == 0);
|
||||
inputs[13].setVisible(_shp == 1);
|
||||
} #endregion
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) { #region
|
||||
var domain = getInputData(0);
|
||||
if(!instance_exists(domain)) return;
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
|
||||
var _shape = getInputData(1);
|
||||
var _posit = getInputData(2);
|
||||
|
|
|
@ -6,10 +6,10 @@ function Node_FLIP_to_VFX(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone)
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Particles", self, VALUE_TYPE.particle, [] );
|
||||
outputs[0] = nodeValue_Output("Particles", self, VALUE_TYPE.particle, [] );
|
||||
|
||||
attributes.part_amount = 512;
|
||||
array_push(attributeEditors, ["Maximum particles", function() { return attributes.part_amount; },
|
||||
|
@ -25,7 +25,7 @@ function Node_FLIP_to_VFX(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
var _x, _y, _p, _px, _py, _r, _l, _a, _v, _sx, _sy;
|
||||
var _mx = min(array_length(domain.particlePos) / 2 - 1, domain.numParticles);
|
||||
var _pa = outputs[| 0].getValue();
|
||||
var _pa = outputs[0].getValue();
|
||||
var _ind = 0;
|
||||
|
||||
for( var i = 0; i < _mx; i++ ) {
|
||||
|
@ -46,7 +46,7 @@ function Node_FLIP_to_VFX(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
}
|
||||
|
||||
array_resize(_pa, _ind);
|
||||
outputs[| 0].setValue(_pa);
|
||||
outputs[0].setValue(_pa);
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
|
|
|
@ -6,26 +6,26 @@ function Node_FLIP_Update(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone)
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Bool("Update", self, true);
|
||||
inputs[1] = nodeValue_Bool("Update", self, true);
|
||||
|
||||
inputs[| 2] = nodeValue_Bool("Override timestep", self, false);
|
||||
inputs[2] = nodeValue_Bool("Override timestep", self, false);
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Timestep", self, 0.01);
|
||||
inputs[3] = nodeValue_Float("Timestep", self, 0.01);
|
||||
|
||||
input_display_list = [ 0, 1,
|
||||
["Timestep", false], 2, 3,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone);
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone);
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
var domain = getInputData(0);
|
||||
var _active = getInputData(1);
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
|
||||
if(!instance_exists(domain)) return;
|
||||
if(domain.domain == noone) return;
|
||||
|
|
|
@ -6,25 +6,25 @@ function Node_FLIP_Vortex(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
inputs[1] = nodeValue_Vector("Position", self, [ 0, 0 ] )
|
||||
.setUnitRef(function(index) { return getDimension(); });
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Radius", self, 4 );
|
||||
inputs[2] = nodeValue_Float("Radius", self, 4 );
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Strength", self, 4 )
|
||||
inputs[3] = nodeValue_Float("Strength", self, 4 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ -8, 8, 0.01 ] });
|
||||
|
||||
inputs[| 4] = nodeValue_Float("Attraction", self, 0 )
|
||||
inputs[4] = nodeValue_Float("Attraction", self, 0 )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ -8, 8, 0.01 ] });
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Vertex", false], 1, 2, 3, 4,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
|
||||
static getDimension = function() { #region
|
||||
var domain = getInputData(0);
|
||||
|
@ -45,7 +45,7 @@ function Node_FLIP_Vortex(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
draw_set_color(COLORS._main_accent);
|
||||
draw_circle_prec(_px, _py, _r, true, 32);
|
||||
|
||||
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) { hover = false; active = false; }
|
||||
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) { hover = false; active = false; }
|
||||
|
||||
} #endregion
|
||||
|
||||
|
@ -57,7 +57,7 @@ function Node_FLIP_Vortex(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
var domain = getInputData(0);
|
||||
if(!instance_exists(domain)) return;
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
|
||||
var _posit = getInputData(1);
|
||||
var _rad = getInputData(2);
|
||||
|
|
|
@ -6,21 +6,21 @@ function Node_FLIP_Wall(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
|
||||
manual_ungroupable = false;
|
||||
|
||||
inputs[| 0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
inputs[0] = nodeValue_Fdomain("Domain", self, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue_Area("Area", self, DEF_AREA , { useShape : false });
|
||||
inputs[1] = nodeValue_Area("Area", self, DEF_AREA , { useShape : false });
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Collider", false], 1
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
||||
|
||||
obstracle = new FLIP_Obstracle();
|
||||
|
||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
|
@ -28,7 +28,7 @@ function Node_FLIP_Wall(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
var _area = getInputData(1);
|
||||
if(!instance_exists(domain)) return;
|
||||
|
||||
outputs[| 0].setValue(domain);
|
||||
outputs[0].setValue(domain);
|
||||
FLIP_setSolid_rectangle(domain.domain, _area[0], _area[1], _area[2], _area[3]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
function Node_FXAA(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "FXAA";
|
||||
|
||||
inputs[| 0] = nodeValue_Surface("Surface in", self);
|
||||
inputs[0] = nodeValue_Surface("Surface in", self);
|
||||
|
||||
inputs[| 1] = nodeValue_Bool("Active", self, true);
|
||||
inputs[1] = nodeValue_Bool("Active", self, true);
|
||||
|
||||
inputs[| 2] = nodeValue_Float("Distance", self, 0.5)
|
||||
inputs[2] = nodeValue_Float("Distance", self, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
inputs[| 3] = nodeValue_Float("Mix", self, 1)
|
||||
inputs[3] = nodeValue_Float("Mix", self, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
active_index = 1;
|
||||
|
@ -18,7 +18,7 @@ function Node_FXAA(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
["Effect", false], 2, 3,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||
|
||||
attribute_surface_depth();
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
function Node_PCX_Array_Get(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
||||
name = "Array Get";
|
||||
|
||||
inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
inputs[0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
inputs[| 1] = nodeValue("Index", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
inputs[1] = nodeValue("Index", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("PCX", self, VALUE_TYPE.PCXnode, noone);
|
||||
outputs[0] = nodeValue_Output("PCX", self, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
static update = function() {
|
||||
var _arr = getInputData(0);
|
||||
var _ind = getInputData(1);
|
||||
|
||||
outputs[| 0].setValue(new __funcTree("@", _arr, _ind));
|
||||
outputs[0].setValue(new __funcTree("@", _arr, _ind));
|
||||
}
|
||||
}
|
|
@ -1,19 +1,19 @@
|
|||
function Node_PCX_Array_Set(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
||||
name = "Array Set";
|
||||
|
||||
inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
inputs[0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
inputs[| 1] = nodeValue("Index", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
inputs[1] = nodeValue("Index", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
inputs[| 2] = nodeValue("Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
inputs[2] = nodeValue("Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("PCX", self, VALUE_TYPE.PCXnode, noone);
|
||||
outputs[0] = nodeValue_Output("PCX", self, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
static update = function() {
|
||||
var _arr = getInputData(0);
|
||||
var _ind = getInputData(1);
|
||||
var _val = getInputData(2);
|
||||
|
||||
outputs[| 0].setValue(new __funcTree("=", [ _arr, _ind ], _val));
|
||||
outputs[0].setValue(new __funcTree("=", [ _arr, _ind ], _val));
|
||||
}
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
function Node_PCX_Condition(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
||||
name = "Condition";
|
||||
|
||||
inputs[| 0] = nodeValue("Condition", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
inputs[0] = nodeValue("Condition", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
inputs[| 1] = nodeValue("True", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
inputs[1] = nodeValue("True", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
inputs[| 2] = nodeValue("False", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
inputs[2] = nodeValue("False", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
outputs[| 0] = nodeValue_Output("PCX", self, VALUE_TYPE.PCXnode, noone);
|
||||
outputs[0] = nodeValue_Output("PCX", self, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
static update = function() {
|
||||
var _cond = getInputData(0);
|
||||
|
@ -19,6 +19,6 @@ function Node_PCX_Condition(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) c
|
|||
_fn.if_true = _true;
|
||||
_fn.if_false = _fals;
|
||||
|
||||
outputs[| 0].setValue(_fn);
|
||||
outputs[0].setValue(_fn);
|
||||
}
|
||||
}
|
|
@ -4,11 +4,11 @@ function Node_PCX_Equation(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) co
|
|||
setDimension(96, 48);
|
||||
ast = noone;
|
||||
|
||||
inputs[| 0] = nodeValue_Text("Equation", self, "");
|
||||
inputs[0] = nodeValue_Text("Equation", self, "");
|
||||
|
||||
outputs[| 0] = nodeValue_Output("Result", self, VALUE_TYPE.PCXnode, noone );
|
||||
outputs[0] = nodeValue_Output("Result", self, VALUE_TYPE.PCXnode, noone );
|
||||
|
||||
argument_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { #region
|
||||
argument_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) {
|
||||
argument_renderer.x = _x;
|
||||
argument_renderer.y = _y;
|
||||
argument_renderer.w = _w;
|
||||
|
@ -18,17 +18,17 @@ function Node_PCX_Equation(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) co
|
|||
var hh = ui(8);
|
||||
var _th = TEXTBOX_HEIGHT;
|
||||
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) {
|
||||
for( var i = input_fix_len; i < array_length(inputs); i += data_length ) {
|
||||
var _h = 0;
|
||||
|
||||
var _jName = inputs[| i + 0];
|
||||
var _jName = inputs[i + 0];
|
||||
_jName.editWidget.setFocusHover(_focus, _hover);
|
||||
_jName.editWidget.draw(tx, ty, ui(128), _th, _jName.showValue(), _m, _jName.display_type);
|
||||
|
||||
draw_set_text(f_p1, fa_center, fa_top, COLORS._main_text_sub);
|
||||
draw_text_add(tx + ui(128 + 12), ty + ui(6), "=");
|
||||
|
||||
var _jValue = inputs[| i + 1];
|
||||
var _jValue = inputs[i + 1];
|
||||
_jValue.editWidget.setFocusHover(_focus, _hover);
|
||||
_jValue.editWidget.draw(tx + ui(128 + 24), ty, _w - ui(128 + 24 + 16), _th, _jValue.showValue(), _m);
|
||||
|
||||
|
@ -39,7 +39,7 @@ function Node_PCX_Equation(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) co
|
|||
|
||||
argument_renderer.h = hh;
|
||||
return hh;
|
||||
}); #endregion
|
||||
});
|
||||
|
||||
|
||||
input_display_list = [
|
||||
|
@ -49,65 +49,65 @@ function Node_PCX_Equation(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) co
|
|||
]
|
||||
|
||||
static createNewInput = function() {
|
||||
var index = ds_list_size(inputs);
|
||||
inputs[| index + 0] = nodeValue_Text("Argument name", self, "" )
|
||||
var index = array_length(inputs);
|
||||
inputs[index + 0] = nodeValue_Text("Argument name", self, "" )
|
||||
.setDisplay(VALUE_DISPLAY.text_box);
|
||||
|
||||
inputs[| index + 1] = nodeValue("Argument value", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone )
|
||||
inputs[index + 1] = nodeValue("Argument value", self, JUNCTION_CONNECT.input, VALUE_TYPE.PCXnode, noone )
|
||||
.setVisible(true, true);
|
||||
inputs[| index + 1].editWidget.interactable = false;
|
||||
inputs[index + 1].editWidget.interactable = false;
|
||||
|
||||
return inputs[| index + 0];
|
||||
return inputs[index + 0];
|
||||
} setDynamicInput(2, false);
|
||||
|
||||
argument_renderer.register = function(parent = noone) { #region
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs); i++ )
|
||||
inputs[| i].editWidget.register(parent);
|
||||
} #endregion
|
||||
argument_renderer.register = function(parent = noone) {
|
||||
for( var i = input_fix_len; i < array_length(inputs); i++ )
|
||||
inputs[i].editWidget.register(parent);
|
||||
}
|
||||
|
||||
static refreshDynamicInput = function() { #region
|
||||
var _in = ds_list_create();
|
||||
static refreshDynamicInput = function() {
|
||||
var _in = [];
|
||||
|
||||
for( var i = 0; i < input_fix_len; i++ )
|
||||
ds_list_add(_in, inputs[| i]);
|
||||
array_push(_in, inputs[i]);
|
||||
|
||||
array_resize(input_display_list, input_display_len);
|
||||
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) {
|
||||
for( var i = input_fix_len; i < array_length(inputs); i += data_length ) {
|
||||
var varName = getInputData(i);
|
||||
|
||||
if(varName != "") {
|
||||
ds_list_add(_in, inputs[| i + 0]);
|
||||
ds_list_add(_in, inputs[| i + 1]);
|
||||
inputs[| i + 1].editWidget.setInteract(true);
|
||||
inputs[| i + 1].name = varName;
|
||||
array_push(_in, inputs[i + 0]);
|
||||
array_push(_in, inputs[i + 1]);
|
||||
inputs[i + 1].editWidget.setInteract(true);
|
||||
inputs[i + 1].name = varName;
|
||||
|
||||
array_push(input_display_list, i + 1);
|
||||
} else {
|
||||
delete inputs[| i + 0];
|
||||
delete inputs[| i + 1];
|
||||
delete inputs[i + 0];
|
||||
delete inputs[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
for( var i = 0; i < ds_list_size(_in); i++ )
|
||||
_in[| i].index = i;
|
||||
for( var i = 0; i < array_length(_in); i++ )
|
||||
_in[i].index = i;
|
||||
|
||||
|
||||
ds_list_destroy(inputs);
|
||||
inputs = _in;
|
||||
|
||||
createNewInput();
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onValueUpdate = function(index = 0) { #region
|
||||
static onValueUpdate = function(index = 0) {
|
||||
if(LOADING || APPENDING) return;
|
||||
|
||||
if(safe_mod(index - input_fix_len, data_length) == 0) //Variable name
|
||||
inputs[| index + 1].name = getInputData(index);
|
||||
inputs[index + 1].name = getInputData(index);
|
||||
|
||||
refreshDynamicInput();
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static update = function() { #region
|
||||
static update = function() {
|
||||
var eq = getInputData(0);
|
||||
var fn = evaluateFunctionTree(eq);
|
||||
|
||||
|
@ -121,17 +121,17 @@ function Node_PCX_Equation(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) co
|
|||
}
|
||||
|
||||
_fnL.addFunction(fn);
|
||||
outputs[| 0].setValue(fn);
|
||||
} #endregion
|
||||
outputs[0].setValue(fn);
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
draw_set_text(f_h5, fa_center, fa_center, COLORS._main_text);
|
||||
var str = getInputData(0);
|
||||
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
var ss = string_scale(str, bbox.w, bbox.h);
|
||||
draw_text_transformed(bbox.xc, bbox.yc, str, ss, ss, 0);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static doApplyDeserialize = function() { refreshDynamicInput(); }
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue