From 60881f3c71c7f023ca1b89b202820fa3beb278c8 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Wed, 14 Aug 2024 17:22:47 +0700 Subject: [PATCH] 1.17.10 --- PixelComposer.resource_order | 20 ++-- PixelComposer.yyp | 7 +- scripts/globals/globals.gml | 2 +- scripts/node_registry/node_registry.gml | 2 + scripts/node_vector2/node_vector2.yy | 4 +- scripts/node_vector3/node_vector3.yy | 4 +- scripts/node_vector4/node_vector4.yy | 4 +- .../node_vector_cross_2D.yy | 4 +- .../node_vector_cross_3D.yy | 4 +- scripts/node_vector_dot/node_vector_dot.yy | 4 +- .../node_vector_magnitude.gml | 38 ++++++++ .../node_vector_magnitude.yy | 13 +++ .../node_vector_split/node_vector_split.yy | 4 +- .../node_vector_swizzle.gml | 64 +++++++++++++ .../node_vector_swizzle.yy | 13 +++ scripts/pcx_ast/pcx_ast.gml | 1 + scripts/project_data/project_data.gml | 12 +-- scripts/string_functions/string_functions.gml | 2 +- .../9456dfd4-bf59-44e4-a813-614a3b8cfab2.png | Bin 0 -> 1115 bytes .../00fdcf52-54c2-45d7-bce9-cf5c18fc7d15.png | Bin 0 -> 1115 bytes sprites/s_node_magnitude/s_node_magnitude.yy | 90 ++++++++++++++++++ .../e6ba1ca9-c331-4a28-bc05-ba4f4dec7165.png | Bin 0 -> 2560 bytes .../e7134dc6-2cd0-4ca9-99c9-6324dfba9108.png | Bin 0 -> 2560 bytes sprites/s_node_swizzle/s_node_swizzle.yy | 90 ++++++++++++++++++ 24 files changed, 351 insertions(+), 31 deletions(-) create mode 100644 scripts/node_vector_magnitude/node_vector_magnitude.gml create mode 100644 scripts/node_vector_magnitude/node_vector_magnitude.yy create mode 100644 scripts/node_vector_swizzle/node_vector_swizzle.gml create mode 100644 scripts/node_vector_swizzle/node_vector_swizzle.yy create mode 100644 sprites/s_node_magnitude/9456dfd4-bf59-44e4-a813-614a3b8cfab2.png create mode 100644 sprites/s_node_magnitude/layers/9456dfd4-bf59-44e4-a813-614a3b8cfab2/00fdcf52-54c2-45d7-bce9-cf5c18fc7d15.png create mode 100644 sprites/s_node_magnitude/s_node_magnitude.yy create mode 100644 sprites/s_node_swizzle/e6ba1ca9-c331-4a28-bc05-ba4f4dec7165.png create mode 100644 sprites/s_node_swizzle/layers/e6ba1ca9-c331-4a28-bc05-ba4f4dec7165/e7134dc6-2cd0-4ca9-99c9-6324dfba9108.png create mode 100644 sprites/s_node_swizzle/s_node_swizzle.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index a5c2cdda2..f739f0384 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -115,6 +115,7 @@ {"name":"surface","order":10,"path":"folders/nodes/data/value/surface.yy",}, {"name":"text","order":11,"path":"folders/nodes/data/value/text.yy",}, {"name":"trigger","order":13,"path":"folders/nodes/data/value/trigger.yy",}, + {"name":"vector","order":13,"path":"folders/nodes/data/value/vector.yy",}, {"name":"icons","order":1,"path":"folders/nodes/icons.yy",}, {"name":"animation","order":1,"path":"folders/nodes/icons/animation.yy",}, {"name":"filter","order":2,"path":"folders/nodes/icons/filter.yy",}, @@ -131,11 +132,11 @@ {"name":"strandSim","order":12,"path":"folders/nodes/icons/strandSim.yy",}, {"name":"transform","order":13,"path":"folders/nodes/icons/transform.yy",}, {"name":"value","order":14,"path":"folders/nodes/icons/value.yy",}, + {"name":"area","order":30,"path":"folders/nodes/icons/value/area.yy",}, {"name":"array","order":1,"path":"folders/nodes/icons/value/array.yy",}, {"name":"atlas","order":2,"path":"folders/nodes/icons/value/atlas.yy",}, {"name":"bool","order":3,"path":"folders/nodes/icons/value/bool.yy",}, {"name":"color","order":4,"path":"folders/nodes/icons/value/color.yy",}, - {"name":"area","order":30,"path":"folders/nodes/icons/value/area.yy",}, {"name":"mesh","order":5,"path":"folders/nodes/icons/value/mesh.yy",}, {"name":"number","order":6,"path":"folders/nodes/icons/value/number.yy",}, {"name":"path","order":29,"path":"folders/nodes/icons/value/path.yy",}, @@ -1198,13 +1199,14 @@ {"name":"node_value_vec3_range","order":15,"path":"scripts/node_value_vec3_range/node_value_vec3_range.yy",}, {"name":"node_value_vec3","order":4,"path":"scripts/node_value_vec3/node_value_vec3.yy",}, {"name":"node_value_vec4","order":5,"path":"scripts/node_value_vec4/node_value_vec4.yy",}, - {"name":"node_vector_cross_2D","order":12,"path":"scripts/node_vector_cross_2D/node_vector_cross_2D.yy",}, - {"name":"node_vector_cross_3D","order":11,"path":"scripts/node_vector_cross_3D/node_vector_cross_3D.yy",}, - {"name":"node_vector_dot","order":10,"path":"scripts/node_vector_dot/node_vector_dot.yy",}, - {"name":"node_vector_split","order":20,"path":"scripts/node_vector_split/node_vector_split.yy",}, - {"name":"node_vector2","order":17,"path":"scripts/node_vector2/node_vector2.yy",}, - {"name":"node_vector3","order":18,"path":"scripts/node_vector3/node_vector3.yy",}, - {"name":"node_vector4","order":19,"path":"scripts/node_vector4/node_vector4.yy",}, + {"name":"node_vector_cross_3D","order":1,"path":"scripts/node_vector_cross_3D/node_vector_cross_3D.yy",}, + {"name":"node_vector_dot","order":2,"path":"scripts/node_vector_dot/node_vector_dot.yy",}, + {"name":"node_vector_magnitude","order":7,"path":"scripts/node_vector_magnitude/node_vector_magnitude.yy",}, + {"name":"node_vector_split","order":3,"path":"scripts/node_vector_split/node_vector_split.yy",}, + {"name":"node_vector_swizzle","order":8,"path":"scripts/node_vector_swizzle/node_vector_swizzle.yy",}, + {"name":"node_vector2","order":4,"path":"scripts/node_vector2/node_vector2.yy",}, + {"name":"node_vector3","order":5,"path":"scripts/node_vector3/node_vector3.yy",}, + {"name":"node_vector4","order":6,"path":"scripts/node_vector4/node_vector4.yy",}, {"name":"node_VFX_accelerate","order":1,"path":"scripts/node_VFX_accelerate/node_VFX_accelerate.yy",}, {"name":"node_VFX_attract","order":2,"path":"scripts/node_VFX_attract/node_VFX_attract.yy",}, {"name":"node_VFX_destroy","order":3,"path":"scripts/node_VFX_destroy/node_VFX_destroy.yy",}, @@ -2238,6 +2240,7 @@ {"name":"s_node_lua_compute","order":17,"path":"sprites/s_node_lua_compute/s_node_lua_compute.yy",}, {"name":"s_node_lua_global","order":19,"path":"sprites/s_node_lua_global/s_node_lua_global.yy",}, {"name":"s_node_lua_surface","order":18,"path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",}, + {"name":"s_node_magnitude","order":18,"path":"sprites/s_node_magnitude/s_node_magnitude.yy",}, {"name":"s_node_math","order":6,"path":"sprites/s_node_math/s_node_math.yy",}, {"name":"s_node_mesh_transform","order":1,"path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",}, {"name":"s_node_mesh_type","order":15,"path":"sprites/s_node_mesh_type/s_node_mesh_type.yy",}, @@ -2451,6 +2454,7 @@ {"name":"s_node_surface_to_buffer","order":3,"path":"sprites/s_node_surface_to_buffer/s_node_surface_to_buffer.yy",}, {"name":"s_node_svg","order":38,"path":"sprites/s_node_svg/s_node_svg.yy",}, {"name":"s_node_switch","order":20,"path":"sprites/s_node_switch/s_node_switch.yy",}, + {"name":"s_node_swizzle","order":19,"path":"sprites/s_node_swizzle/s_node_swizzle.yy",}, {"name":"s_node_terminal_trigger","order":41,"path":"sprites/s_node_terminal_trigger/s_node_terminal_trigger.yy",}, {"name":"s_node_text_char_get","order":2,"path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",}, {"name":"s_node_text_combine","order":3,"path":"sprites/s_node_text_combine/s_node_text_combine.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 10469b1f2..02c000b6f 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -214,6 +214,7 @@ {"$GMFolder":"","%Name":"surface","folderPath":"folders/nodes/data/value/surface.yy","name":"surface","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"text","folderPath":"folders/nodes/data/value/text.yy","name":"text","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"trigger","folderPath":"folders/nodes/data/value/trigger.yy","name":"trigger","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"vector","folderPath":"folders/nodes/data/value/vector.yy","name":"vector","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"icons","folderPath":"folders/nodes/icons.yy","name":"icons","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"3D","folderPath":"folders/nodes/icons/3D.yy","name":"3D","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"animation","folderPath":"folders/nodes/icons/animation.yy","name":"animation","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -231,11 +232,11 @@ {"$GMFolder":"","%Name":"strandSim","folderPath":"folders/nodes/icons/strandSim.yy","name":"strandSim","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"transform","folderPath":"folders/nodes/icons/transform.yy","name":"transform","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"value","folderPath":"folders/nodes/icons/value.yy","name":"value","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"area","folderPath":"folders/nodes/icons/value/area.yy","name":"area","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"array","folderPath":"folders/nodes/icons/value/array.yy","name":"array","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"atlas","folderPath":"folders/nodes/icons/value/atlas.yy","name":"atlas","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"bool","folderPath":"folders/nodes/icons/value/bool.yy","name":"bool","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"color","folderPath":"folders/nodes/icons/value/color.yy","name":"color","resourceType":"GMFolder","resourceVersion":"2.0",}, - {"$GMFolder":"","%Name":"area","folderPath":"folders/nodes/icons/value/area.yy","name":"area","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"mesh","folderPath":"folders/nodes/icons/value/mesh.yy","name":"mesh","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"number","folderPath":"folders/nodes/icons/value/number.yy","name":"number","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"path","folderPath":"folders/nodes/icons/value/path.yy","name":"path","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -1807,7 +1808,9 @@ {"id":{"name":"node_vector_cross_2D","path":"scripts/node_vector_cross_2D/node_vector_cross_2D.yy",},}, {"id":{"name":"node_vector_cross_3D","path":"scripts/node_vector_cross_3D/node_vector_cross_3D.yy",},}, {"id":{"name":"node_vector_dot","path":"scripts/node_vector_dot/node_vector_dot.yy",},}, + {"id":{"name":"node_vector_magnitude","path":"scripts/node_vector_magnitude/node_vector_magnitude.yy",},}, {"id":{"name":"node_vector_split","path":"scripts/node_vector_split/node_vector_split.yy",},}, + {"id":{"name":"node_vector_swizzle","path":"scripts/node_vector_swizzle/node_vector_swizzle.yy",},}, {"id":{"name":"node_vector2","path":"scripts/node_vector2/node_vector2.yy",},}, {"id":{"name":"node_vector3","path":"scripts/node_vector3/node_vector3.yy",},}, {"id":{"name":"node_vector4","path":"scripts/node_vector4/node_vector4.yy",},}, @@ -2969,6 +2972,7 @@ {"id":{"name":"s_node_lua_compute","path":"sprites/s_node_lua_compute/s_node_lua_compute.yy",},}, {"id":{"name":"s_node_lua_global","path":"sprites/s_node_lua_global/s_node_lua_global.yy",},}, {"id":{"name":"s_node_lua_surface","path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",},}, + {"id":{"name":"s_node_magnitude","path":"sprites/s_node_magnitude/s_node_magnitude.yy",},}, {"id":{"name":"s_node_math","path":"sprites/s_node_math/s_node_math.yy",},}, {"id":{"name":"s_node_mesh_path","path":"sprites/s_node_mesh_path/s_node_mesh_path.yy",},}, {"id":{"name":"s_node_mesh_transform","path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",},}, @@ -3190,6 +3194,7 @@ {"id":{"name":"s_node_surface_to_buffer","path":"sprites/s_node_surface_to_buffer/s_node_surface_to_buffer.yy",},}, {"id":{"name":"s_node_svg","path":"sprites/s_node_svg/s_node_svg.yy",},}, {"id":{"name":"s_node_switch","path":"sprites/s_node_switch/s_node_switch.yy",},}, + {"id":{"name":"s_node_swizzle","path":"sprites/s_node_swizzle/s_node_swizzle.yy",},}, {"id":{"name":"s_node_terminal_trigger","path":"sprites/s_node_terminal_trigger/s_node_terminal_trigger.yy",},}, {"id":{"name":"s_node_text_char_get","path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",},}, {"id":{"name":"s_node_text_combine","path":"sprites/s_node_text_combine/s_node_text_combine.yy",},}, diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 6a8a62af1..356dcaf35 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -39,7 +39,7 @@ LATEST_VERSION = 1_17_00_0; VERSION = 1_17_10_0; SAVE_VERSION = 1_17_10_0; - VERSION_STRING = "1.17.10.006"; + VERSION_STRING = "1.17.10"; BUILD_NUMBER = 1_17_10_0; HOTKEYS = ds_map_create(); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 93822ff4d..d26e0cdff 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -866,9 +866,11 @@ function __initNodes() { addNodeObject(values, "Vector3", s_node_vec3, "Node_Vector3", [1, Node_Vector3]); addNodeObject(values, "Vector4", s_node_vec4, "Node_Vector4", [1, Node_Vector4]); addNodeObject(values, "Vector Split", s_node_vec_split, "Node_Vector_Split", [1, Node_Vector_Split]); + addNodeObject(values, "Magnitude", s_node_magnitude, "Node_Vector_Magnitude", [1, Node_Vector_Magnitude], ["vector length", "vector magnitude"]).setVersion(1_17_10_0); addNodeObject(values, "Dot product", s_node_dot_product, "Node_Vector_Dot", [1, Node_Vector_Dot]).setVersion(1141); addNodeObject(values, "Cross product 3D", s_node_cross_product_2d, "Node_Vector_Cross_3D", [1, Node_Vector_Cross_3D]).setVersion(1141); addNodeObject(values, "Cross product 2D", s_node_cross_product_3d, "Node_Vector_Cross_2D", [1, Node_Vector_Cross_2D]).setVersion(1141); + addNodeObject(values, "Swizzle", s_node_swizzle, "Node_Vector_Swizzle", [1, Node_Vector_Swizzle], ["swap axis"]).setVersion(1_17_10_0); ds_list_add(values, "Texts"); addNodeObject(values, "Text", s_node_text, "Node_String", [1, Node_String]); diff --git a/scripts/node_vector2/node_vector2.yy b/scripts/node_vector2/node_vector2.yy index cfbe485b8..73b876d24 100644 --- a/scripts/node_vector2/node_vector2.yy +++ b/scripts/node_vector2/node_vector2.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_vector2", "parent":{ - "name":"number", - "path":"folders/nodes/data/value/number.yy", + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_vector3/node_vector3.yy b/scripts/node_vector3/node_vector3.yy index c184a689d..d380de5ed 100644 --- a/scripts/node_vector3/node_vector3.yy +++ b/scripts/node_vector3/node_vector3.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_vector3", "parent":{ - "name":"number", - "path":"folders/nodes/data/value/number.yy", + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_vector4/node_vector4.yy b/scripts/node_vector4/node_vector4.yy index 6e1c3ce9c..e62ed1411 100644 --- a/scripts/node_vector4/node_vector4.yy +++ b/scripts/node_vector4/node_vector4.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_vector4", "parent":{ - "name":"number", - "path":"folders/nodes/data/value/number.yy", + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_vector_cross_2D/node_vector_cross_2D.yy b/scripts/node_vector_cross_2D/node_vector_cross_2D.yy index 988f10f44..b691023fa 100644 --- a/scripts/node_vector_cross_2D/node_vector_cross_2D.yy +++ b/scripts/node_vector_cross_2D/node_vector_cross_2D.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_vector_cross_2D", "parent":{ - "name":"number", - "path":"folders/nodes/data/value/number.yy", + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_vector_cross_3D/node_vector_cross_3D.yy b/scripts/node_vector_cross_3D/node_vector_cross_3D.yy index 80cb87929..0ce206d31 100644 --- a/scripts/node_vector_cross_3D/node_vector_cross_3D.yy +++ b/scripts/node_vector_cross_3D/node_vector_cross_3D.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_vector_cross_3D", "parent":{ - "name":"number", - "path":"folders/nodes/data/value/number.yy", + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_vector_dot/node_vector_dot.yy b/scripts/node_vector_dot/node_vector_dot.yy index 15aad4bba..1b73f7292 100644 --- a/scripts/node_vector_dot/node_vector_dot.yy +++ b/scripts/node_vector_dot/node_vector_dot.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_vector_dot", "parent":{ - "name":"number", - "path":"folders/nodes/data/value/number.yy", + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_vector_magnitude/node_vector_magnitude.gml b/scripts/node_vector_magnitude/node_vector_magnitude.gml new file mode 100644 index 000000000..6a130df69 --- /dev/null +++ b/scripts/node_vector_magnitude/node_vector_magnitude.gml @@ -0,0 +1,38 @@ +function Node_Vector_Magnitude(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { + name = "Magnitude"; + color = COLORS.node_blend_number; + setDimension(96, 48); + + inputs[0] = nodeValue("Vector", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) + .setArrayDepth(1) + .setVisible(true, true); + + outputs[0] = nodeValue_Output("Magnitude", self, VALUE_TYPE.float, 0 ); + + static processData = function(_output, _data, _output_index, _array_index = 0) { + var _vec = _data[0]; + if(!is_array(_vec)) return 0; + + switch(array_length(_vec)) { + case 0 : return 0; + case 1 : return _vec[0]; + case 2 : return sqrt(sqr(_vec[0]) + sqr(_vec[1])); + case 3 : return sqrt(sqr(_vec[0]) + sqr(_vec[1]) + sqr(_vec[2])); + case 4 : return sqrt(sqr(_vec[0]) + sqr(_vec[1]) + sqr(_vec[2]) + sqr(_vec[3])); + + default : + var _red = array_reduce(_vec, function(_p, _c) { return _p + _c * _c; }, 0); + return sqrt(_red); + } + + return 0; + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + var bbox = drawGetBbox(xx, yy, _s); + var val = outputs[0].getValue(); + + draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text); + draw_text_bbox(bbox, string(val)); + } +} \ No newline at end of file diff --git a/scripts/node_vector_magnitude/node_vector_magnitude.yy b/scripts/node_vector_magnitude/node_vector_magnitude.yy new file mode 100644 index 000000000..e12778f16 --- /dev/null +++ b/scripts/node_vector_magnitude/node_vector_magnitude.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"", + "%Name":"node_vector_magnitude", + "isCompatibility":false, + "isDnD":false, + "name":"node_vector_magnitude", + "parent":{ + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/node_vector_split/node_vector_split.yy b/scripts/node_vector_split/node_vector_split.yy index 5ea3f69f3..8df8063c7 100644 --- a/scripts/node_vector_split/node_vector_split.yy +++ b/scripts/node_vector_split/node_vector_split.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_vector_split", "parent":{ - "name":"number", - "path":"folders/nodes/data/value/number.yy", + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_vector_swizzle/node_vector_swizzle.gml b/scripts/node_vector_swizzle/node_vector_swizzle.gml new file mode 100644 index 000000000..d75241902 --- /dev/null +++ b/scripts/node_vector_swizzle/node_vector_swizzle.gml @@ -0,0 +1,64 @@ +function Node_Vector_Swizzle(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { + name = "Swizzle"; + color = COLORS.node_blend_number; + setDimension(96, 48); + + inputs[0] = nodeValue("Vector", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) + .setArrayDepth(1) + .setVisible(true, true); + + inputs[1] = nodeValue_Text("Swizzle", self, ""); + + outputs[0] = nodeValue_Output("Result", self, VALUE_TYPE.float, [] ); + + static char_get_index = function(_chr) { + switch(string_lower(_chr)) { + case "r" : + case "x" : + return 0; + + case "g" : + case "y" : + return 1; + + case "b" : + case "z" : + return 2; + + case "a" : + case "w" : + return 3; + } + + return 0; + } + + static processData = function(_output, _data, _output_index, _array_index = 0) { + var _vec = _data[0]; + var _swz = _data[1]; + + var amo = string_length(_swz); + if(amo == 0) return _vec; + + var ind = 1; + var ch, ix; + var _v = []; + + repeat(amo) { + ch = string_char_at(_swz, ind++); + ix = char_get_index(ch); + + array_push(_v, array_safe_get(_vec, ix)); + } + + return amo == 1? _v[0] : _v; + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + var bbox = drawGetBbox(xx, yy, _s); + var val = getInputData(1); + + draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text); + draw_text_bbox(bbox, val); + } +} \ No newline at end of file diff --git a/scripts/node_vector_swizzle/node_vector_swizzle.yy b/scripts/node_vector_swizzle/node_vector_swizzle.yy new file mode 100644 index 000000000..57f069c5b --- /dev/null +++ b/scripts/node_vector_swizzle/node_vector_swizzle.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"", + "%Name":"node_vector_swizzle", + "isCompatibility":false, + "isDnD":false, + "name":"node_vector_swizzle", + "parent":{ + "name":"vector", + "path":"folders/nodes/data/value/vector.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/pcx_ast/pcx_ast.gml b/scripts/pcx_ast/pcx_ast.gml index be912109d..57aab6f60 100644 --- a/scripts/pcx_ast/pcx_ast.gml +++ b/scripts/pcx_ast/pcx_ast.gml @@ -106,6 +106,7 @@ PROJECT_VARIABLES.Project.fps = [ function() { return PROJECT.animator.framerate }, EXPRESS_TREE_ANIM.none ]; PROJECT_VARIABLES.Project.time = [ function() { return CURRENT_FRAME / PROJECT.animator.framerate }, EXPRESS_TREE_ANIM.animated ]; PROJECT_VARIABLES.Project.name = [ function() { return filename_name_only(PROJECT.path) }, EXPRESS_TREE_ANIM.none ]; + PROJECT_VARIABLES.Project.dimension = [ function() { return PROJECT.attributes.surface_dimension; }, EXPRESS_TREE_ANIM.none ]; PROJECT_VARIABLES.Program = {}; PROJECT_VARIABLES.Program.time = [ function() { return current_time / 1000 }, EXPRESS_TREE_ANIM.animated ]; diff --git a/scripts/project_data/project_data.gml b/scripts/project_data/project_data.gml index c32cb250b..d6a312acc 100644 --- a/scripts/project_data/project_data.gml +++ b/scripts/project_data/project_data.gml @@ -12,16 +12,16 @@ #region project function Project() constructor { - active = true; /// @is {bool} + active = true; meta = __getdefaultMetaData(); - path = ""; /// @is {string} + path = ""; thumbnail = ""; - version = SAVE_VERSION; /// @is {number} - seed = irandom_range(100000, 999999); /// @is {number} + version = SAVE_VERSION; + seed = irandom_range(100000, 999999); - modified = false; /// @is {bool} - readonly = false; /// @is {bool} + modified = false; + readonly = false; safeMode = false; allNodes = []; diff --git a/scripts/string_functions/string_functions.gml b/scripts/string_functions/string_functions.gml index 548d00763..43608701e 100644 --- a/scripts/string_functions/string_functions.gml +++ b/scripts/string_functions/string_functions.gml @@ -48,7 +48,7 @@ function string_compare(s1, s2) { var l1 = string_length(s1); var l2 = string_length(s2); - var i = 0; + var i = 1; var c1, c2; repeat(min(l1, l2)) { diff --git a/sprites/s_node_magnitude/9456dfd4-bf59-44e4-a813-614a3b8cfab2.png b/sprites/s_node_magnitude/9456dfd4-bf59-44e4-a813-614a3b8cfab2.png new file mode 100644 index 0000000000000000000000000000000000000000..30c31158232f79689a1d0d08aa23a82a5f5da4af GIT binary patch literal 1115 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=3dtTpz6=aiY77hwEes65fI|H*Yfq~i2)5S5Q;?~<)d$UCx zC63h#`)&|mJ!s;#Ve@Bwj;H{k=(;+`KaG3>n+&l663{mNUoZZm*y5z%@n0g8Pm_ z#cUg)tanGhYS!{*S}&Urqq$WySHqMs^`Nv<`&L2r_*IPS9_lVQ{7ThyiVnNHPR5%qA&`ZHI;V1;j=St9d~nTwTeTNO}lFPHyHQaxm_kH`xS^lB(-(Rzr?v_~duh#WG>m;vW zJEr3`t?dc(7fk+eOT_M6gGwc@yjkPj|58h}c5&!EfB8mu&)P+7DN~p6h}s;)rJY2k(UqdFga@e!-tv2*Feknqu{+04IP{y)rXwV={uPL zJ#u)up5RQ8iMgKF@&$K>eYKGO!FEsgPfJJ6ThEHz1Bx#)5&nCFOUgFB z@_jzc$6QiOS@vrxT@LNn_FQ_Eqw|F31Az~5np|H*Yfq~i2)5S5Q;?~<)d$UCx zC63h#`)&|mJ!s;#Ve@Bwj;H{k=(;+`KaG3>n+&l663{mNUoZZm*y5z%@n0g8Pm_ z#cUg)tanGhYS!{*S}&Urqq$WySHqMs^`Nv<`&L2r_*IPS9_lVQ{7ThyiVnNHPR5%qA&`ZHI;V1;j=St9d~nTwTeTNO}lFPHyHQaxm_kH`xS^lB(-(Rzr?v_~duh#WG>m;vW zJEr3`t?dc(7fk+eOT_M6gGwc@yjkPj|58h}c5&!EfB8mu&)P+7DN~p6h}s;)rJY2k(UqdFga@e!-tv2*Feknqu{+04IP{y)rXwV={uPL zJ#u)up5RQ8iMgKF@&$K>eYKGO!FEsgPfJJ6ThEHz1Bx#)5&nCFOUgFB z@_jzc$6QiOS@vrxT@LNn_FQ_Eqw|F31Az~5np":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_node_magnitude", + "playback":1, + "playbackSpeed":30.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"9456dfd4-bf59-44e4-a813-614a3b8cfab2","path":"sprites/s_node_magnitude/s_node_magnitude.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"172e3779-0eff-4f8c-b586-0215184b9aa9","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":32, + "yorigin":32, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":64, +} \ No newline at end of file diff --git a/sprites/s_node_swizzle/e6ba1ca9-c331-4a28-bc05-ba4f4dec7165.png b/sprites/s_node_swizzle/e6ba1ca9-c331-4a28-bc05-ba4f4dec7165.png new file mode 100644 index 0000000000000000000000000000000000000000..9e5701f25ec54e88fee24228e2775afb927eaf2d GIT binary patch literal 2560 zcmZ{mc{tPy7sr3I7-OsxQnoBL*Ak{MmTMU@w(NURMwYmmBEw)tGqPmObrB*VBrfLF zWU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{z576q|ATR_De9`l9%9H81-*ea4&9--Fevp(lFNCq$d_x)EIppFE=aQ|Epv#_yaG zy_Hb(tTfX=JbgoMOBRH0(!I$knn{DBJu)yiqw@l4>pN)n`3!zmmQQ@jToEYXl2u!5 za-dV2;|RR3kA9GkWWP~bMt~eyxW+SIR=oS| z;uY-3(I|Y&>*d;+0jp$(0ZSxD>~nWKy`GZ|gpLOoHL}%2x(y$cEMBLn+D5kL7&+k- zz1suf=+VX0>z~%nU#&Q%8f3(MC{BGR-JmWBu7`=IQ=lO=Wif$sRfMqC#Ivn_?Mi&u z_WkCOlz#2RVPjF_!IyQVnR0cG`a&QT$)=Mrr?_;P9mxKzV8)aJ33MmOu1Mzb(U}oV zjj1nU62orXd#3vhvoY4u@u;(9{(^kL{mgB41V#AQ!QTg@4rqg9vnXq6lCSE#bu!iU z4kl-s@%`}TF@A;jx5OrhnUXl({Dy?{DX@HSHE550PHZ%@+%8q|bT!zQV4os1eZopA zR$5V+1X9GeB1at^AZfz0;)t)(Y9_y0+$wQh2y7{pJ&^O&rtA9Vj-K&)bq{jLLyGg# z7e3^jK6;4G5OE$vKOdsMzVB`SBLU8%&uginb=A&kxuEs*HP7p7omWMp_0edES0Cg5 w0KzT5pn#}<2X2Fi@FPI!e;tTH1phFi4n+a literal 0 HcmV?d00001 diff --git a/sprites/s_node_swizzle/layers/e6ba1ca9-c331-4a28-bc05-ba4f4dec7165/e7134dc6-2cd0-4ca9-99c9-6324dfba9108.png b/sprites/s_node_swizzle/layers/e6ba1ca9-c331-4a28-bc05-ba4f4dec7165/e7134dc6-2cd0-4ca9-99c9-6324dfba9108.png new file mode 100644 index 0000000000000000000000000000000000000000..9e5701f25ec54e88fee24228e2775afb927eaf2d GIT binary patch literal 2560 zcmZ{mc{tPy7sr3I7-OsxQnoBL*Ak{MmTMU@w(NURMwYmmBEw)tGqPmObrB*VBrfLF zWUQGR7eyIFOm+!HCVQ5=?mzGIyno#1Jm-9$=bY#Bob$&y&vTL;>?{Nkk_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aG zy_Hb(tTfX=JbgoMOBRH0(!I$knn{DBJu)yiqw@l4>pN)n`3!zmmQQ@jToEYXl2u!5 za-dV2;|RR3kA9GkWWP~bMt~eyxW+SIR=oS| z;uY-3(I|Y&>*d;+0jp$(0ZSxD>~nWKy`GZ|gpLOoHL}%2x(y$cEMBLn+D5kL7&+k- zz1suf=+VX0>z~%nU#&Q%8f3(MC{BGR-JmWBu7`=IQ=lO=Wif$sRfMqC#Ivn_?Mi&u z_WkCOlz#2RVPjF_!IyQVnR0cG`a&QT$)=Mrr?_;P9mxKzV8)aJ33MmOu1Mzb(U}oV zjj1nU62orXd#3vhvoY4u@u;(9{(^kL{mgB41V#AQ!QTg@4rqg9vnXq6lCSE#bu!iU z4kl-s@%`}TF@A;jx5OrhnUXl({Dy?{DX@HSHE550PHZ%@+%8q|bT!zQV4os1eZopA zR$5V+1X9GeB1at^AZfz0;)t)(Y9_y0+$wQh2y7{pJ&^O&rtA9Vj-K&)bq{jLLyGg# z7e3^jK6;4G5OE$vKOdsMzVB`SBLU8%&uginb=A&kxuEs*HP7p7omWMp_0edES0Cg5 w0KzT5pn#}<2X2Fi@FPI!e;tTH1phFi4n+a literal 0 HcmV?d00001 diff --git a/sprites/s_node_swizzle/s_node_swizzle.yy b/sprites/s_node_swizzle/s_node_swizzle.yy new file mode 100644 index 000000000..2554f5ddc --- /dev/null +++ b/sprites/s_node_swizzle/s_node_swizzle.yy @@ -0,0 +1,90 @@ +{ + "$GMSprite":"", + "%Name":"s_node_swizzle", + "bboxMode":0, + "bbox_bottom":60, + "bbox_left":7, + "bbox_right":56, + "bbox_top":2, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"e6ba1ca9-c331-4a28-bc05-ba4f4dec7165","name":"e6ba1ca9-c331-4a28-bc05-ba4f4dec7165","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":64, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"e7134dc6-2cd0-4ca9-99c9-6324dfba9108","blendMode":0,"displayName":"default","isLocked":false,"name":"e7134dc6-2cd0-4ca9-99c9-6324dfba9108","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"s_node_swizzle", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"number", + "path":"folders/nodes/icons/value/number.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"s_node_swizzle", + "autoRecord":true, + "backdropHeight":768, + "backdropImageOpacity":0.5, + "backdropImagePath":"", + "backdropWidth":1366, + "backdropXOffset":0.0, + "backdropYOffset":0.0, + "events":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_node_swizzle", + "playback":1, + "playbackSpeed":30.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"e6ba1ca9-c331-4a28-bc05-ba4f4dec7165","path":"sprites/s_node_swizzle/s_node_swizzle.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"dd5c6081-4e42-4abe-93a0-1cf38388473b","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":32, + "yorigin":32, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":64, +} \ No newline at end of file