diff --git a/scripts/node_3d_mesh_obj/node_3d_mesh_obj.gml b/scripts/node_3d_mesh_obj/node_3d_mesh_obj.gml index 9abb4ecfd..b0d17153e 100644 --- a/scripts/node_3d_mesh_obj/node_3d_mesh_obj.gml +++ b/scripts/node_3d_mesh_obj/node_3d_mesh_obj.gml @@ -1,6 +1,6 @@ function Node_create_3D_Obj(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("3d object|*.obj", ""); key_release(); if(path == "") return noone; diff --git a/scripts/node_FLIP_group_inline/node_FLIP_group_inline.gml b/scripts/node_FLIP_group_inline/node_FLIP_group_inline.gml index 0ab3a1c23..39b885527 100644 --- a/scripts/node_FLIP_group_inline/node_FLIP_group_inline.gml +++ b/scripts/node_FLIP_group_inline/node_FLIP_group_inline.gml @@ -6,7 +6,7 @@ function Node_FLIP_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline is_simulation = true; update_on_frame = true; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { var _domain = nodeBuild("Node_FLIP_Domain", x, y); var _spawn = nodeBuild("Node_FLIP_Spawner", x + 160, y); var _render = nodeBuild("Node_FLIP_Render", x + 320, y); diff --git a/scripts/node_VFX_group/node_VFX_group.gml b/scripts/node_VFX_group/node_VFX_group.gml index bd85ded09..1683faa2d 100644 --- a/scripts/node_VFX_group/node_VFX_group.gml +++ b/scripts/node_VFX_group/node_VFX_group.gml @@ -20,7 +20,7 @@ function Node_VFX_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _group custom_input_index = ds_list_size(inputs); - if(!LOADING && !APPENDING && !CLONING) { #region + if(NODE_NEW_MANUAL) { #region var input = nodeBuild("Node_VFX_Spawner", -256, -32, self); var output = nodeBuild("Node_VFX_Renderer_Output", 256 + 32 * 5, -32, self); diff --git a/scripts/node_VFX_group_inline/node_VFX_group_inline.gml b/scripts/node_VFX_group_inline/node_VFX_group_inline.gml index 0abbf7ade..0b2929f9e 100644 --- a/scripts/node_VFX_group_inline/node_VFX_group_inline.gml +++ b/scripts/node_VFX_group_inline/node_VFX_group_inline.gml @@ -15,7 +15,7 @@ function Node_VFX_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline( prev_nodes = []; - if(!LOADING && !APPENDING && !CLONING) { #region + if(NODE_NEW_MANUAL) { #region var input = nodeBuild("Node_VFX_Spawner", x, y); var output = nodeBuild("Node_VFX_Renderer", x + 256, y); diff --git a/scripts/node_ase_file_read/node_ase_file_read.gml b/scripts/node_ase_file_read/node_ase_file_read.gml index b030ebe9d..b03159811 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -1,6 +1,6 @@ function Node_create_ASE_File_Read(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("Aseprite file (*.aseprite, *.ase)|*.aseprite;*.ase", ""); key_release(); if(path == "") return noone; @@ -8,7 +8,7 @@ function Node_create_ASE_File_Read(_x, _y, _group = noone) { #region var node = new Node_ASE_File_Read(_x, _y, _group); node.inputs[| 0].setValue(path); - node.doUpdate(); + if(NODE_NEW_MANUAL) node.doUpdate(); return node; } #endregion diff --git a/scripts/node_csv_file_read/node_csv_file_read.gml b/scripts/node_csv_file_read/node_csv_file_read.gml index b043a27e2..c1db97812 100644 --- a/scripts/node_csv_file_read/node_csv_file_read.gml +++ b/scripts/node_csv_file_read/node_csv_file_read.gml @@ -1,6 +1,6 @@ function Node_create_CSV_File_Read(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("comma separated value|*.csv", ""); key_release(); if(path == "") return noone; diff --git a/scripts/node_display_image/node_display_image.gml b/scripts/node_display_image/node_display_image.gml index 357f72511..92c262d0a 100644 --- a/scripts/node_display_image/node_display_image.gml +++ b/scripts/node_display_image/node_display_image.gml @@ -1,6 +1,6 @@ function Node_create_Display_Image(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("image|*.png;*.jpg", ""); key_release(); if(path == "") return noone; diff --git a/scripts/node_dynasurf/node_dynasurf.gml b/scripts/node_dynasurf/node_dynasurf.gml index 5806c9b72..7c0c7c063 100644 --- a/scripts/node_dynasurf/node_dynasurf.gml +++ b/scripts/node_dynasurf/node_dynasurf.gml @@ -10,7 +10,7 @@ function Node_DynaSurf(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) custom_input_index = ds_list_size(inputs); custom_output_index = ds_list_size(outputs); - if(!LOADING && !APPENDING && !CLONING) { #region + if(NODE_NEW_MANUAL) { #region var _input = nodeBuild("Node_DynaSurf_In", -256, -32, self); var _output = nodeBuild("Node_DynaSurf_Out", 256, -32, self); diff --git a/scripts/node_export/node_export.gml b/scripts/node_export/node_export.gml index a8f49c47f..52c8a2e7a 100644 --- a/scripts/node_export/node_export.gml +++ b/scripts/node_export/node_export.gml @@ -1,6 +1,6 @@ function Node_create_Export(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_save_filename(@"Portable Network Graphics (.png)|*.png| Joint Photographic Experts Group (.jpg)|*.jpg| Graphics Interchange Format (.gif)|*.gif| @@ -13,9 +13,8 @@ MPEG-4 (.mp4)|*.mp4", var node = new Node_Export(_x, _y, _group); node.inputs[| 1].setValue(path); - node.extensionCheck(); + if(NODE_NEW_MANUAL) node.extensionCheck(); - //ds_list_add(PANEL_GRAPH.nodes_list, node); return node; } diff --git a/scripts/node_feedback/node_feedback.gml b/scripts/node_feedback/node_feedback.gml index 6785a32f4..72735783f 100644 --- a/scripts/node_feedback/node_feedback.gml +++ b/scripts/node_feedback/node_feedback.gml @@ -6,7 +6,7 @@ function Node_Feedback(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) update_on_frame = true; reset_all_child = true; - if(!LOADING && !APPENDING && !CLONING) { #region + if(NODE_NEW_MANUAL) { #region var input = nodeBuild("Node_Feedback_Input", -256, -32, self); var output = nodeBuild("Node_Feedback_Output", 256, -32, self); diff --git a/scripts/node_flood_fill/node_flood_fill.gml b/scripts/node_flood_fill/node_flood_fill.gml index 93ef7e921..9751b878d 100644 --- a/scripts/node_flood_fill/node_flood_fill.gml +++ b/scripts/node_flood_fill/node_flood_fill.gml @@ -1,8 +1,7 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Flood Fill"; - inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone) - .rejectArray(); + inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); inputs[| 1] = nodeValue("Mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); diff --git a/scripts/node_functions/node_functions.gml b/scripts/node_functions/node_functions.gml index 46e888f17..31e8e3fe4 100644 --- a/scripts/node_functions/node_functions.gml +++ b/scripts/node_functions/node_functions.gml @@ -3,6 +3,7 @@ #macro DEF_SURF PROJECT.attributes.surface_dimension #macro DEF_PALETTE PROJECT.attributes.palette +#macro NODE_NEW_MANUAL !LOADING && !APPENDING && !CLONING #region function node_draw_transform_init() { diff --git a/scripts/node_image/node_image.gml b/scripts/node_image/node_image.gml index 8393e5411..71cac01b5 100644 --- a/scripts/node_image/node_image.gml +++ b/scripts/node_image/node_image.gml @@ -1,6 +1,6 @@ function Node_create_Image(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("image|*.png;*.jpg", ""); key_release(); if(path == "") return noone; @@ -8,7 +8,7 @@ function Node_create_Image(_x, _y, _group = noone) { #region var node = new Node_Image(_x, _y, _group); node.inputs[| 0].setValue(path); - if(path != "") node.doUpdate(); + if(NODE_NEW_MANUAL) node.doUpdate(); return node; } #endregion diff --git a/scripts/node_image_animated/node_image_animated.gml b/scripts/node_image_animated/node_image_animated.gml index cd871b4fe..6ed906c64 100644 --- a/scripts/node_image_animated/node_image_animated.gml +++ b/scripts/node_image_animated/node_image_animated.gml @@ -1,6 +1,6 @@ function Node_create_Image_Animated(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filenames_compat("image|*.png;*.jpg", ""); key_release(); if(path == "") return noone; @@ -9,7 +9,7 @@ function Node_create_Image_Animated(_x, _y, _group = noone) { #region var node = new Node_Image_Animated(_x, _y, _group); var paths = string_splice(path, "\n"); node.inputs[| 0].setValue(paths); - node.doUpdate(); + if(NODE_NEW_MANUAL) node.doUpdate(); return node; } #endregion diff --git a/scripts/node_image_gif/node_image_gif.gml b/scripts/node_image_gif/node_image_gif.gml index b7bb0fa87..8da139098 100644 --- a/scripts/node_image_gif/node_image_gif.gml +++ b/scripts/node_image_gif/node_image_gif.gml @@ -1,6 +1,6 @@ function Node_create_Image_gif(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("animated gif|*.gif", ""); key_release(); if(path == "") return noone; @@ -8,7 +8,7 @@ function Node_create_Image_gif(_x, _y, _group = noone) { #region var node = new Node_Image_gif(_x, _y, _group); node.inputs[| 0].setValue(path); - node.doUpdate(); + if(NODE_NEW_MANUAL) node.doUpdate(); return node; } #endregion diff --git a/scripts/node_image_sequence/node_image_sequence.gml b/scripts/node_image_sequence/node_image_sequence.gml index a8416adad..5ba3f0b28 100644 --- a/scripts/node_image_sequence/node_image_sequence.gml +++ b/scripts/node_image_sequence/node_image_sequence.gml @@ -1,6 +1,6 @@ function Node_create_Image_Sequence(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filenames_compat("image|*.png;*.jpg", ""); key_release(); if(path == "") return noone; @@ -9,7 +9,8 @@ function Node_create_Image_Sequence(_x, _y, _group = noone) { #region var node = new Node_Image_Sequence(_x, _y, _group); var paths = string_splice(path, "\n"); node.inputs[| 0].setValue(paths); - node.doUpdate(); + if(NODE_NEW_MANUAL) node.doUpdate(); + return node; } #endregion diff --git a/scripts/node_iterate/node_iterate.gml b/scripts/node_iterate/node_iterate.gml index e8f459b9d..32a128a7f 100644 --- a/scripts/node_iterate/node_iterate.gml +++ b/scripts/node_iterate/node_iterate.gml @@ -6,7 +6,7 @@ function Node_Iterate(_x, _y, _group = noone) : Node_Iterator(_x, _y, _group) co custom_input_index = ds_list_size(inputs); - if(!LOADING && !APPENDING && !CLONING) { #region + if(NODE_NEW_MANUAL) { #region var input = nodeBuild("Node_Iterator_Input", -256, -32, self); var output = nodeBuild("Node_Iterator_Output", 256, -32, self); diff --git a/scripts/node_iterate_each/node_iterate_each.gml b/scripts/node_iterate_each/node_iterate_each.gml index fdc021eea..a55e72dda 100644 --- a/scripts/node_iterate_each/node_iterate_each.gml +++ b/scripts/node_iterate_each/node_iterate_each.gml @@ -9,7 +9,7 @@ function Node_Iterate_Each(_x, _y, _group = noone) : Node_Iterator(_x, _y, _grou custom_input_index = ds_list_size(inputs); custom_output_index = ds_list_size(inputs); - if(!LOADING && !APPENDING && !CLONING) { #region + if(NODE_NEW_MANUAL) { #region var input = nodeBuild("Node_Iterator_Each_Input", -256, -32, self); var output = nodeBuild("Node_Iterator_Each_Output", 256, -32, self); diff --git a/scripts/node_iterate_filter/node_iterate_filter.gml b/scripts/node_iterate_filter/node_iterate_filter.gml index 10a9ba4ab..ef0086dfb 100644 --- a/scripts/node_iterate_filter/node_iterate_filter.gml +++ b/scripts/node_iterate_filter/node_iterate_filter.gml @@ -9,7 +9,7 @@ function Node_Iterate_Filter(_x, _y, _group = noone) : Node_Iterator(_x, _y, _gr custom_input_index = ds_list_size(inputs); custom_output_index = ds_list_size(inputs); - if(!LOADING && !APPENDING && !CLONING) { #region + if(NODE_NEW_MANUAL) { #region var input = nodeBuild("Node_Iterator_Filter_Input", -256, -32, self); var output = nodeBuild("Node_Iterator_Filter_Output", 256, -32, self); diff --git a/scripts/node_iterate_sort/node_iterate_sort.gml b/scripts/node_iterate_sort/node_iterate_sort.gml index 78f33ad03..551854d62 100644 --- a/scripts/node_iterate_sort/node_iterate_sort.gml +++ b/scripts/node_iterate_sort/node_iterate_sort.gml @@ -21,7 +21,7 @@ function Node_Iterate_Sort(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr outputNode = noone; nodeValid = false; - if(!LOADING && !APPENDING && !CLONING) { #region + if(NODE_NEW_MANUAL) { #region var input0 = nodeBuild("Node_Iterator_Sort_Input", -256, -64, self); input0.setDisplayName("Value 1"); input0.attributes.sort_inputs = 1; diff --git a/scripts/node_json_file_read/node_json_file_read.gml b/scripts/node_json_file_read/node_json_file_read.gml index c5e6d7d5c..dd1f081c1 100644 --- a/scripts/node_json_file_read/node_json_file_read.gml +++ b/scripts/node_json_file_read/node_json_file_read.gml @@ -1,6 +1,6 @@ function Node_create_Json_File_Read(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("JSON file|*.json", ""); key_release(); if(path == "") return noone; diff --git a/scripts/node_pixel_builder/node_pixel_builder.gml b/scripts/node_pixel_builder/node_pixel_builder.gml index cb1d4364d..23516d737 100644 --- a/scripts/node_pixel_builder/node_pixel_builder.gml +++ b/scripts/node_pixel_builder/node_pixel_builder.gml @@ -13,7 +13,7 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g custom_input_index = ds_list_size(inputs); custom_output_index = ds_list_size(outputs); - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { var input = nodeBuild("Node_PB_Layer", -256, -32, self); RENDER_ALL } diff --git a/scripts/node_posterize/node_posterize.gml b/scripts/node_posterize/node_posterize.gml index 9d0da719f..baee26552 100644 --- a/scripts/node_posterize/node_posterize.gml +++ b/scripts/node_posterize/node_posterize.gml @@ -26,8 +26,11 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) ////////////////////////////////////////////////////////////////////////////////////////////////// + inputs[| 8] = nodeValue("Space", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setDisplay(VALUE_DISPLAY.enum_button, [ "RGB", "LAB" ]); + input_display_list = [ 5, 0, - ["Palette", false, 2], 1, 3, 4, 7, + ["Palette", false, 2], 1, 3, 4, 7, 8, ["Alpha", false, 6], ]; @@ -42,18 +45,21 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) inputs[| 3].setVisible(!_use_pal); inputs[| 4].setVisible(!_use_pal); inputs[| 4].mappableStep(); + inputs[| 8].setVisible(_use_pal); } static processData = function(_outSurf, _data, _output_index, _array_index) { - var _gra = _data[1]; - var _use_gra = _data[2]; + var _pal = _data[1]; + var _use_pal = _data[2]; var _alp = _data[6]; + var _spce = _data[8]; - if(_use_gra) { + if(_use_pal) { surface_set_shader(_outSurf, sh_posterize_palette); - shader_set_f("palette", paletteToArray(_gra)); - shader_set_i("keys", array_length(_gra)); + shader_set_f("palette", paletteToArray(_pal)); + shader_set_i("keys", array_length(_pal)); shader_set_i("alpha", _alp); + shader_set_i("space", _spce); draw_surface_safe(_data[0]); surface_reset_shader(); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 571c092f5..85b75bd29 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -99,7 +99,6 @@ function NodeObject(_name, _spr, _node, _create, tooltip = "", tags = []) constr var _buildCon = createNode[0]; if(createUseParam) _param = struct_append(_param, createNode[2]); - print($" >> building {node}"); var _node = noone; if(_buildCon) _node = new createNode[1](_x, _y, _group, _param); else _node = createNode[1](_x, _y, _group, _param); diff --git a/scripts/node_rigid_group/node_rigid_group.gml b/scripts/node_rigid_group/node_rigid_group.gml index 0f9026ccb..363ef5581 100644 --- a/scripts/node_rigid_group/node_rigid_group.gml +++ b/scripts/node_rigid_group/node_rigid_group.gml @@ -10,7 +10,7 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro update_on_frame = true; collIndex = irandom_range(1, 9999); - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { var _output = nodeBuild("Node_Rigid_Render_Output", 256, -32, self); } diff --git a/scripts/node_rigid_group_inline/node_rigid_group_inline.gml b/scripts/node_rigid_group_inline/node_rigid_group_inline.gml index cd9ffcc0d..18da588e0 100644 --- a/scripts/node_rigid_group_inline/node_rigid_group_inline.gml +++ b/scripts/node_rigid_group_inline/node_rigid_group_inline.gml @@ -9,7 +9,7 @@ function Node_Rigid_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inlin inputs[| 0] = nodeValue("Gravity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 10 ]) .setDisplay(VALUE_DISPLAY.vector); - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { var _object = nodeBuild("Node_Rigid_Object", x, y); var _output = nodeBuild("Node_Rigid_Render", x + 160, y); diff --git a/scripts/node_smoke_group/node_smoke_group.gml b/scripts/node_smoke_group/node_smoke_group.gml index 6d1b41388..b7b767396 100644 --- a/scripts/node_smoke_group/node_smoke_group.gml +++ b/scripts/node_smoke_group/node_smoke_group.gml @@ -58,7 +58,7 @@ function Node_Smoke_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro domain = fd_rectangle_create(PROJECT.attributes.surface_dimension[0], PROJECT.attributes.surface_dimension[1]); - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { var _render = nodeBuild("Node_Smoke_Render_Output", 128, -32, self); } diff --git a/scripts/node_smoke_group_inline/node_smoke_group_inline.gml b/scripts/node_smoke_group_inline/node_smoke_group_inline.gml index f06ebd846..54e906ce9 100644 --- a/scripts/node_smoke_group_inline/node_smoke_group_inline.gml +++ b/scripts/node_smoke_group_inline/node_smoke_group_inline.gml @@ -5,7 +5,7 @@ function Node_Smoke_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inlin is_simulation = true; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { var _domain = nodeBuild("Node_Smoke_Domain", x, y); var _render = nodeBuild("Node_Smoke_Render", x + 320, y); diff --git a/scripts/node_strand_group/node_strand_group.gml b/scripts/node_strand_group/node_strand_group.gml index 23c1aa349..858b071a2 100644 --- a/scripts/node_strand_group/node_strand_group.gml +++ b/scripts/node_strand_group/node_strand_group.gml @@ -7,7 +7,7 @@ function Node_Strand_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr ungroupable = false; update_on_frame = true; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { var _create = nodeBuild("Node_Strand_Create", -384, -32, self); var _update = nodeBuild("Node_Strand_Update", 0, -32, self); var _render = nodeBuild("Node_Strand_Render", 128, -32, self); diff --git a/scripts/node_strand_group_inline/node_strand_group_inline.gml b/scripts/node_strand_group_inline/node_strand_group_inline.gml index 935003fb4..734bcd956 100644 --- a/scripts/node_strand_group_inline/node_strand_group_inline.gml +++ b/scripts/node_strand_group_inline/node_strand_group_inline.gml @@ -6,7 +6,7 @@ function Node_Strand_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inli is_simulation = true; update_on_frame = true; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { var _create = nodeBuild("Node_Strand_Create", x, y); var _render = nodeBuild("Node_Strand_Render", x + 256, y); diff --git a/scripts/node_text_file_read/node_text_file_read.gml b/scripts/node_text_file_read/node_text_file_read.gml index 5a9d88cb0..6e4bd6674 100644 --- a/scripts/node_text_file_read/node_text_file_read.gml +++ b/scripts/node_text_file_read/node_text_file_read.gml @@ -1,6 +1,6 @@ function Node_create_Text_File_Read(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("text file|*.txt", ""); key_release(); if(path == "") return noone; diff --git a/scripts/node_wav_file_read/node_wav_file_read.gml b/scripts/node_wav_file_read/node_wav_file_read.gml index 1bee0cc73..ad200384e 100644 --- a/scripts/node_wav_file_read/node_wav_file_read.gml +++ b/scripts/node_wav_file_read/node_wav_file_read.gml @@ -1,6 +1,6 @@ function Node_create_WAV_File_Read(_x, _y, _group = noone) { #region var path = ""; - if(!LOADING && !APPENDING && !CLONING) { + if(NODE_NEW_MANUAL) { path = get_open_filename("audio|*.wav", ""); key_release(); if(path == "") return noone; @@ -8,7 +8,7 @@ function Node_create_WAV_File_Read(_x, _y, _group = noone) { #region var node = new Node_WAV_File_Read(_x, _y, _group); node.inputs[| 0].setValue(path); - node.doUpdate(); + if(NODE_NEW_MANUAL) node.doUpdate(); return node; } #endregion diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 2b4c6f057..ac872e51a 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1013,6 +1013,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { node_hover = node_hovering; if(value_focus) { + print($"Right click value focus {value_focus}"); + __junction_hovering = value_focus; var menu = [ menu_junc_color ]; @@ -1062,6 +1064,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { menuCall("graph_node_selected_menu",,, menu); } else if(node_hover && node_hover.draggable) { + print($"Right click node hover {node_hover}"); + var menu = []; array_push(menu, menu_node_color, -1, menu_sent_to_preview, menu_send_to_window, menu_sent_to_inspector); if(!DEMO) @@ -1084,6 +1088,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { menuCall("graph_node_selected_multiple_menu",,, menu ); } else if(node_hover == noone) { + print($"Right click not node hover"); + var menu = []; __junction_hovering = junction_hovering; diff --git a/shaders/sh_posterize_palette/sh_posterize_palette.fsh b/shaders/sh_posterize_palette/sh_posterize_palette.fsh index 198f4c887..a852669bb 100644 --- a/shaders/sh_posterize_palette/sh_posterize_palette.fsh +++ b/shaders/sh_posterize_palette/sh_posterize_palette.fsh @@ -6,6 +6,7 @@ varying vec4 v_vColour; uniform vec4 palette[PALETTE_LIMIT]; uniform int keys; uniform int alpha; +uniform int space; vec3 rgb2xyz( vec3 c ) { vec3 tmp; @@ -32,23 +33,30 @@ vec3 rgb2lab(vec3 c) { return vec3( lab.x / 100.0, 0.5 + 0.5 * ( lab.y / 127.0 ), 0.5 + 0.5 * ( lab.z / 127.0 )); } -float colorDifferent(in vec4 c1, in vec4 c2) { +float colorDifferentLAB(in vec4 c1, in vec4 c2) { vec3 lab1 = rgb2lab(c1.rgb); vec3 lab2 = rgb2lab(c2.rgb); return length(lab1 - lab2); } +float colorDifferentRGB(in vec4 c1, in vec4 c2) { + return length(c1.rgb - c2.rgb); +} + void main() { vec4 _col = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord ); vec4 col = alpha == 1? _col * _col.a : _col; - int closet_index = 0; - float closet_value = 99.; + int closet_index = 0; + float closet_value = 999.; for(int i = 0; i < keys; i++) { vec4 p_col = palette[i]; - float dif = colorDifferent(p_col, col); + float dif = 0.; + + if(space == 0) dif = colorDifferentRGB(p_col, col); + else if(space == 1) dif = colorDifferentLAB(p_col, col); if(dif < closet_value) { closet_value = dif;