diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 6c89abaed..c92a179b0 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -259,6 +259,7 @@ {"name":"__init_background","order":4,"path":"scripts/__init_background/__init_background.yy",}, {"name":"__init_global","order":4,"path":"scripts/__init_global/__init_global.yy",}, {"name":"__initAddon","order":2,"path":"scripts/__initAddon/__initAddon.yy",}, + {"name":"__KEYS_PRIVATE","order":21,"path":"scripts/__KEYS_PRIVATE/__KEYS_PRIVATE.yy",}, {"name":"__matrix3","order":5,"path":"scripts/__matrix3/__matrix3.yy",}, {"name":"__matrix4","order":6,"path":"scripts/__matrix4/__matrix4.yy",}, {"name":"__node_3d_combine","order":1,"path":"scripts/__node_3d_combine/__node_3d_combine.yy",}, @@ -1103,7 +1104,6 @@ {"name":"safe_operation","order":6,"path":"scripts/safe_operation/safe_operation.yy",}, {"name":"sample_projects","order":6,"path":"scripts/sample_projects/sample_projects.yy",}, {"name":"save_function","order":1,"path":"scripts/save_function/save_function.yy",}, - {"name":"__KEYS_PRIVATE","order":21,"path":"scripts/__KEYS_PRIVATE/__KEYS_PRIVATE.yy",}, {"name":"scrollBox","order":2,"path":"scripts/scrollBox/scrollBox.yy",}, {"name":"scrollPane","order":3,"path":"scripts/scrollPane/scrollPane.yy",}, {"name":"shell_functions","order":20,"path":"scripts/shell_functions/shell_functions.yy",}, @@ -1158,6 +1158,7 @@ {"name":"sh_alpha_grey","order":1,"path":"shaders/sh_alpha_grey/sh_alpha_grey.yy",}, {"name":"sh_alpha_hash","order":2,"path":"shaders/sh_alpha_hash/sh_alpha_hash.yy",}, {"name":"sh_atlas","order":12,"path":"shaders/sh_atlas/sh_atlas.yy",}, + {"name":"sh_atlas_scan","order":51,"path":"shaders/sh_atlas_scan/sh_atlas_scan.yy",}, {"name":"sh_bend_arc","order":13,"path":"shaders/sh_bend_arc/sh_bend_arc.yy",}, {"name":"sh_bevel_highp","order":3,"path":"shaders/sh_bevel_highp/sh_bevel_highp.yy",}, {"name":"sh_bevel","order":2,"path":"shaders/sh_bevel/sh_bevel.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 45504cb26..9af18b4dd 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -599,6 +599,7 @@ {"id":{"name":"__init_view","path":"scripts/__init_view/__init_view.yy",},}, {"id":{"name":"__initAddon","path":"scripts/__initAddon/__initAddon.yy",},}, {"id":{"name":"__initPen","path":"scripts/__initPen/__initPen.yy",},}, + {"id":{"name":"__KEYS_PRIVATE","path":"scripts/__KEYS_PRIVATE/__KEYS_PRIVATE.yy",},}, {"id":{"name":"__matrix3","path":"scripts/__matrix3/__matrix3.yy",},}, {"id":{"name":"__matrix4","path":"scripts/__matrix4/__matrix4.yy",},}, {"id":{"name":"__mesh","path":"scripts/__mesh/__mesh.yy",},}, @@ -1580,7 +1581,6 @@ {"id":{"name":"safe_operation","path":"scripts/safe_operation/safe_operation.yy",},}, {"id":{"name":"sample_projects","path":"scripts/sample_projects/sample_projects.yy",},}, {"id":{"name":"save_function","path":"scripts/save_function/save_function.yy",},}, - {"id":{"name":"__KEYS_PRIVATE","path":"scripts/__KEYS_PRIVATE/__KEYS_PRIVATE.yy",},}, {"id":{"name":"scrollBox","path":"scripts/scrollBox/scrollBox.yy",},}, {"id":{"name":"scrollPane","path":"scripts/scrollPane/scrollPane.yy",},}, {"id":{"name":"shader_functions","path":"scripts/shader_functions/shader_functions.yy",},}, @@ -1651,6 +1651,7 @@ {"id":{"name":"sh_alpha_hash","path":"shaders/sh_alpha_hash/sh_alpha_hash.yy",},}, {"id":{"name":"sh_ani_noise","path":"shaders/sh_ani_noise/sh_ani_noise.yy",},}, {"id":{"name":"sh_atlas","path":"shaders/sh_atlas/sh_atlas.yy",},}, + {"id":{"name":"sh_atlas_scan","path":"shaders/sh_atlas_scan/sh_atlas_scan.yy",},}, {"id":{"name":"sh_average","path":"shaders/sh_average/sh_average.yy",},}, {"id":{"name":"sh_bend_arc","path":"shaders/sh_bend_arc/sh_bend_arc.yy",},}, {"id":{"name":"sh_bevel_highp","path":"shaders/sh_bevel_highp/sh_bevel_highp.yy",},}, diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index f4db2ce0a..bee4e3939 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -246,8 +246,9 @@ event_inherited(); catagory_pane = new scrollPane(category_width, dialog_h - ui(66), function(_y, _m) { #region draw_clear_alpha(COLORS._main_text, 0); - var hh = 0; - var hg = ui(28); + var ww = category_width - ui(32); + var hh = 0; + var hg = ui(28); var start = category == NODE_CATEGORY? -2 : 0; @@ -268,13 +269,19 @@ event_inherited(); } draw_set_color(COLORS._main_text_accent); } + + if(cat.color != noone) { + BLEND_OVERRIDE + draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y + hh, ww, hg, merge_color(c_white, cat.color, 0.5), 1); + BLEND_NORMAL + } } var _hov = false; - if(sHOVER && catagory_pane.hover && point_in_rectangle(_m[0], _m[1], 0, _y + hh, category_width - ui(32), _y + hh + hg - 1)) { + if(sHOVER && catagory_pane.hover && point_in_rectangle(_m[0], _m[1], 0, _y + hh, ww, _y + hh + hg - 1)) { BLEND_OVERRIDE - draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y + hh, category_width - ui(32), hg, CDEF.main_white, 1); + draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y + hh, ww, hg, CDEF.main_white, 1); BLEND_NORMAL _hov = true; diff --git a/scripts/append_function/append_function.gml b/scripts/append_function/append_function.gml index 644d598a1..014bc7883 100644 --- a/scripts/append_function/append_function.gml +++ b/scripts/append_function/append_function.gml @@ -16,7 +16,7 @@ function APPEND(_path, context = PANEL_GRAPH.getCurrentContext()) { #region return node_create; } #endregion -function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) { #region +function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext(), appended_list = ds_list_create()) { #region static log = false; UNDO_HOLDING = true; @@ -32,18 +32,19 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) { #region if(!struct_has(_map, "nodes")) return noone; var _node_list = _map.nodes; - var appended_list = ds_list_create(); var node_create = ds_list_create(); APPENDING = true; ds_queue_clear(CONNECTION_CONFLICT); - ds_map_clear(APPEND_MAP); + if(!CLONING) ds_map_clear(APPEND_MAP); var t = current_time; for(var i = 0; i < array_length(_node_list); i++) { + var ex = ds_map_exists(APPEND_MAP, _node_list[i].id); + var _node = nodeLoad(_node_list[i], true, context); - if(_node) ds_list_add(appended_list, _node); + if(_node && !ex) ds_list_add(appended_list, _node); } printIf(log, "Load time: " + string(current_time - t)); t = current_time; @@ -79,8 +80,10 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) { #region try { for(var i = 0; i < ds_list_size(appended_list); i++) appended_list[| i].preConnect(); - for(var i = 0; i < ds_list_size(appended_list); i++) + + for(var i = 0; i < ds_list_size(appended_list); i++) appended_list[| i].connect(); + for(var i = 0; i < ds_list_size(appended_list); i++) appended_list[| i].postConnect(); } catch(e) { diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 675a97be8..2d90699de 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -1,13 +1,18 @@ #region save - globalvar LOADING, APPENDING, CLONING, LOADING_VERSION; - globalvar CONNECTION_CONFLICT; + globalvar LOADING, CLONING, CLONING_GROUP; + globalvar CONNECTION_CONFLICT, LOADING_VERSION; globalvar MESSAGE; - LOADING = false; + globalvar APPENDING, APPEND_MAP, APPEND_LIST; + APPEND_MAP = ds_map_create(); + APPEND_LIST = ds_list_create(); + + LOADING = false; LOADING_VERSION = 0; - CLONING = false; - APPENDING = false; - MESSAGE = noone; + CLONING_GROUP = noone; + CLONING = false; + APPENDING = false; + MESSAGE = noone; CONNECTION_CONFLICT = ds_queue_create(); @@ -36,9 +41,6 @@ VERSION_STRING = "1.16.9.2"; BUILD_NUMBER = 11692; - globalvar APPEND_MAP; - APPEND_MAP = ds_map_create(); - globalvar HOTKEYS, HOTKEY_CONTEXT; HOTKEYS = ds_map_create(); HOTKEY_CONTEXT = ds_list_create(); diff --git a/scripts/node_atlas/node_atlas.gml b/scripts/node_atlas/node_atlas.gml index c6a3f5966..c5a3ecccc 100644 --- a/scripts/node_atlas/node_atlas.gml +++ b/scripts/node_atlas/node_atlas.gml @@ -5,19 +5,68 @@ function Node_Atlas(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con inputs[| 1] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true); active_index = 1; + + inputs[| 2] = nodeValue("Method", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Radial", "Scan" ]); outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); - input_display_list = [ 1, 0 ]; + input_display_list = [ 1, 0, 2 ]; + + temp_surface = array_create(2); attribute_surface_depth(); static processData = function(_outSurf, _data, _output_index, _array_index) { #region + var _surf = _data[0]; + var _meth = _data[2]; + var _dim = surface_get_dimension(_data[0]); - surface_set_shader(_outSurf, sh_atlas); - shader_set_f("dimension", surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])); - draw_surface_safe(_data[0]); - surface_reset_shader(); + for( var i = 0; i < 2; i++ ) temp_surface[i] = surface_verify(temp_surface[i], _dim[0], _dim[1]); + + if(_meth == 0) { + var _bg = 0; + var _itr = ceil(max(_dim[0], _dim[1]) / 64); + + surface_set_shader(temp_surface[!_bg]); + draw_surface_safe(_surf); + surface_reset_shader(); + + repeat(_itr) { + surface_set_shader(temp_surface[_bg], sh_atlas); + shader_set_f("dimension", _dim); + draw_surface(temp_surface[!_bg], 0, 0); + surface_reset_shader(); + + _bg = !_bg; + } + + surface_set_shader(_outSurf); + draw_surface_safe(temp_surface[!_bg]); + surface_reset_shader(); + + } else if(_meth == 1) { + + surface_set_shader(temp_surface[0], sh_atlas_scan); + shader_set_f("dimension", _dim); + shader_set_f("iteration", _dim[0]); + shader_set_i("axis", 0); + + draw_surface_safe(_surf); + surface_reset_shader(); + + surface_set_shader(temp_surface[1], sh_atlas_scan); + shader_set_f("dimension", _dim); + shader_set_f("iteration", _dim[1]); + shader_set_i("axis", 1); + + draw_surface_safe(temp_surface[0]); + surface_reset_shader(); + + surface_set_shader(_outSurf); + draw_surface_safe(temp_surface[1]); + surface_reset_shader(); + } return _outSurf; } #endregion diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index b47009900..743ded918 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -20,7 +20,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { #region ---- main & active ---- active = true; renderActive = true; - + node_id = UUID_generate(); group = _group; manual_deletable = true; @@ -36,6 +36,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { array_push(PROJECT.nodeArray, self); inline_context = noone; + inline_parent_object = ""; #endregion static resetInternalName = function() { #region @@ -89,6 +90,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { will_setHeight = false; selectable = true; + clonable = true; draw_padding = 4; auto_height = true; @@ -289,6 +291,12 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { messages = []; #endregion + #region ---- serialization ---- + load_scale = false; + load_map = -1; + load_group = noone; + #endregion + static createNewInput = noone; static initTooltip = function() { #region @@ -2013,8 +2021,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { static doSerialize = function(_map) {} static processSerialize = function(_map) {} - load_scale = false; - load_map = -1; static deserialize = function(_map, scale = false, preset = false) { #region >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESERIALIZE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< load_map = _map; load_scale = scale; @@ -2034,8 +2040,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { if(internalName == "") resetInternalName(); - _group = struct_try_get(load_map, "group", noone); - if(_group == -1) _group = noone; + load_group = struct_try_get(load_map, "group", noone); + if(load_group == -1) load_group = noone; x = struct_try_get(load_map, "x"); y = struct_try_get(load_map, "y"); @@ -2177,20 +2183,20 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { static doApplyDeserialize = function() {} static loadGroup = function(context = noone) { #region - if(_group == noone) { + if(load_group == noone) { if(context != noone) context.add(self); } else { - if(APPENDING) _group = GetAppendID(_group); + if(APPENDING) load_group = GetAppendID(load_group); - if(ds_map_exists(PROJECT.nodeMap, _group)) { - if(struct_has(PROJECT.nodeMap[? _group], "add")) - PROJECT.nodeMap[? _group].add(self); + if(ds_map_exists(PROJECT.nodeMap, load_group)) { + if(struct_has(PROJECT.nodeMap[? load_group], "add")) + PROJECT.nodeMap[? load_group].add(self); else { - var txt = $"Group load failed. Node ID {_group} is not a group."; + var txt = $"Group load failed. Node ID {load_group} is not a group."; throw(txt); } } else { - var txt = $"Group load failed. Can't find node ID {_group}"; + var txt = $"Group load failed. Can't find node ID {load_group}"; throw(txt); } } diff --git a/scripts/node_functions/node_functions.gml b/scripts/node_functions/node_functions.gml index 0be9adfd9..408a6d39a 100644 --- a/scripts/node_functions/node_functions.gml +++ b/scripts/node_functions/node_functions.gml @@ -148,6 +148,14 @@ var _y = _data.y; var _type = _data.type; + if(ds_map_exists(APPEND_MAP, _data.id)) { + var _node = APPEND_MAP[? _data.id]; + _node.x = _x; + _node.y = _y; + _node.deserialize(_data, scale); + return _node; + } + var _node = nodeBuild(_type, _x, _y, _group); if(_node) _node.deserialize(_data, scale); diff --git a/scripts/node_iterate_each_inline/node_iterate_each_inline.gml b/scripts/node_iterate_each_inline/node_iterate_each_inline.gml index fa705311e..2791da902 100644 --- a/scripts/node_iterate_each_inline/node_iterate_each_inline.gml +++ b/scripts/node_iterate_each_inline/node_iterate_each_inline.gml @@ -10,11 +10,11 @@ function Node_Iterate_Each_Inline(_x, _y, _group = noone) : Node_Collection_Inli output_node_type = Node_Iterator_Each_Inline_Output; iterated = 0; - if(!LOADING && !APPENDING && !CLONING) { #region + if(!LOADING && !APPENDING) { #region var input = nodeBuild("Node_Iterator_Each_Inline_Input", x, y); var output = nodeBuild("Node_Iterator_Each_Inline_Output", x + 256, y); - output.inputs[| 0].setFrom(input.outputs[| 0]); + if(!CLONING) output.inputs[| 0].setFrom(input.outputs[| 0]); addNode(input); addNode(output); @@ -24,6 +24,13 @@ function Node_Iterate_Each_Inline(_x, _y, _group = noone) : Node_Collection_Inli input_node.loop = self; output_node.loop = self; + + if(CLONING && is_instanceof(CLONING_GROUP, Node_Iterate_Each_Inline)) { + APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input; + APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output; + + ds_list_add(APPEND_LIST, input, output); + } } #endregion static getIterationCount = function() { #region diff --git a/scripts/node_iterate_filter_inline/node_iterate_filter_inline.gml b/scripts/node_iterate_filter_inline/node_iterate_filter_inline.gml index 89d6e9ae4..4d40500a5 100644 --- a/scripts/node_iterate_filter_inline/node_iterate_filter_inline.gml +++ b/scripts/node_iterate_filter_inline/node_iterate_filter_inline.gml @@ -10,11 +10,11 @@ function Node_Iterate_Filter_Inline(_x, _y, _group = noone) : Node_Collection_In output_node_type = Node_Iterator_Filter_Inline_Output; iterated = 0; - if(!LOADING && !APPENDING && !CLONING) { #region + if(!LOADING && !APPENDING) { #region var input = nodeBuild("Node_Iterator_Filter_Inline_Input", x, y); var output = nodeBuild("Node_Iterator_Filter_Inline_Output", x + 256, y); - output.inputs[| 0].setFrom(input.outputs[| 0]); + if(!CLONING) output.inputs[| 0].setFrom(input.outputs[| 0]); addNode(input); addNode(output); @@ -24,6 +24,13 @@ function Node_Iterate_Filter_Inline(_x, _y, _group = noone) : Node_Collection_In input_node.loop = self; output_node.loop = self; + + if(CLONING && is_instanceof(CLONING_GROUP, Node_Iterate_Filter_Inline)) { + APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input; + APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output; + + ds_list_add(APPEND_LIST, input, output); + } } #endregion static getIterationCount = function() { #region diff --git a/scripts/node_iterate_sort_inline/node_iterate_sort_inline.gml b/scripts/node_iterate_sort_inline/node_iterate_sort_inline.gml index 637bfada2..603504255 100644 --- a/scripts/node_iterate_sort_inline/node_iterate_sort_inline.gml +++ b/scripts/node_iterate_sort_inline/node_iterate_sort_inline.gml @@ -12,7 +12,7 @@ function Node_Iterate_Sort_Inline(_x, _y, _group = noone) : Node_Collection_Inli output_node_type = Node_Iterator_Sort_Inline_Output; iterated = 0; - if(!LOADING && !APPENDING && !CLONING) { #region + if(!LOADING && !APPENDING) { #region var input = nodeBuild("Node_Iterator_Sort_Inline_Input", x, y); var output = nodeBuild("Node_Iterator_Sort_Inline_Output", x + 256, y); @@ -24,6 +24,13 @@ function Node_Iterate_Sort_Inline(_x, _y, _group = noone) : Node_Collection_Inli input_node.loop = self; output_node.loop = self; + + if(CLONING && is_instanceof(CLONING_GROUP, Node_Iterate_Sort_Inline)) { + APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input; + APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output; + + ds_list_add(APPEND_LIST, input, output); + } } #endregion static isActiveDynamic = function(frame = CURRENT_FRAME) { #region diff --git a/scripts/node_iterator_each_inline_input/node_iterator_each_inline_input.gml b/scripts/node_iterator_each_inline_input/node_iterator_each_inline_input.gml index 526841f37..d443703f9 100644 --- a/scripts/node_iterator_each_inline_input/node_iterator_each_inline_input.gml +++ b/scripts/node_iterator_each_inline_input/node_iterator_each_inline_input.gml @@ -3,6 +3,8 @@ function Node_Iterator_Each_Inline_Input(_x, _y, _group = noone) : Node(_x, _y, color = COLORS.node_blend_loop; loop = noone; + clonable = false; + inline_parent_object = "Node_Iterate_Each_Inline"; manual_ungroupable = false; inputs[| 0] = nodeValue("Array in", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, [] ) diff --git a/scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.gml b/scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.gml index 80e33adec..85f3bea67 100644 --- a/scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.gml +++ b/scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.gml @@ -3,6 +3,8 @@ function Node_Iterator_Each_Inline_Output(_x, _y, _group = noone) : Node(_x, _y, color = COLORS.node_blend_loop; loop = noone; + clonable = false; + inline_parent_object = "Node_Iterate_Each_Inline"; manual_ungroupable = false; inputs[| 0] = nodeValue("Value out", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0 ) @@ -27,9 +29,7 @@ function Node_Iterator_Each_Inline_Output(_x, _y, _group = noone) : Node(_x, _y, var arr = outputs[| 0].getValue(); var itr = loop.iterated - 1; - arr[@ itr] = val; + array_safe_set(arr, itr, val); outputs[| 0].setValue(arr); - - //print($"Output iteration {itr} = {val} | {arr}"); } #endregion } \ No newline at end of file diff --git a/scripts/node_iterator_filter_inline_input/node_iterator_filter_inline_input.gml b/scripts/node_iterator_filter_inline_input/node_iterator_filter_inline_input.gml index 4662bcac4..392e11c58 100644 --- a/scripts/node_iterator_filter_inline_input/node_iterator_filter_inline_input.gml +++ b/scripts/node_iterator_filter_inline_input/node_iterator_filter_inline_input.gml @@ -3,6 +3,8 @@ function Node_Iterator_Filter_Inline_Input(_x, _y, _group = noone) : Node(_x, _y color = COLORS.node_blend_loop; loop = noone; + clonable = false; + inline_parent_object = "Node_Iterate_Filter_Inline"; manual_ungroupable = false; inputs[| 0] = nodeValue("Array in", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, [] ) diff --git a/scripts/node_iterator_filter_inline_output/node_iterator_filter_inline_output.gml b/scripts/node_iterator_filter_inline_output/node_iterator_filter_inline_output.gml index 2e81e502c..84c97024c 100644 --- a/scripts/node_iterator_filter_inline_output/node_iterator_filter_inline_output.gml +++ b/scripts/node_iterator_filter_inline_output/node_iterator_filter_inline_output.gml @@ -3,6 +3,8 @@ function Node_Iterator_Filter_Inline_Output(_x, _y, _group = noone) : Node(_x, _ color = COLORS.node_blend_loop; loop = noone; + clonable = false; + inline_parent_object = "Node_Iterate_Filter_Inline"; manual_ungroupable = false; inputs[| 0] = nodeValue("Value out", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0 ) diff --git a/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.gml b/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.gml index f2ca7b02d..30d12ec76 100644 --- a/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.gml +++ b/scripts/node_iterator_sort_inline_input/node_iterator_sort_inline_input.gml @@ -3,6 +3,8 @@ function Node_Iterator_Sort_Inline_Input(_x, _y, _group = noone) : Node(_x, _y, color = COLORS.node_blend_loop; loop = noone; + clonable = false; + inline_parent_object = "Node_Iterate_Sort_Inline"; manual_ungroupable = false; inputs[| 0] = nodeValue("Array in", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, [] ) diff --git a/scripts/node_iterator_sort_inline_output/node_iterator_sort_inline_output.gml b/scripts/node_iterator_sort_inline_output/node_iterator_sort_inline_output.gml index 01564001c..fac3f091b 100644 --- a/scripts/node_iterator_sort_inline_output/node_iterator_sort_inline_output.gml +++ b/scripts/node_iterator_sort_inline_output/node_iterator_sort_inline_output.gml @@ -3,6 +3,8 @@ function Node_Iterator_Sort_Inline_Output(_x, _y, _group = noone) : Node(_x, _y, color = COLORS.node_blend_loop; loop = noone; + clonable = false; + inline_parent_object = "Node_Iterate_Sort_Inline"; manual_ungroupable = false; inputs[| 0] = nodeValue("Swap", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false ) diff --git a/scripts/node_processor/node_processor.gml b/scripts/node_processor/node_processor.gml index 80bf27f45..0bfb39803 100644 --- a/scripts/node_processor/node_processor.gml +++ b/scripts/node_processor/node_processor.gml @@ -61,7 +61,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct } #endregion static getDimension = function(arr = 0) { #region - if(dimension_index == -1) return [1, 1]; + if(dimension_index == -1) return [ 1, 1 ]; var _in = getSingleValue(dimension_index, arr); @@ -332,6 +332,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct all_inputs[i][l] = inputs[| i].arrayBalance(_in[_index]); } #endregion + } #endregion static update = function(frame = CURRENT_FRAME) { #region diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index c6ee5c044..87866cdc9 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -226,6 +226,8 @@ function NodeObject(_name, _spr, _node, _create, tooltip = "", tags = []) constr global.__currPage = ""; global.__currNewPage = ""; + + #macro NODE_ADD_CAT if(!IS_CMD) addNodeCatagory #endregion function nodeBuild(_name, _x, _y, _group = PANEL_GRAPH.getCurrentContext()) { #region @@ -286,10 +288,10 @@ function __initNodes() { // NODE LIST var fav = ds_list_create(); - addNodeCatagory("Favourites", fav); + NODE_ADD_CAT("Favourites", fav); var group = ds_list_create(); #region - addNodeCatagory("Group", group, ["Node_Group"]); + NODE_ADD_CAT("Group", group, ["Node_Group"], COLORS.node_blend_collection); ds_list_add(group, "Groups"); addNodeObject(group, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent(); addNodeObject(group, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent(); @@ -297,7 +299,7 @@ function __initNodes() { #endregion var iter = ds_list_create(); #region - addNodeCatagory("Loop", iter, ["Node_Iterate"]); + NODE_ADD_CAT("Loop", iter, ["Node_Iterate"], COLORS.node_blend_loop); ds_list_add(iter, "Groups"); addNodeObject(iter, "Loop Input", s_node_loop_input, "Node_Iterator_Input", [1, Node_Iterator_Input]).hideRecent(); addNodeObject(iter, "Loop Output", s_node_loop_output, "Node_Iterator_Output", [1, Node_Iterator_Output]).hideRecent(); @@ -311,14 +313,14 @@ function __initNodes() { #endregion var iter_il = ds_list_create(); #region - addNodeCatagory("Loop", iter_il, ["Node_Iterate_Inline"]); + NODE_ADD_CAT("Loop", iter_il, ["Node_Iterate_Inline"], COLORS.node_blend_loop); ds_list_add(iter_il, "Loops"); addNodeObject(iter_il, "Index", s_node_iterator_index, "Node_Iterator_Index", [1, Node_Iterator_Index]).hideRecent(); addNodeObject(iter_il, "Loop amount", s_node_iterator_amount, "Node_Iterator_Length", [1, Node_Iterator_Length]).hideRecent(); #endregion var itere = ds_list_create(); #region - addNodeCatagory("Loop", itere, ["Node_Iterate_Each"]); + NODE_ADD_CAT("Loop", itere, ["Node_Iterate_Each"], COLORS.node_blend_loop); ds_list_add(itere, "Groups"); addNodeObject(itere, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent(); addNodeObject(itere, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent(); @@ -330,14 +332,14 @@ function __initNodes() { #endregion var itere_il = ds_list_create(); #region - addNodeCatagory("Loop", itere_il, ["Node_Iterate_Each_Inline"]); + NODE_ADD_CAT("Loop", itere_il, ["Node_Iterate_Each_Inline"], COLORS.node_blend_loop); ds_list_add(itere_il, "Loops"); addNodeObject(itere_il, "Index", s_node_iterator_index, "Node_Iterator_Index", [1, Node_Iterator_Index]).hideRecent(); addNodeObject(itere_il, "Array Length", s_node_iterator_length, "Node_Iterator_Length", [1, Node_Iterator_Length]).hideRecent(); #endregion var filter = ds_list_create(); #region - addNodeCatagory("Filter", filter, ["Node_Iterate_Filter"]); + NODE_ADD_CAT("Filter", filter, ["Node_Iterate_Filter"], COLORS.node_blend_loop); ds_list_add(filter, "Groups"); addNodeObject(filter, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent(); addNodeObject(filter, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent(); @@ -349,14 +351,14 @@ function __initNodes() { #endregion var filter_il = ds_list_create(); #region - addNodeCatagory("Filter", filter_il, ["Node_Iterate_Filter_Inline"]); + NODE_ADD_CAT("Filter", filter_il, ["Node_Iterate_Filter_Inline"], COLORS.node_blend_loop); ds_list_add(filter_il, "Loops"); addNodeObject(filter_il, "Index", s_node_iterator_index, "Node_Iterator_Index", [1, Node_Iterator_Index]).hideRecent(); addNodeObject(filter_il, "Array Length", s_node_iterator_length, "Node_Iterator_Length", [1, Node_Iterator_Length]).hideRecent(); #endregion var feed = ds_list_create(); #region - addNodeCatagory("Feedback", feed, ["Node_Feedback"]); + NODE_ADD_CAT("Feedback", feed, ["Node_Feedback"], COLORS.node_blend_feedback); ds_list_add(feed, "Groups"); addNodeObject(feed, "Input", s_node_feedback_input, "Node_Feedback_Input", [1, Node_Feedback_Input]).hideRecent(); addNodeObject(feed, "Output", s_node_feedback_output, "Node_Feedback_Output", [1, Node_Feedback_Output]).hideRecent(); @@ -364,7 +366,7 @@ function __initNodes() { #endregion var vfx = ds_list_create(); #region - addNodeCatagory("VFX", vfx, ["Node_VFX_Group", "Node_VFX_Group_Inline"]); + NODE_ADD_CAT("VFX", vfx, ["Node_VFX_Group", "Node_VFX_Group_Inline"], COLORS.node_blend_vfx); ds_list_add(vfx, "Groups"); addNodeObject(vfx, "Input", s_node_vfx_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent().hideGlobal(); addNodeObject(vfx, "Output", s_node_vfx_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent().hideGlobal(); @@ -394,7 +396,7 @@ function __initNodes() { #endregion var rigidSim = ds_list_create(); #region - addNodeCatagory("RigidSim", rigidSim, ["Node_Rigid_Group", "Node_Rigid_Group_Inline"]); + NODE_ADD_CAT("RigidSim", rigidSim, ["Node_Rigid_Group", "Node_Rigid_Group_Inline"], COLORS.node_blend_simulation); ds_list_add(rigidSim, "Group"); addNodeObject(rigidSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent().hideGlobal(); addNodeObject(rigidSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent().hideGlobal(); @@ -415,7 +417,7 @@ function __initNodes() { #endregion var smokeSim = ds_list_create(); #region - addNodeCatagory("SmokeSim", smokeSim, ["Node_Smoke_Group", "Node_Smoke_Group_Inline"]); + NODE_ADD_CAT("SmokeSim", smokeSim, ["Node_Smoke_Group", "Node_Smoke_Group_Inline"], COLORS.node_blend_smoke); ds_list_add(smokeSim, "Group"); addNodeObject(smokeSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent().hideGlobal(); addNodeObject(smokeSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent().hideGlobal(); @@ -437,7 +439,7 @@ function __initNodes() { #endregion var flipSim = ds_list_create(); #region - addNodeCatagory("FLIP Fluid", flipSim, ["Node_FLIP_Group_Inline"]); + NODE_ADD_CAT("FLIP Fluid", flipSim, ["Node_FLIP_Group_Inline"], COLORS.node_blend_fluid); ds_list_add(flipSim, "Domain"); addNodeObject(flipSim, "Domain", s_node_fluidSim_domain, "Node_FLIP_Domain", [1, Node_FLIP_Domain]).hideRecent().setVersion(11620); addNodeObject(flipSim, "Render", s_node_fluidSim_render, "Node_FLIP_Render", [1, Node_FLIP_Render]).hideRecent().setVersion(11620); @@ -459,7 +461,7 @@ function __initNodes() { #endregion var strandSim = ds_list_create(); #region - addNodeCatagory("StrandSim", strandSim, ["Node_Strand_Group", "Node_Strand_Group_Inline"]); + NODE_ADD_CAT("StrandSim", strandSim, ["Node_Strand_Group", "Node_Strand_Group_Inline"], COLORS.node_blend_strand); ds_list_add(strandSim, "Group"); addNodeObject(strandSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent().hideGlobal(); addNodeObject(strandSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent().hideGlobal(); diff --git a/scripts/node_repeat/node_repeat.gml b/scripts/node_repeat/node_repeat.gml index 81cc16e7b..62857ea06 100644 --- a/scripts/node_repeat/node_repeat.gml +++ b/scripts/node_repeat/node_repeat.gml @@ -1,19 +1,21 @@ -function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { +function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Repeat"; + dimension_index = 1; inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone ); inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF) .setDisplay(VALUE_DISPLAY.vector); - inputs[| 2] = nodeValue("Amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 2); + inputs[| 2] = nodeValue("Amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 2) + .rejectArray(); inputs[| 3] = nodeValue("Pattern", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, [ new scrollItem("Linear", s_node_repeat_axis, 0), new scrollItem("Grid", s_node_repeat_axis, 1), new scrollItem("Circular", s_node_repeat_axis, 2), ]); - inputs[| 4] = nodeValue("Shift position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [DEF_SURF_W / 2, 0]) + inputs[| 4] = nodeValue("Shift position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, 0 ]) .setDisplay(VALUE_DISPLAY.vector) .setUnitRef(function() { return getDimension(); }); @@ -46,7 +48,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor inputs[| 15] = nodeValue("Alpha over copy", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 ); - inputs[| 16] = nodeValue("Array select", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0, "Whether to select image from an array in order, at random, pr spread or each image to one output." ) + inputs[| 16] = nodeValue("Array select", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0, "Whether to select image from an array in order, at random, or spread or each image to one output." ) .setDisplay(VALUE_DISPLAY.enum_button, [ "Order", "Random", "Spread" ]); inputs[| 17] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom(99999) ); @@ -107,17 +109,17 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor attribute_surface_depth(); - static getDimension = function() { #region - var _surf = getInputData(0); - if(is_array(_surf)) { - if(array_length(_surf) == 0) return [1, 1]; - if(!is_surface(_surf[0])) return [1, 1]; - return [ surface_get_width_safe(_surf[0]), surface_get_height_safe(_surf[0]) ]; - } + //static getDimension = function() { #region + // var _surf = getInputData(0); + // if(is_array(_surf)) { + // if(array_length(_surf) == 0) return [1, 1]; + // if(!is_surface(_surf[0])) return [1, 1]; + // return [ surface_get_width_safe(_surf[0]), surface_get_height_safe(_surf[0]) ]; + // } - if(!is_surface(_surf)) return [1, 1]; - return [ surface_get_width_safe(_surf), surface_get_height_safe(_surf) ]; - } #endregion + // if(!is_surface(_surf)) return [1, 1]; + // return [ surface_get_width_safe(_surf), surface_get_height_safe(_surf) ]; + //} #endregion static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region var a = inputs[| 9].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, THEME.anchor); active &= !a; @@ -141,50 +143,64 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor var a = inputs[| 31].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, getInputData(1)); active &= !a; } #endregion - static step = function() { #region + static preGetInputs = function() { #region + var _arr = getSingleValue(16); + var _pat = getSingleValue(3); + + inputs[| 0].setArrayDepth(_arr != 2); + + inputs[| 4].setVisible( _pat == 0 || _pat == 1); + inputs[| 7].setVisible( _pat == 2); + inputs[| 8].setVisible( _pat == 2); + inputs[| 18].setVisible( _pat == 1); + inputs[| 19].setVisible( _pat == 1); + inputs[| 26].setVisible( _pat == 0); + inputs[| 14].mappableStep(); } #endregion - function doRepeat(_outSurf, _inSurf) { #region - var _dim = getInputData( 1); - var _amo = getInputData( 2); - var _pat = getInputData( 3); + static processData = function(_outSurf, _data, _output_index, _array_index) { #region + + var _iSrf = _data[ 0]; + var _dim = _data[ 1]; + var _amo = _data[ 2]; + var _pat = _data[ 3]; - var _spos = getInputData( 9); + var _spos = _data[ 9]; - var _rpos = getInputData( 4); - var _rsta = getInputData(26); - var _rrot = getInputData( 5); - var _rsca = getInputData( 6); - var _msca = getInputData(10); + var _rpos = _data[ 4]; + var _rsta = _data[26]; + var _rrot = _data[ 5]; + var _rsca = _data[ 6]; + var _msca = _data[10]; - var _aran = getInputData( 7); - var _arad = getInputData( 8); + var _aran = _data[ 7]; + var _arad = _data[ 8]; - var _path = getInputData(11); - var _prng = getInputData(12); - var _prsh = getInputData(13); + var _path = _data[11]; + var _prng = _data[12]; + var _prsh = _data[13]; - var _grad = getInputData(14); - var _grad_map = getInputData(30); - var _grad_range = getInputData(31); + var _grad = _data[14]; + var _grad_map = _data[30]; + var _grad_range = _data[31]; - var _arr = getInputData(16); - var _sed = getInputData(17); + var _arr = _data[16]; + var _sed = _data[17]; - var _col = getInputData(18); - var _cls = getInputData(19); + var _col = _data[18]; + var _cls = _data[19]; - var _an_use = getInputData(29); + var _an_use = _data[29]; - var _an_mid = getInputData(20); - var _an_ran = getInputData(21); - var _an_fal = getInputData(25); - var _an_pos = getInputData(22); - var _an_rot = getInputData(23); - var _an_sca = getInputData(24); + var _an_mid = _data[20]; + var _an_ran = _data[21]; + var _an_fal = _data[25]; + var _an_pos = _data[22]; + var _an_rot = _data[23]; + var _an_sca = _data[24]; - var _an_bld = getInputData(27); + var _an_bld = _data[27]; var _an_alp = _color_get_alpha(_an_bld); var _surf, runx, runy, posx, posy, scax, scay, rot; @@ -240,10 +256,18 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor scay += _an_sca[1] * _inf; } - var _surf = _inSurf; + var _surf = _iSrf; - if(is_array(_inSurf)) - _surf = array_safe_get_fast(_inSurf, _arr? irandom(array_length(_inSurf) - 1) : safe_mod(i, array_length(_inSurf))); + if(is_array(_iSrf)) { + var _sid = 0; + + if(_arr == 0) _sid = safe_mod(i, array_length(_iSrf)); + else if(_arr == 1) _sid = irandom(array_length(_iSrf) - 1); + + _surf = array_safe_get_fast(_iSrf, _sid); + } + + if(!is_surface(_surf)) continue; var _sw = surface_get_width_safe(_surf); var _sh = surface_get_height_safe(_surf); @@ -277,46 +301,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor if(_rsta == 2) runy += _sh / 2; } surface_reset_target(); - } #endregion - - static update = function(frame = CURRENT_FRAME) { #region - var _inSurf = getInputData(0); - if(is_array(_inSurf) && array_length(_inSurf) == 0) return; - if(!is_array(_inSurf) && !is_surface(_inSurf)) return; - - var _dim = getInputData(1); - var _pat = getInputData(3); - var cDep = attrDepth(); - var _arr = getInputData(16); - - inputs[| 4].setVisible( _pat == 0 || _pat == 1); - inputs[| 7].setVisible( _pat == 2); - inputs[| 8].setVisible( _pat == 2); - inputs[| 18].setVisible( _pat == 1); - inputs[| 19].setVisible( _pat == 1); - inputs[| 26].setVisible( _pat == 0); - - var runx, runy, posx, posy, scax, scay, rot; - var _outSurf = outputs[| 0].getValue(); - - if(is_array(_inSurf) && _arr == 2) { - if(!is_array(_outSurf)) surface_free(_outSurf); - else { - for( var i = 0, n = array_length(_outSurf); i < n; i++ ) - surface_free(_outSurf[i]); - } - - for( var i = 0, n = array_length(_inSurf); i < n; i++ ) { - var _out = surface_create(_dim[0], _dim[1], cDep); - _outSurf[i] = _out; - doRepeat(_out, _inSurf[i]); - } - } else { - _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], cDep); - doRepeat(_outSurf, _inSurf); - } - - outputs[| 0].setValue(_outSurf); + return _outSurf; } #endregion } \ No newline at end of file diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 7e82728a1..e00694c5d 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -614,6 +614,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru #region ---- value ---- def_val = _value; def_length = is_array(def_val)? array_length(def_val) : 0; + def_depth = array_get_depth(def_val); unit = new nodeValueUnit(self); def_unit = VALUE_UNIT.constant; dyna_depo = ds_list_create(); @@ -1592,6 +1593,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } var val = _getValue(_time, applyUnit, arrIndex, log); + if(!accept_array && array_get_depth(val) > def_depth) { + noti_warning($"{name} does not accept array data.",, node); + return 0; + } draw_junction_index = type; if(type == VALUE_TYPE.surface || type == VALUE_TYPE.any) { @@ -1645,7 +1650,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return animator.getValue(_time); } #endregion - static arrayBalance = function(val) { #region //Balance array (generate uniform array from single values) + static arrayBalance = function(val) { #region // Balance array (generate uniform array from single values) if(!is_array(def_val)) return val; @@ -1657,12 +1662,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(!is_array(val)) return array_create(def_length, val); - else if(array_length(val) < def_length) { - var _val = array_create(def_length); - for( var i = 0; i < def_length; i++ ) - _val[i] = array_safe_get_fast(val, i, 0); - return _val; - } + + if(array_length(val) < def_length) + array_resize(val, def_length); return val; } #endregion @@ -1689,7 +1691,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } #endregion - if(typ == VALUE_TYPE.surface && (type == VALUE_TYPE.integer || type == VALUE_TYPE.float) && accept_array) { #region Dimension conversion + if(typ == VALUE_TYPE.surface && (type == VALUE_TYPE.integer || type == VALUE_TYPE.float)) { #region Dimension conversion if(is_array(val)) { var eqSize = true; var sArr = []; @@ -1711,7 +1713,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return sArr; } else if (is_surface(val)) return [ surface_get_width_safe(val), surface_get_height_safe(val) ]; - return [1, 1]; + return [ 1, 1 ]; } #endregion @@ -2651,6 +2653,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } #endregion static connect = function(log = false) { #region + //print($"{node} | {con_node} : {con_index}"); + if(con_node == -1 || con_index == -1) return true; diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 389dd9c6e..eb95742f4 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1310,7 +1310,10 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { for(var i = 0; i < ds_list_size(nodes_list); i++) { var _node = nodes_list[| i]; + + if(!_node.selectable) continue; if(is_instanceof(_node, Node_Frame) && !nodes_select_frame) continue; + var _x = (_node.x + graph_x) * graph_s; var _y = (_node.y + graph_y) * graph_s; var _w = _node.w * graph_s; @@ -1344,7 +1347,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } if(mouse_on_graph && !node_bg_hovering && mouse_press(mb_left, pFOCUS) && !graph_dragging_key && !graph_zooming_key) { - if(junction_hovering && junction_hovering.draw_line_shift_hover) { + if(is_instanceof(junction_hovering, NodeValue) && junction_hovering.draw_line_shift_hover) { nodes_select_mx = mx; nodes_select_my = my; nodes_junction_d = junction_hovering; @@ -1872,47 +1875,69 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { if(array_empty(nodes_selecting)) return; var _map = {}; + var _pmap = {}; var _node = []; - for(var i = 0; i < array_length(nodes_selecting); i++) - SAVE_NODE(_node, nodes_selecting[i],,,, getCurrentContext()); + + for(var i = 0; i < array_length(nodes_selecting); i++) { + var _n = nodes_selecting[i]; + + if(_n.inline_parent_object != "") + _pmap[$ _n.inline_context.node_id] = _n.inline_parent_object; + + SAVE_NODE(_node, _n,,,, getCurrentContext()); + } + _map.nodes = _node; - APPENDING = true; - CLONING = true; - var _app = __APPEND_MAP(_map); - recordAction(ACTION_TYPE.collection_loaded, array_create_from_list(_app)); + ds_map_clear(APPEND_MAP); + ds_list_clear(APPEND_LIST); - APPENDING = false; - CLONING = false; + CLONING = true; + var _pmap_keys = variable_struct_get_names(_pmap); + for( var i = 0, n = array_length(_pmap_keys); i < n; i++ ) { + var _pkey = _pmap_keys[i]; + var _original = PROJECT.nodeMap[? _pkey]; + var _nodeS = _pmap[$ _pkey]; + + CLONING_GROUP = _original; + var _newGroup = nodeBuild(_nodeS, _original.x, _original.y); + APPEND_MAP[? _pkey] = _newGroup; + } + + APPEND_LIST = __APPEND_MAP(_map,, APPEND_LIST); + recordAction(ACTION_TYPE.collection_loaded, array_create_from_list(APPEND_LIST)); + CLONING = false; - if(ds_list_size(_app) == 0) { - ds_list_destroy(_app); - return; - } + if(ds_list_size(APPEND_LIST) == 0) return; for(var i = 0; i < array_length(nodes_selecting); i++) { var _orignal = nodes_selecting[i]; - var _cloned = ds_map_try_get(APPEND_MAP, _orignal.node_id, ""); + if(!_orignal.clonable) continue; - if(_orignal.inline_context != noone && _cloned != "") - _orignal.inline_context.addNode(PROJECT.nodeMap[? _cloned]); + var _cloned = ds_map_try_get(APPEND_MAP, _orignal.node_id, ""); + var _inline_ctx = _orignal.inline_context; + + if(_inline_ctx != noone && _cloned != "") { + _inline_ctx = ds_map_try_get(APPEND_MAP, _inline_ctx.node_id, _inline_ctx); + _inline_ctx.addNode(PROJECT.nodeMap[? _cloned]); + } } var x0 = 99999999; var y0 = 99999999; - for(var i = 0; i < ds_list_size(_app); i++) { - var _node = _app[| i]; + for(var i = 0; i < ds_list_size(APPEND_LIST); i++) { + var _node = APPEND_LIST[| i]; x0 = min(x0, _node.x); y0 = min(y0, _node.y); } - node_dragging = _app[| 0]; + node_dragging = APPEND_LIST[| 0]; node_drag_mx = x0; node_drag_my = y0; node_drag_sx = x0; node_drag_sy = y0; node_drag_ox = x0; node_drag_oy = y0; - nodes_selecting = array_create_from_list(_app); + nodes_selecting = array_create_from_list(APPEND_LIST); } #endregion function doInstance() { #region diff --git a/scripts/panel_notification/panel_notification.gml b/scripts/panel_notification/panel_notification.gml index f67b44053..e6b860e65 100644 --- a/scripts/panel_notification/panel_notification.gml +++ b/scripts/panel_notification/panel_notification.gml @@ -123,7 +123,7 @@ function Panel_Notification() : PanelContent() constructor { var bh = ui(28); var bx = _w - ui(0) - bw; - var by = yy + ui(0) + ui(2); + var by = yy + ui(0) + ui(1); draw_sprite_stretched_ext(THEME.group_label, 0, bx, by, bw, bh, COLORS._main_icon_dark, 0.75); diff --git a/shaders/sh_atlas/sh_atlas.fsh b/shaders/sh_atlas/sh_atlas.fsh index a3ebdf0f3..2f3a4c0d5 100644 --- a/shaders/sh_atlas/sh_atlas.fsh +++ b/shaders/sh_atlas/sh_atlas.fsh @@ -1,28 +1,23 @@ -// -// Simple passthrough fragment shader -// varying vec2 v_vTexcoord; varying vec4 v_vColour; uniform vec2 dimension; #define TAU 6.283185307179586 -#define angle_sample 4. #define distance_sample 64. void main() { - vec2 pixelPosition = v_vTexcoord * dimension; + vec2 tx = 1. / dimension; vec4 col = texture2D( gm_BaseTexture, v_vTexcoord ); - vec2 scale = dimension / distance_sample; - float min_dist = 1.; gl_FragColor = col; - if(col.a == 1.) + if(col.a == 1.) return; for(float i = 1.; i <= distance_sample; i++) { float base = 1.; float top = 0.; + for(float j = 0.; j <= 64.; j++) { float ang = top / base * TAU; top += 2.; @@ -31,7 +26,7 @@ void main() { base *= 2.; } - vec2 pxs = (pixelPosition + vec2( cos(ang), sin(ang)) * scale * i) / dimension; + vec2 pxs = v_vTexcoord + vec2( cos(ang), sin(ang)) * i * tx; vec4 sam = texture2D( gm_BaseTexture, pxs ); if(sam.a < 1.) continue; diff --git a/shaders/sh_atlas_scan/sh_atlas_scan.fsh b/shaders/sh_atlas_scan/sh_atlas_scan.fsh new file mode 100644 index 000000000..83219e872 --- /dev/null +++ b/shaders/sh_atlas_scan/sh_atlas_scan.fsh @@ -0,0 +1,48 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 dimension; +uniform int axis; +uniform float iteration; + +void main() { + vec2 tx = 1. / dimension; + vec4 col = texture2D( gm_BaseTexture, v_vTexcoord ); + gl_FragColor = col; + + if(col.a > 0.) + return; + + float _min, _cmp; + vec2 _str, _axs; + + if(axis == 0) { + _min = dimension.x; + _cmp = _min * v_vTexcoord.x; + + _str = vec2(0., v_vTexcoord.y); + _axs = vec2(tx.x, 0.); + + } else { + _min = dimension.y; + _cmp = _min * v_vTexcoord.y; + + _str = vec2(v_vTexcoord.x, 0.); + _axs = vec2(0., tx.y); + + } + + for(float i = 1.; i < 2048.; i++) { + if(i > iteration) break; + + vec2 sx = _str + _axs * i; + vec4 ss = texture2D( gm_BaseTexture, sx); + + if(ss.a > 0. && abs(i - _cmp) < _min) { + _min = abs(i - _cmp); + col = ss; + } + } + + gl_FragColor = col; +} diff --git a/shaders/sh_atlas_scan/sh_atlas_scan.vsh b/shaders/sh_atlas_scan/sh_atlas_scan.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_atlas_scan/sh_atlas_scan.vsh @@ -0,0 +1,19 @@ +// +// Simple passthrough vertex shader +// +attribute vec3 in_Position; // (x,y,z) +//attribute vec3 in_Normal; // (x,y,z) unused in this shader. +attribute vec4 in_Colour; // (r,g,b,a) +attribute vec2 in_TextureCoord; // (u,v) + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} diff --git a/shaders/sh_atlas_scan/sh_atlas_scan.yy b/shaders/sh_atlas_scan/sh_atlas_scan.yy new file mode 100644 index 000000000..86d865132 --- /dev/null +++ b/shaders/sh_atlas_scan/sh_atlas_scan.yy @@ -0,0 +1,12 @@ +{ + "$GMShader":"", + "%Name":"sh_atlas_scan", + "name":"sh_atlas_scan", + "parent":{ + "name":"filter", + "path":"folders/shader/filter.yy", + }, + "resourceType":"GMShader", + "resourceVersion":"2.0", + "type":1, +} \ No newline at end of file