From d3f16360774f022434d38c0bd451de3762593d49 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Sun, 10 Nov 2024 11:17:30 +0700 Subject: [PATCH] [2D light] The output alpha channel now match the input. --- PixelComposer.resource_order | 5 + PixelComposer.yyp | 5 + objects/o_main/Draw_75.gml | 4 +- scripts/__bone/__bone.gml | 370 +++++++++-------- scripts/dynaSurf/dynaSurf.gml | 2 + scripts/globals/globals.gml | 4 +- scripts/meshBox/meshBox.gml | 34 ++ scripts/meshBox/meshBox.yy | 13 + scripts/nodeValue_drawer/nodeValue_drawer.gml | 3 +- scripts/node_2d_light/node_2d_light.gml | 26 +- scripts/node_armature/node_armature.gml | 122 +++--- .../node_armature_bind/node_armature_bind.gml | 139 +++++-- .../node_armature_mesh_rig.gml | 382 +++++++++++++++++- .../node_armature_path/node_armature_path.gml | 6 +- .../node_armature_pose/node_armature_pose.gml | 56 ++- scripts/node_data/node_data.gml | 17 +- scripts/node_mesh_warp/node_mesh_warp.gml | 69 +++- scripts/node_pin/node_pin.gml | 1 + scripts/node_registry/node_registry.gml | 11 +- scripts/node_tunnel_in/node_tunnel_in.gml | 3 + scripts/node_tunnel_out/node_tunnel_out.gml | 2 + scripts/node_value/node_value.gml | 17 +- scripts/point_rotate/point_rotate.gml | 37 +- scripts/render_data/render_data.gml | 1 + scripts/surfaceDynaBox/surfaceDynaBox.gml | 51 +++ scripts/surfaceDynaBox/surfaceDynaBox.yy | 13 + .../sh_2d_light_apply/sh_2d_light_apply.fsh | 12 + .../sh_2d_light_apply/sh_2d_light_apply.vsh | 19 + .../sh_2d_light_apply/sh_2d_light_apply.yy | 12 + .../31c83e1e-8539-4edf-a5f1-82ed6726abb6.png | Bin 964 -> 0 bytes .../8fdfbcea-ea77-48fd-ba17-e77e525adfc6.png | Bin 0 -> 875 bytes .../c522ca13-4db7-451f-8192-17561ae92385.png | Bin 964 -> 0 bytes .../8d65c061-a3b2-4290-98d8-2d158525536d.png | Bin 0 -> 875 bytes sprites/s_bone_IK/s_bone_IK.yy | 16 +- .../4c4d464f-55b1-43f1-83f6-9e5cb7313927.png | Bin 0 -> 471 bytes .../184ef4b6-61c4-4d63-ab62-a234177c7aed.png | Bin 0 -> 471 bytes .../s_node_armature_mesh.yy | 90 +++++ .../cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea.png | Bin 0 -> 2179 bytes .../4c6f6f4a-829e-4a0f-896e-f2402548b091.png | Bin 0 -> 2179 bytes .../s_node_armature_mesh_rig.yy | 90 +++++ 40 files changed, 1255 insertions(+), 377 deletions(-) create mode 100644 scripts/meshBox/meshBox.gml create mode 100644 scripts/meshBox/meshBox.yy create mode 100644 scripts/surfaceDynaBox/surfaceDynaBox.gml create mode 100644 scripts/surfaceDynaBox/surfaceDynaBox.yy create mode 100644 shaders/sh_2d_light_apply/sh_2d_light_apply.fsh create mode 100644 shaders/sh_2d_light_apply/sh_2d_light_apply.vsh create mode 100644 shaders/sh_2d_light_apply/sh_2d_light_apply.yy delete mode 100644 sprites/s_bone_IK/31c83e1e-8539-4edf-a5f1-82ed6726abb6.png create mode 100644 sprites/s_bone_IK/8fdfbcea-ea77-48fd-ba17-e77e525adfc6.png delete mode 100644 sprites/s_bone_IK/layers/31c83e1e-8539-4edf-a5f1-82ed6726abb6/c522ca13-4db7-451f-8192-17561ae92385.png create mode 100644 sprites/s_bone_IK/layers/8fdfbcea-ea77-48fd-ba17-e77e525adfc6/8d65c061-a3b2-4290-98d8-2d158525536d.png create mode 100644 sprites/s_node_armature_mesh/4c4d464f-55b1-43f1-83f6-9e5cb7313927.png create mode 100644 sprites/s_node_armature_mesh/layers/4c4d464f-55b1-43f1-83f6-9e5cb7313927/184ef4b6-61c4-4d63-ab62-a234177c7aed.png create mode 100644 sprites/s_node_armature_mesh/s_node_armature_mesh.yy create mode 100644 sprites/s_node_armature_mesh_rig/cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea.png create mode 100644 sprites/s_node_armature_mesh_rig/layers/cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea/4c6f6f4a-829e-4a0f-896e-f2402548b091.png create mode 100644 sprites/s_node_armature_mesh_rig/s_node_armature_mesh_rig.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index d058029ca..c48693fa3 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -703,6 +703,7 @@ {"name":"materialBox","order":14,"path":"scripts/materialBox/materialBox.yy",}, {"name":"math_function","order":3,"path":"scripts/math_function/math_function.yy",}, {"name":"matrixGrid","order":6,"path":"scripts/matrixGrid/matrixGrid.yy",}, + {"name":"meshBox","order":3,"path":"scripts/meshBox/meshBox.yy",}, {"name":"meta_data","order":12,"path":"scripts/meta_data/meta_data.yy",}, {"name":"mouse_input","order":1,"path":"scripts/mouse_input/mouse_input.yy",}, {"name":"mtl_reader","order":6,"path":"scripts/mtl_reader/mtl_reader.yy",}, @@ -1395,6 +1396,7 @@ {"name":"surface_functions","order":4,"path":"scripts/surface_functions/surface_functions.yy",}, {"name":"surface_get_palette","order":2,"path":"scripts/surface_get_palette/surface_get_palette.yy",}, {"name":"surfaceBox","order":4,"path":"scripts/surfaceBox/surfaceBox.yy",}, + {"name":"surfaceDynaBox","order":19,"path":"scripts/surfaceDynaBox/surfaceDynaBox.yy",}, {"name":"svg_objects","order":1,"path":"scripts/svg_objects/svg_objects.yy",}, {"name":"text_file","order":5,"path":"scripts/text_file/text_file.yy",}, {"name":"textArrayBox","order":1,"path":"scripts/textArrayBox/textArrayBox.yy",}, @@ -1431,6 +1433,7 @@ {"name":"window_functions","order":2,"path":"scripts/window_functions/window_functions.yy",}, {"name":"winwin_extras","order":6,"path":"scripts/winwin_extras/winwin_extras.yy",}, {"name":"winwin_utils","order":7,"path":"scripts/winwin_utils/winwin_utils.yy",}, + {"name":"sh_2d_light_apply","order":32,"path":"shaders/sh_2d_light_apply/sh_2d_light_apply.yy",}, {"name":"sh_2d_light","order":10,"path":"shaders/sh_2d_light/sh_2d_light.yy",}, {"name":"sh_3d_depth","order":6,"path":"shaders/sh_3d_depth/sh_3d_depth.yy",}, {"name":"sh_3d_extrude_corner","order":7,"path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",}, @@ -2134,6 +2137,8 @@ {"name":"s_node_argument","order":40,"path":"sprites/s_node_argument/s_node_argument.yy",}, {"name":"s_node_armature_bind","order":14,"path":"sprites/s_node_armature_bind/s_node_armature_bind.yy",}, {"name":"s_node_armature_create","order":16,"path":"sprites/s_node_armature_create/s_node_armature_create.yy",}, + {"name":"s_node_armature_mesh_rig","order":24,"path":"sprites/s_node_armature_mesh_rig/s_node_armature_mesh_rig.yy",}, + {"name":"s_node_armature_mesh","order":31,"path":"sprites/s_node_armature_mesh/s_node_armature_mesh.yy",}, {"name":"s_node_armature_path","order":17,"path":"sprites/s_node_armature_path/s_node_armature_path.yy",}, {"name":"s_node_armature_pose","order":15,"path":"sprites/s_node_armature_pose/s_node_armature_pose.yy",}, {"name":"s_node_armature_sample","order":18,"path":"sprites/s_node_armature_sample/s_node_armature_sample.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 361c8c8e2..b73827041 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -1247,6 +1247,7 @@ {"id":{"name":"materialBox","path":"scripts/materialBox/materialBox.yy",},}, {"id":{"name":"math_function","path":"scripts/math_function/math_function.yy",},}, {"id":{"name":"matrixGrid","path":"scripts/matrixGrid/matrixGrid.yy",},}, + {"id":{"name":"meshBox","path":"scripts/meshBox/meshBox.yy",},}, {"id":{"name":"meta_data","path":"scripts/meta_data/meta_data.yy",},}, {"id":{"name":"migration_function","path":"scripts/migration_function/migration_function.yy",},}, {"id":{"name":"mouse_input","path":"scripts/mouse_input/mouse_input.yy",},}, @@ -2042,6 +2043,7 @@ {"id":{"name":"surface_functions","path":"scripts/surface_functions/surface_functions.yy",},}, {"id":{"name":"surface_get_palette","path":"scripts/surface_get_palette/surface_get_palette.yy",},}, {"id":{"name":"surfaceBox","path":"scripts/surfaceBox/surfaceBox.yy",},}, + {"id":{"name":"surfaceDynaBox","path":"scripts/surfaceDynaBox/surfaceDynaBox.yy",},}, {"id":{"name":"svg_objects","path":"scripts/svg_objects/svg_objects.yy",},}, {"id":{"name":"svg_reader","path":"scripts/svg_reader/svg_reader.yy",},}, {"id":{"name":"testing_script","path":"scripts/testing_script/testing_script.yy",},}, @@ -2087,6 +2089,7 @@ {"id":{"name":"windowManager","path":"scripts/windowManager/windowManager.yy",},}, {"id":{"name":"winwin_extras","path":"scripts/winwin_extras/winwin_extras.yy",},}, {"id":{"name":"winwin_utils","path":"scripts/winwin_utils/winwin_utils.yy",},}, + {"id":{"name":"sh_2d_light_apply","path":"shaders/sh_2d_light_apply/sh_2d_light_apply.yy",},}, {"id":{"name":"sh_2d_light","path":"shaders/sh_2d_light/sh_2d_light.yy",},}, {"id":{"name":"sh_3d_depth","path":"shaders/sh_3d_depth/sh_3d_depth.yy",},}, {"id":{"name":"sh_3d_extrude_corner","path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",},}, @@ -2867,6 +2870,8 @@ {"id":{"name":"s_node_argument","path":"sprites/s_node_argument/s_node_argument.yy",},}, {"id":{"name":"s_node_armature_bind","path":"sprites/s_node_armature_bind/s_node_armature_bind.yy",},}, {"id":{"name":"s_node_armature_create","path":"sprites/s_node_armature_create/s_node_armature_create.yy",},}, + {"id":{"name":"s_node_armature_mesh_rig","path":"sprites/s_node_armature_mesh_rig/s_node_armature_mesh_rig.yy",},}, + {"id":{"name":"s_node_armature_mesh","path":"sprites/s_node_armature_mesh/s_node_armature_mesh.yy",},}, {"id":{"name":"s_node_armature_path","path":"sprites/s_node_armature_path/s_node_armature_path.yy",},}, {"id":{"name":"s_node_armature_pose","path":"sprites/s_node_armature_pose/s_node_armature_pose.yy",},}, {"id":{"name":"s_node_armature_sample","path":"sprites/s_node_armature_sample/s_node_armature_sample.yy",},}, diff --git a/objects/o_main/Draw_75.gml b/objects/o_main/Draw_75.gml index 7faf3fc7c..466ca5da9 100644 --- a/objects/o_main/Draw_75.gml +++ b/objects/o_main/Draw_75.gml @@ -34,7 +34,6 @@ if(winMan_isMinimized()) exit; break; case VALUE_TYPE.curve : - // draw_tooltip_text($"[{__txt("Curve Object")}]"); draw_tooltip_curve(content); break; @@ -83,8 +82,7 @@ if(winMan_isMinimized()) exit; case VALUE_TYPE.mesh : var txt = __txt("Mesh Object"); - if(is_struct(content)) - txt += $" (triangles: {array_length(content.triangles)})"; + if(is(content, MeshedSurface)) txt += $" (triangles: {array_length(content.tris)})"; draw_tooltip_text($"[{txt}]"); break; diff --git a/scripts/__bone/__bone.gml b/scripts/__bone/__bone.gml index e77b49619..f2d99592f 100644 --- a/scripts/__bone/__bone.gml +++ b/scripts/__bone/__bone.gml @@ -1,6 +1,7 @@ -function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = 0, node = noone) constructor { - ID = UUID_generate(); - self.name = "New bone"; +function __Bone(_parent = noone, distance = 0, direction = 0, angle = 0, length = 0, node = noone) constructor { + ID = UUID_generate(); + name = "New bone"; + self.distance = distance; self.direction = direction; self.angle = angle; @@ -9,36 +10,44 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = init_length = length; init_angle = angle; + init_direction = 0; + init_distance = 0; pose_angle = 0; pose_scale = 1; pose_posit = [ 0, 0 ]; + pose_local_angle = 0; pose_local_scale = 1; pose_local_posit = [ 0, 0 ]; + bone_head_init = new __vec2(); + bone_head_pose = new __vec2(); + bone_tail_init = new __vec2(); + bone_tail_pose = new __vec2(); + apply_scale = true; apply_rotation = true; - childs = []; - is_main = false; - parent_anchor = true; + childs = []; + is_main = false; + parent_anchor = true; - tb_name = new textBox(TEXTBOX_INPUT.text, function(_name) /*=>*/ { name = _name; if(node) node.triggerRender(); }); - tb_name.font = f_p2; - tb_name.hide = true; + tb_name = new textBox(TEXTBOX_INPUT.text, function(_name) /*=>*/ { name = _name; if(node) node.triggerRender(); }); + tb_name.font = f_p2; + tb_name.hide = true; - updated = false; + updated = false; - IKlength = 0; - IKTargetID = ""; - IKTarget = noone; + IKlength = 0; + IKTargetID = ""; + IKTarget = noone; - freeze_data = {}; + freeze_data = {}; - self.parent = parent; + parent = _parent; if(parent != noone) { - distance = parent.length; + distance = parent.length; direction = parent.angle; } @@ -56,12 +65,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } static freeze = function() { - freeze_data = { - angle: angle, - length: length, - distance: distance, - direction: direction - } + freeze_data = { angle, length, distance, direction }; for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].freeze(); @@ -94,30 +98,36 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = return noone; } + static getHead = function(pose = true) { return pose? bone_head_pose.clone() : bone_head_init.clone(); } + static getTail = function(pose = true) { return pose? bone_tail_pose.clone() : bone_tail_init.clone(); } + static getPoint = function(progress, pose = true) { var _len = pose? length : init_length; var _ang = pose? angle : init_angle; + var _dir = pose? direction : init_direction; + var _dis = pose? distance : init_distance; + var len = _len * progress; + var _dx = lengthdir_x(_dis, _dir), _dy = lengthdir_y(_dis, _dir); + var _lx = lengthdir_x( len, _ang), _ly = lengthdir_y( len, _ang); + if(parent == noone) - return new __vec2(lengthdir_x(distance, direction), lengthdir_y(distance, direction)) - .addElement(lengthdir_x(len, _ang), lengthdir_y(len, _ang)); + return new __vec2(_dx, _dy) + .addElement(_lx, _ly); - if(parent_anchor) { - var p = parent.getPoint(1, pose) - .addElement(lengthdir_x(len, _ang), lengthdir_y(len, _ang)) - return p; - } + if(parent_anchor) + return parent.getTail(pose) + .addElement(_lx, _ly); - var p = parent.getPoint(0, pose) - .addElement(lengthdir_x(distance, direction), lengthdir_y(distance, direction)) - .addElement(lengthdir_x(len, _ang), lengthdir_y(len, _ang)) - return p; + return parent.getHead(pose) + .addElement(_dx, _dy) + .addElement(_lx, _ly); } - static draw = function(attributes, edit = false, _x = 0, _y = 0, _s = 1, _mx = 0, _my = 0, hovering = noone, selecting = noone) { - var hover = _drawBone(attributes, edit, _x, _y, _s, _mx, _my, hovering, selecting); + static draw = function(attributes, edit = false, _x = 0, _y = 0, _s = 1, _mx = 0, _my = 0, _hover = noone, _select = noone, _blend = c_white, _alpha = 1) { + var hover = _drawBone(attributes, edit, _x, _y, _s, _mx, _my, _hover, _select, _blend, _alpha); drawControl(attributes); return hover; } @@ -125,117 +135,21 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = control_x0 = 0; control_y0 = 0; control_i0 = 0; control_x1 = 0; control_y1 = 0; control_i1 = 0; - static _drawBone = function(attributes, edit = false, _x = 0, _y = 0, _s = 1, _mx = 0, _my = 0, hovering = noone, selecting = noone) { + static _drawBone = function(attributes, edit = false, _x = 0, _y = 0, _s = 1, _mx = 0, _my = 0, _hover = noone, _select = noone, _blend = c_white, _alpha = 1) { var hover = noone; - var p0 = getPoint(0); - var p1 = getPoint(1); + control_x0 = _x + bone_head_pose.x * _s; + control_y0 = _y + bone_head_pose.y * _s; + control_x1 = _x + bone_tail_pose.x * _s; + control_y1 = _y + bone_tail_pose.y * _s; - p0.x = _x + p0.x * _s; - p0.y = _y + p0.y * _s; - p1.x = _x + p1.x * _s; - p1.y = _y + p1.y * _s; - - control_x0 = p0.x; control_y0 = p0.y; - control_x1 = p1.x; control_y1 = p1.y; - if(parent != noone) { - if(selecting && selecting.ID == self.ID) { - draw_set_color(COLORS._main_value_positive); - draw_set_alpha(0.75); - } else if(hovering != noone && hovering[0].ID == self.ID && hovering[1] == 2) { - draw_set_color(c_white); - draw_set_alpha(1); - } else { - draw_set_color(COLORS._main_accent); - draw_set_alpha(0.75); - } - - if(IKlength == 0) { - if(!parent_anchor && parent.parent != noone) { - var _p = parent.getPoint(0); - _p.x = _x + _p.x * _s; - _p.y = _y + _p.y * _s; - draw_line_dashed(_p.x, _p.y, p0.x, p0.y, 1); - } - - if(attributes.display_bone == 0) { - var _ppx = lerp(p0.x, p1.x, 0.2); - var _ppy = lerp(p0.y, p1.y, 0.2); - var _prr = point_direction(p0.x, p0.y, p1.x, p1.y) + 90; - var _prx = lengthdir_x(6 * pose_scale, _prr); - var _pry = lengthdir_y(6 * pose_scale, _prr); - - draw_primitive_begin(pr_trianglelist); - draw_vertex(p0.x, p0.y); - draw_vertex(_ppx, _ppy); - draw_vertex(_ppx + _prx, _ppy + _pry); - - draw_vertex(p0.x, p0.y); - draw_vertex(_ppx, _ppy); - draw_vertex(_ppx - _prx, _ppy - _pry); - - draw_vertex(p1.x, p1.y); - draw_vertex(_ppx, _ppy); - draw_vertex(_ppx + _prx, _ppy + _pry); - - draw_vertex(p1.x, p1.y); - draw_vertex(_ppx, _ppy); - draw_vertex(_ppx - _prx, _ppy - _pry); - draw_primitive_end(); - - if((edit & 0b100) && distance_to_line(_mx, _my, p0.x, p0.y, p1.x, p1.y) <= 12) //drag bone - hover = [ self, 2, p0 ]; - - } else if(attributes.display_bone == 1) { - draw_line_width(p0.x, p0.y, p1.x, p1.y, 3); - - if((edit & 0b100) && distance_to_line(_mx, _my, p0.x, p0.y, p1.x, p1.y) <= 6) //drag bone - hover = [ self, 2, p0 ]; - } - } else { - draw_set_color(c_white); - if(!parent_anchor && parent.parent != noone) { - var _p = parent.getPoint(1); - _p.x = _x + _p.x * _s; - _p.y = _y + _p.y * _s; - draw_line_dashed(_p.x, _p.y, p0.x, p0.y, 1); - } - - draw_sprite_ui(THEME.preview_bone_IK, 0, p0.x, p0.y,,,, c_white, draw_get_alpha()); - - if((edit & 0b100) && point_in_circle(_mx, _my, p0.x, p0.y, 24)) - hover = [ self, 2, p0 ]; - } - draw_set_alpha(1.00); - - if(attributes.display_name && IKlength == 0) { - if(abs(p0.y - p1.y) < abs(p0.x - p1.x)) { - draw_set_text(f_p3, fa_center, fa_bottom, COLORS._main_accent); - draw_text_add((p0.x + p1.x) / 2, (p0.y + p1.y) / 2 - 4, name); - } else { - draw_set_text(f_p3, fa_left, fa_center, COLORS._main_accent); - draw_text_add((p0.x + p1.x) / 2 + 4, (p0.y + p1.y) / 2, name); - } - } - - if(IKlength == 0) { - if(!parent_anchor) { - control_i0 = (hovering != noone && hovering[0] == self && hovering[1] == 0)? 0 : 2; - - if((edit & 0b001) && point_in_circle(_mx, _my, p0.x, p0.y, ui(16))) //drag head - hover = [ self, 0, p0 ]; - } - - control_i1 = (hovering != noone && hovering[0] == self && hovering[1] == 1)? 0 : 2; - - if((edit & 0b010) && point_in_circle(_mx, _my, p1.x, p1.y, ui(16))) //drag tail - hover = [ self, 1, p1 ]; - } + var h = __drawBoneUI(attributes, edit, _x, _y, _s, _mx, _my, _hover, _select, _blend, _alpha); + if(h != noone) hover = h; } for( var i = 0, n = array_length(childs); i < n; i++ ) { - var h = childs[i]._drawBone(attributes, edit, _x, _y, _s, _mx, _my, hovering, selecting); + var h = childs[i]._drawBone(attributes, edit, _x, _y, _s, _mx, _my, _hover, _select, _blend, _alpha); if(hover == noone && h != noone) hover = h; } @@ -243,6 +157,114 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = return hover; } + static __drawBoneUI = function(attributes, edit = false, _x = 0, _y = 0, _s = 1, _mx = 0, _my = 0, _hover = noone, _select = noone, _blend = c_white, _alpha = 1) { + var hover = noone; + + var p0x = _x + bone_head_pose.x * _s; + var p0y = _y + bone_head_pose.y * _s; + var p1x = _x + bone_tail_pose.x * _s; + var p1y = _y + bone_tail_pose.y * _s; + + if(_select && _select.ID == self.ID) { + draw_set_color(COLORS._main_value_positive); + draw_set_alpha(0.75 * _alpha); + + } else if(_hover != noone && _hover[0].ID == self.ID && _hover[1] == 2) { + draw_set_color(c_white); + draw_set_alpha(1 * _alpha); + + } else { + draw_set_color(COLORS._main_accent); + draw_set_alpha(0.75 * _alpha); + } + + if(IKlength == 0) { + if(!parent_anchor && parent.parent != noone) { + var _p = parent.getHead(); + var _px = _x + _p.x * _s; + var _py = _y + _p.y * _s; + draw_line_dashed(_px, _py, p0x, p0y, 1); + } + + if(attributes.display_bone == 0) { + var _ppx = lerp(p0x, p1x, 0.2); + var _ppy = lerp(p0y, p1y, 0.2); + var _prr = point_direction(p0x, p0y, p1x, p1y) + 90; + var _prx = lengthdir_x(6 * pose_scale, _prr); + var _pry = lengthdir_y(6 * pose_scale, _prr); + + draw_primitive_begin(pr_trianglelist); + draw_vertex(p0x, p0y); + draw_vertex(_ppx, _ppy); + draw_vertex(_ppx + _prx, _ppy + _pry); + + draw_vertex(p0x, p0y); + draw_vertex(_ppx, _ppy); + draw_vertex(_ppx - _prx, _ppy - _pry); + + draw_vertex(p1x, p1y); + draw_vertex(_ppx, _ppy); + draw_vertex(_ppx + _prx, _ppy + _pry); + + draw_vertex(p1x, p1y); + draw_vertex(_ppx, _ppy); + draw_vertex(_ppx - _prx, _ppy - _pry); + draw_primitive_end(); + + if((edit & 0b100) && distance_to_line(_mx, _my, p0x, p0y, p1x, p1y) <= 12) //drag bone + hover = [ self, 2, bone_head_pose ]; + + } else if(attributes.display_bone == 1) { + draw_line_width(p0x, p0y, p1x, p1y, 3); + + if((edit & 0b100) && distance_to_line(_mx, _my, p0x, p0y, p1x, p1y) <= 6) //drag bone + hover = [ self, 2, bone_head_pose ]; + } + + } else { + draw_set_color(c_white); + if(!parent_anchor && parent.parent != noone) { + var _p = parent.getTail(); + var _px = _x + _p.x * _s; + var _py = _y + _p.y * _s; + draw_line_dashed(_px, _py, p0x, p0y, 1); + } + + draw_sprite_ui(THEME.preview_bone_IK, 0, p0x, p0y,,,, COLORS._main_accent, draw_get_alpha()); + + if((edit & 0b100) && point_in_circle(_mx, _my, p0x, p0y, 24)) + hover = [ self, 2, bone_head_pose ]; + } + draw_set_alpha(1); + + if(attributes.display_name && IKlength == 0) { + if(abs(p0y - p1y) < abs(p0x - p1x)) { + draw_set_text(f_p3, fa_center, fa_bottom, COLORS._main_accent); + draw_text_add((p0x + p1x) / 2, (p0y + p1y) / 2 - 4, name); + + } else { + draw_set_text(f_p3, fa_left, fa_center, COLORS._main_accent); + draw_text_add((p0x + p1x) / 2 + 4, (p0y + p1y) / 2, name); + } + } + + if(IKlength == 0) { + if(!parent_anchor) { + control_i0 = (_hover != noone && _hover[0] == self && _hover[1] == 0)? 0 : 2; + + if((edit & 0b001) && point_in_circle(_mx, _my, p0x, p0y, ui(16))) //drag head + hover = [ self, 0, bone_head_pose ]; + } + + control_i1 = (_hover != noone && _hover[0] == self && _hover[1] == 1)? 0 : 2; + + if((edit & 0b010) && point_in_circle(_mx, _my, p1x, p1y, ui(16))) //drag tail + hover = [ self, 1, bone_tail_pose ]; + } + + return hover; + } + static drawControl = function(attributes) { if(parent != noone && IKlength == 0) { var spr, ind0, ind1; @@ -266,13 +288,28 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = pose_scale = 1; pose_posit = [ 0, 0 ]; + init_direction = direction; + init_distance = distance; + for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].resetPose(); } - static setPose = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) { - setPoseTransform(_position, _angle, _scale); - setIKconstrain(); + static setPosition = function() { + bone_head_init = getPoint(0, false); + bone_head_pose = getPoint(0, true); + bone_tail_init = getPoint(1, false); + bone_tail_pose = getPoint(1, true); + + for( var i = 0, n = array_length(childs); i < n; i++ ) + childs[i].setPosition(); + } + + static setPose = function(_position = [ 0, 0 ], _angle = 0, _scale = 1, _ik = true) { + setPosition(); + setPoseTransform(_position, _angle, _scale); + if(_ik) setIKconstrain(); + setPosition(); } static setPoseTransform = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) { @@ -314,20 +351,14 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = var bn = IKTarget; for( var i = IKlength; i > 0; i-- ) { - var _p = bn.getPoint(1); - bones[i - 1] = bn; - points[i] = { - x: _p.x, - y: _p.y - }; + var _p = bn.getTail(); + bones[i - 1] = bn; + points[i] = { x: _p.x, y: _p.y }; bn = bn.parent; } - _p = bn.getPoint(1); - points[0] = { - x: _p.x, - y: _p.y - }; + _p = bn.getTail(); + points[0] = { x: _p.x, y: _p.y }; for( var i = 0; i < IKlength; i++ ) { var p0 = points[i]; @@ -336,11 +367,11 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = lengths[i] = point_distance(p0.x, p0.y, p1.x, p1.y); } - var p = parent.getPoint(0); - p.x += lengthdir_x(distance, direction); - p.y += lengthdir_y(distance, direction); + var p = parent.getHead(); + var px = p.x + lengthdir_x(distance, direction); + var py = p.y + lengthdir_y(distance, direction); - FABRIK(bones, points, lengths, p.x, p.y); + FABRIK(bones, points, lengths, px, py); } for( var i = 0, n = array_length(childs); i < n; i++ ) @@ -349,10 +380,12 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = FABRIK_result = []; static FABRIK = function(bones, points, lengths, dx, dy) { + var threshold = 0.01; var _bo = array_create(array_length(points)); for( var i = 0, n = array_length(points); i < n; i++ ) _bo[i] = { x: points[i].x, y: points[i].y }; + var sx = points[0].x; var sy = points[0].y; var itr = 0; @@ -373,17 +406,24 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } until(delta <= threshold); for( var i = 0, n = array_length(points) - 1; i < n; i++ ) { - var bone = bones[i]; - var p0 = points[i]; - var p1 = points[i + 1]; + var _b = bones[i]; + var p0 = points[i]; + var p1 = points[i + 1]; - var dir = point_direction(p0.x, p0.y, p1.x, p1.y); - bone.angle = dir; + var dir = point_direction(p0.x, p0.y, p1.x, p1.y); + var dis = point_distance( p0.x, p0.y, p1.x, p1.y); + // _b.pose_scale = dis / _b.init_length; + // _b.length = dis; + + _b.pose_angle = dir - _b.init_angle; + _b.angle = dir; + FABRIK_result[i] = p0; } FABRIK_result[i] = p1; + } static FABRIK_backward = function(points, lengths, dx, dy) { @@ -429,8 +469,8 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } static __getBBOX = function() { - var p0 = getPoint(0); - var p1 = getPoint(1); + var p0 = bone_head_pose; + var p1 = bone_tail_pose; var x0 = min(p0.x, p1.x); var y0 = min(p0.y, p1.y); @@ -542,7 +582,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = static toString = function() { return $"Bone {name} [{ID}]"; } static toArray = function(arr = []) { - array_push(arr, self); + if(!is_main) array_push(arr, self); for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].toArray(arr); diff --git a/scripts/dynaSurf/dynaSurf.gml b/scripts/dynaSurf/dynaSurf.gml index da009f992..5f8dafa71 100644 --- a/scripts/dynaSurf/dynaSurf.gml +++ b/scripts/dynaSurf/dynaSurf.gml @@ -31,6 +31,8 @@ function dynaSurf() constructor { onFree(); } + static getSurfacePreview = function() { return array_safe_get_fast(surfaces, 0); } + static clone = function() { return noone; } static destroy = function() {} } diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 33cc8b043..ba2c022be 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -40,9 +40,9 @@ globalvar HOTKEYS, HOTKEY_CONTEXT; LATEST_VERSION = 1_18_00_0; - VERSION = 1_18_03_1; + VERSION = 1_18_04_0; SAVE_VERSION = 1_18_02_0; - VERSION_STRING = MAC? "1.18.003m" : "1.18.4.001"; + VERSION_STRING = MAC? "1.18.003m" : "1.18.4.003"; BUILD_NUMBER = 1_18_03_1; HOTKEYS = ds_map_create(); diff --git a/scripts/meshBox/meshBox.gml b/scripts/meshBox/meshBox.gml new file mode 100644 index 000000000..cd8d2b223 --- /dev/null +++ b/scripts/meshBox/meshBox.gml @@ -0,0 +1,34 @@ +function meshBox(_junction) : widget() constructor { + self.junction = _junction; + + static trigger = function() { } + + static drawParam = function(params) { + setParam(params); + return draw(params.x, params.y, params.w, params.data, params.m); + } + + static draw = function(_x, _y, _w, _mesh, _m) { + x = _x; + y = _y; + w = _w; + h = TEXTBOX_HEIGHT; + + var ic = s_node_armature_mesh; + var iw = ui(24); + var _s = (iw - ui(8)) / max(sprite_get_width(ic), sprite_get_height(ic)); + var bi = 0; + + draw_sprite_stretched_ext(THEME.button_def, bi, x, y, iw, h); + + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, x + iw + ui(4), y, w - iw - ui(4), h, COLORS._main_icon_light); + draw_sprite_ext(ic, 1, x + iw / 2, y + h / 2, _s, _s); + + draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub); + draw_text_add(x + iw + ui(4 + 8), y + h / 2, "Mesh"); + + return h; + } + + static clone = function() { return new meshBox(); } +} diff --git a/scripts/meshBox/meshBox.yy b/scripts/meshBox/meshBox.yy new file mode 100644 index 000000000..b5c49efe1 --- /dev/null +++ b/scripts/meshBox/meshBox.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"meshBox", + "isCompatibility":false, + "isDnD":false, + "name":"meshBox", + "parent":{ + "name":"object", + "path":"folders/widgets/object.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 1e937874f..c453b95f4 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -385,8 +385,9 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc } break; - case VALUE_TYPE.d3Material : case VALUE_TYPE.surface : + case VALUE_TYPE.d3Material : + case VALUE_TYPE.dynaSurface : param.h = widExtend? ui(96) : ui(48); break; diff --git a/scripts/node_2d_light/node_2d_light.gml b/scripts/node_2d_light/node_2d_light.gml index 44796db72..f4bc783dd 100644 --- a/scripts/node_2d_light/node_2d_light.gml +++ b/scripts/node_2d_light/node_2d_light.gml @@ -14,13 +14,13 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(0, nodeValue_Surface("Surface in", self)); typeList = [ - new scrollItem("Point", s_node_2d_light_shape, 0), - new scrollItem("Ellipse", s_node_2d_light_shape, 1), - new scrollItem("Line", s_node_2d_light_shape, 2), - new scrollItem("Line asymmetric", s_node_2d_light_shape, 3), - new scrollItem("Saber", s_node_2d_light_shape, 4), - new scrollItem("Spot", s_node_2d_light_shape, 5), - new scrollItem("Flame", s_node_2d_light_shape, 6), + new scrollItem("Point", s_node_2d_light_shape, 0), + new scrollItem("Ellipse", s_node_2d_light_shape, 1), + new scrollItem("Line", s_node_2d_light_shape, 2), + new scrollItem("Line asymmetric", s_node_2d_light_shape, 3), + new scrollItem("Saber", s_node_2d_light_shape, 4), + new scrollItem("Spot", s_node_2d_light_shape, 5), + new scrollItem("Flame", s_node_2d_light_shape, 6), ]; typeListStr = array_create_ext(array_length(typeList), function(i) /*=>*/ {return typeList[i].name}); @@ -573,12 +573,12 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) applyLight(_data, _ind, _lightSurf); } - surface_set_target(_outSurf); - DRAW_CLEAR - BLEND_OVERRIDE draw_surface_safe(_surf); - BLEND_ADD draw_surface_safe(_lightSurf); - BLEND_NORMAL - surface_reset_target(); + surface_set_shader(_outSurf, sh_2d_light_apply, true, BLEND.over); + shader_set_surface("base", _surf); + shader_set_surface("light", _lightSurf); + + draw_empty(); + surface_reset_shader(); return [ _outSurf, _lightSurf ]; } diff --git a/scripts/node_armature/node_armature.gml b/scripts/node_armature/node_armature.gml index baf72727d..914d3ded9 100644 --- a/scripts/node_armature/node_armature.gml +++ b/scripts/node_armature/node_armature.gml @@ -17,8 +17,6 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo ty += ui(28); draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, ty, _w, bh - ui(32), COLORS.node_composite_bg_blend, 1); - // draw_set_color(COLORS.node_composite_separator); - // draw_line(_x + 16, ty + ui(8), _x + _w - 16, ty + ui(8)); ty += ui(8); var hovering = noone; @@ -173,16 +171,16 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo anchor_selecting = noone; builder_bone = noone; builder_type = 0; - builder_sx = 0; - builder_sy = 0; - builder_mx = 0; - builder_my = 0; + builder_sx = 0; + builder_sy = 0; + builder_mx = 0; + builder_my = 0; builder_moving = false; builder_scaling = false; bone_dragging = noone; - ik_dragging = noone; + ik_dragging = noone; moving = false; scaling = false; @@ -210,22 +208,24 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo builder_bone.direction = point_direction(0, 0, bx, by); builder_bone.distance = point_distance( 0, 0, bx, by); } + } else if(key_mod_press(ALT)) { if(builder_type == 0) { - var bo = builder_bone.getPoint(1); + var bo = builder_bone.getTail(); builder_bone.direction = dir; builder_bone.distance = dis; - var bn = builder_bone.getPoint(0); + var bn = builder_bone.getHead(); builder_bone.angle = point_direction(bn.x, bn.y, bo.x, bo.y); builder_bone.length = point_distance( bn.x, bn.y, bo.x, bo.y); + } else if(builder_type == 1) { var chs = []; for( var i = 0, n = array_length(builder_bone.childs); i < n; i++ ) { var ch = builder_bone.childs[i]; - chs[i] = ch.getPoint(1); + chs[i] = ch.getTail(); } builder_bone.angle = dir; @@ -233,7 +233,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo for( var i = 0, n = array_length(builder_bone.childs); i < n; i++ ) { var ch = builder_bone.childs[i]; - var c0 = ch.getPoint(0); + var c0 = ch.getHead(); ch.angle = point_direction(c0.x, c0.y, chs[i].x, chs[i].y); ch.length = point_distance( c0.x, c0.y, chs[i].x, chs[i].y); @@ -245,11 +245,11 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo builder_bone.distance = dis; if(builder_bone.parent) { - var par_anc = builder_bone.parent.getPoint(1); - par_anc.x = _x + par_anc.x * _s; - par_anc.y = _y + par_anc.y * _s; + var par_anc = builder_bone.parent.getTail(); + var par_ancx = _x + par_anc.x * _s; + var par_ancy = _y + par_anc.y * _s; - var inRange = point_in_circle(_mx, _my, par_anc.x, par_anc.y, 16) && mouse_release(mb_left); + var inRange = point_in_circle(_mx, _my, par_ancx, par_ancy, 16) && mouse_release(mb_left); if(!builder_bone.parent.is_main && builder_bone.IKlength > 0 && inRange) builder_bone.parent_anchor = true; } @@ -269,45 +269,60 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo } else if(ik_dragging != noone) { anchor_selecting = _b.draw(attributes, active * 0b100, _x, _y, _s, _mx, _my, anchor_selecting, ik_dragging); - if(anchor_selecting != noone && anchor_selecting[1] == 2) { - var anc = anchor_selecting[0]; + var _bone = ik_dragging.parent; + var p1 = ik_dragging.getTail(); + var p1x = _x + p1.x * _s; + var p1y = _y + p1.y * _s; - var reachable = false; - var _bone = ik_dragging.parent; - var len = 0; + if(anchor_selecting != noone && anchor_selecting[1] == 2) { + var anc = anchor_selecting[0]; + var _reach = false; + var _blen = 0; while(_bone != noone) { if(_bone == anc.parent) { - reachable = true; + _reach = true; break; } - len++; + _blen++; _bone = _bone.parent; } - if(reachable && mouse_release(mb_left)) { - var p1 = ik_dragging.getPoint(1); - var p0 = anc.getPoint(0); + if(_reach) { + var p0 = anc.getHead(); + var p0t = anc.getTail(); + var _px = _x + p0t.x * _s; + var _py = _y + p0t.y * _s; + draw_line_dashed(_px, _py, p1x, p1y, 1); - var _len = point_distance(p0.x, p0.y, p1.x, p1.y); - var _ang = point_direction(p0.x, p0.y, p1.x, p1.y); - - recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); - - var IKbone = new __Bone(anc, _len, _ang, ik_dragging.angle + 90, 0, self); - anc.addChild(IKbone); - IKbone.IKlength = len; - IKbone.IKTargetID = ik_dragging.ID; - - IKbone.name = "IK handle"; - IKbone.parent_anchor = false; + if(mouse_release(mb_left)) { + var _len = point_distance(p0.x, p0.y, p1.x, p1.y); + var _ang = point_direction(p0.x, p0.y, p1.x, p1.y); + + recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); + + var IKbone = new __Bone(anc, _len, _ang, ik_dragging.angle + 90, 0, self); + anc.addChild(IKbone); + IKbone.IKlength = _blen; + IKbone.IKTargetID = ik_dragging.ID; + + IKbone.name = "IK handle"; + IKbone.parent_anchor = false; + + bones.setPosition(); + } } - } + + draw_sprite_ui(THEME.preview_bone_IK, 0, p1x, p1y, 1, 1, 0, _reach? COLORS._main_value_positive : COLORS._main_accent, 0.5); + + } else + draw_sprite_ui(THEME.preview_bone_IK, 0, p1x, p1y, 1, 1, 0, COLORS._main_accent, 0.25); if(mouse_release(mb_left)) { - ik_dragging = noone; + ik_dragging = noone; UNDO_HOLDING = false; + bones.setPosition(); } triggerRender(); @@ -338,7 +353,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo if(mouse_release(mb_left)) { builder_moving = false; - UNDO_HOLDING = false; + UNDO_HOLDING = false; } draw_set_color(COLORS._main_accent); @@ -436,16 +451,18 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo if(anchor_selecting == noone) { builder_bone = createBone(bones, point_distance(0, 0, smx, smy), point_direction(0, 0, smx, smy)); builder_type = 1; - builder_sx = smx; - builder_sy = smy; + builder_sx = smx; + builder_sy = smy; UNDO_HOLDING = true; + bones.setPosition(); } else if(anchor_selecting[1] == 1) { builder_bone = createBone(anchor_selecting[0], 0, 0); builder_type = 1; - builder_sx = smx; - builder_sy = smy; + builder_sx = smx; + builder_sy = smy; UNDO_HOLDING = true; + bones.setPosition(); } else if(anchor_selecting[1] == 2) { var _pr = anchor_selecting[0]; @@ -467,13 +484,15 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo if(anchor_selecting == noone) draw_sprite_ext(THEME.bone_tool_add, 1, _mx + 16, _my + 16, 1, 1, 0, c_white, 1); + else if(anchor_selecting[1] == 1) { draw_sprite_ext(THEME.bone_tool_add, 0, _mx + 24, _my + 24, 1, 1, 0, c_white, 1); draw_sprite_ext(THEME.bone_tool_add, 1, _mx + 24, _my + 24, 1, 1, 0, c_white, 1); + } else if(anchor_selecting[1] == 2) draw_sprite_ext(THEME.bone_tool_add, 0, _mx + 24, _my + 24, 1, 1, 0, c_white, 1); - } else if(isUsingTool("Remove bones")) { //remover + } else if(isUsingTool("Remove bones")) { //remover anchor_selecting = _b.draw(attributes, active * 0b100, _x, _y, _s, _mx, _my, anchor_selecting); if(anchor_selecting != noone && anchor_selecting[1] == 2 && anchor_selecting[0].parent != noone && mouse_press(mb_left, active)) { @@ -495,7 +514,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo if(anchor_selecting != noone) draw_sprite_ext(THEME.bone_tool_remove, 1, _mx + 24, _my + 24, 1, 1, 0, c_white, 1); - } else if(isUsingTool("Detach bones")) { //detach + } else if(isUsingTool("Detach bones")) { //detach if(builder_bone == noone) anchor_selecting = _b.draw(attributes, active * 0b100, _x, _y, _s, _mx, _my, anchor_selecting); @@ -536,13 +555,15 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); if(builder_type == 0) { - var orig = builder_bone.parent.getPoint(0); + var orig = builder_bone.parent.getHead(); builder_sx = orig.x; builder_sy = orig.y; + } else if(builder_type == 1) { - var orig = builder_bone.getPoint(0); + var orig = builder_bone.getHead(); builder_sx = orig.x; builder_sy = orig.y; + } else if(builder_type == 2) { if(builder_bone.parent_anchor) { builder_bone = noone; @@ -564,6 +585,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo static step = function() {} static update = function(frame = CURRENT_FRAME) { + bones.setPosition(); outputs[0].setValue(bones); } @@ -581,8 +603,8 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo var __b = ds_stack_pop(_bst); for( var i = 0, n = array_length(__b.childs); i < n; i++ ) { - var p0 = __b.childs[i].getPoint(0); - var p1 = __b.childs[i].getPoint(1); + var p0 = __b.childs[i].getHead(); + var p1 = __b.childs[i].getTail(); minx = min(minx, p0.x); miny = min(miny, p0.y); maxx = max(maxx, p0.x); maxy = max(maxy, p0.y); diff --git a/scripts/node_armature_bind/node_armature_bind.gml b/scripts/node_armature_bind/node_armature_bind.gml index 471cb8ddd..e8a083446 100644 --- a/scripts/node_armature_bind/node_armature_bind.gml +++ b/scripts/node_armature_bind/node_armature_bind.gml @@ -39,14 +39,14 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr attribute_surface_depth(); attribute_interpolation(); + anchor_selecting = noone; + attributes.layer_visible = []; attributes.layer_selectable = []; attributes.display_name = true; attributes.display_bone = 0; - anchor_selecting = noone; - array_push(attributeEditors, "Display"); array_push(attributeEditors, ["Display name", function() /*=>*/ {return attributes.display_name}, new checkBox(function() /*=>*/ { attributes.display_name = !attributes.display_name; })]); array_push(attributeEditors, ["Display bone", function() /*=>*/ {return attributes.display_bone}, new scrollBox(["Octahedral", "Stick"], function(ind) /*=>*/ { attributes.display_bone = ind; })]); @@ -75,7 +75,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var _surfAmo = getInputAmount(); for(var i = 0; i < _surfAmo; i++) { - var _surf = current_data[input_fix_len + i * data_length]; + var _surf = getInputData(input_fix_len + i * data_length); var _id = array_safe_get(boneIDMap, i, ""); if(_id == "") continue; @@ -157,7 +157,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr _sx += _sw * _ss + 4; } } - + if(point_in_rectangle(_m[0], _m[1], _x, ty, _x + _w, ty + _hh - 1)) { if(layer_dragging != noone) { draw_sprite_stretched_ext(THEME.ui_panel, 1, _x, ty, _w, _hh, COLORS._main_accent, 1); @@ -166,7 +166,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr anchor_selecting = [ _bone, 2 ]; } - + ty += _hh; if(!ds_stack_empty(_bst)) { @@ -217,6 +217,10 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var _ind = amo - i - 1; var _inp = input_fix_len + _ind * data_length; var _surf = current_data[_inp]; + var _mesh = is(_surf, RiggedMeshedSurface); + + if(_mesh) _surf = _surf.getSurface(); + var binded = array_safe_get(boneIDMap, _ind, "") != ""; var _bx = _x + _w - 24; @@ -293,9 +297,21 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var tc = _ins? COLORS._main_text_accent : COLORS._main_icon; if(hov) tc = COLORS._main_text; + var _tx = _sx1 + 12; + var _ty = _cy + lh / 2; + + if(_mesh) { + var _mshx = _tx + 6; + var _mshy = _ty; + + draw_sprite_ext(s_node_armature_mesh, 0, _mshx, _mshy, 1, 1, 0, COLORS._main_icon, 1); + + _tx += 22; + } + draw_set_text(f_p2, fa_left, fa_center, tc); draw_set_alpha(aa); - draw_text_add(_sx1 + 12, _cy + lh / 2, inputs[_inp].name); + draw_text_add(_tx, _ty, inputs[_inp].name); draw_set_alpha(1); if(_hover && point_in_rectangle(_m[0], _m[1], _x, _cy, _x + _w, _cy + lh)) { @@ -479,7 +495,6 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr bone.draw(attributes, false, _x + _dpos[0] * _s, _y + _dpos[1] * _s, _s * _dsca, _mx, _my, anchor_selecting); inputs[3].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); - //inputs[4].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); var mx = (_mx - _x) / _s; var my = (_my - _y) / _s; @@ -576,6 +591,14 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr for(var i = 0; i < amo; i++) { var index = input_fix_len + i * data_length; var _surf = array_safe_get_fast(current_data, index); + + if(is(_surf, RiggedMeshedSurface)) { + var _mesh = _surf.mesh; + for(var j = 0; j < array_length(_mesh.links); j++) + _mesh.links[j].draw(_x, _y, _s); + continue; + } + if(!_surf || is_array(_surf)) continue; var _bone = array_safe_get(boneIDMap, i, ""); @@ -740,11 +763,69 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr inputs[2].setVisible(_dim_type == COMPOSE_OUTPUT_SCALING.constant); for( var i = input_fix_len, n = array_length(inputs); i < n; i += data_length ) { - inputs[i + 3].setVisible(current_data[i + 2]); - inputs[i + 5].setVisible(current_data[i + 4]); + inputs[i + 3].setVisible(getInputData(i + 2)); + inputs[i + 5].setVisible(getInputData(i + 4)); } } + static meshBind = function(_s, _bg) { + _mesh = _s.mesh; + _rmap = _s.rigMap; + _surf = _s.getSurface(); + if(!is_surface(_surf)) return; + + _rbon = _s.boneMap == noone? boneMap : _s.boneMap; + _rbid = struct_get_names(_rmap); + _rbidL = array_length(_rbid); + _ar = [ 0, 0 ]; + + array_foreach(_mesh.points, function(_p, i) /*=>*/ { + if(!is(_p, MeshedPoint)) return; + + var _px = _p.sx; + var _py = _p.sy; + + for( var j = 0; j < _rbidL; j++ ) { + var _rBoneID = _rbid[j]; + if(!ds_map_exists(boneMap, _rBoneID)) continue; + + var _rmapp = _rmap[$ _rBoneID]; + var _weight = array_safe_get_fast(_rmapp, i, 0); + if(_weight == 0) continue; + + var _bm = _rbon[? _rBoneID]; + var _b = boneMap[? _rBoneID]; + + var _ax = _p.sx - _bm.bone_head_pose.x; + var _ay = _p.sy - _bm.bone_head_pose.y; + + point_rotate_origin(_ax, _ay, _b.pose_angle - _bm.pose_angle, _ar); + var _nx = _b.bone_head_pose.x + _ar[0] * _b.pose_scale / _bm.pose_scale; + var _ny = _b.bone_head_pose.y + _ar[1] * _b.pose_scale / _bm.pose_scale; + + var _dx = _nx - _p.sx; + var _dy = _ny - _p.sy; + + _px += _dx * _weight; + _py += _dy * _weight; + } + + _p.x = _px; + _p.y = _py; + }); + + surface_set_shader(temp_surface[!_bg], sh_sample, false, BLEND.alphamulp); + draw_set_color(c_white); + draw_set_alpha(1); + + array_foreach(_mesh.tris, function(_t) /*=>*/ { _t.drawSurface(_surf); }); + surface_reset_shader(); + + surface_set_shader(temp_surface[_bg], noone, true, BLEND.over); + draw_surface(temp_surface[!_bg], 0, 0); + surface_reset_shader(); + } + static processData = function(_outData, _data, _output_index, _array_index) { var atlas_data = []; var bind_data = []; @@ -772,26 +853,27 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr } var use_data = _bind != noone; - var res_index = 0; - var bg = 0; var imageAmo = use_data? array_length(_bind) : (array_length(inputs) - input_fix_len) / data_length; var _vis = attributes.layer_visible; - var _bg = 0, _s; + var _bg = 0, _s, _i; for(var i = 0; i < imageAmo; i++) { - var vis = array_safe_get_fast(_vis, i, true); - if(!vis) continue; + if(!array_safe_get_fast(_vis, i, true)) continue; - var datInd = input_fix_len + i * data_length; + _i = input_fix_len + i * data_length; _s = noone; if(use_data) { - var _bindData = array_safe_get(_bind, i); - if(is_instanceof(_bindData, __armature_bind_data)) - _s = _bindData.surface.get(); - - } else { - _s = array_safe_get(_data, datInd); + var _bdat = array_safe_get_fast(_bind, i); + if(is(_bdat, __armature_bind_data)) + _s = _bdat.surface.get(); + + } else + _s = array_safe_get_fast(_data, _i); + + if(is(_s, RiggedMeshedSurface)) { + meshBind(_s, _bg); + continue; } if(!is_surface(_s)) continue; @@ -801,11 +883,11 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr _b = boneMap[? _b]; - var _tran = use_data? _bind[i].transform : _data[datInd + 1]; - var _aang = use_data? _bind[i].applyRot : _data[datInd + 2]; - var _pang = use_data? _bind[i].applyRotl : _data[datInd + 3]; - var _asca = use_data? _bind[i].applySca : _data[datInd + 4]; - var _psca = use_data? _bind[i].applyScal : _data[datInd + 5]; + var _tran = use_data? _bind[i].transform : _data[_i + 1]; + var _aang = use_data? _bind[i].applyRot : _data[_i + 2]; + var _pang = use_data? _bind[i].applyRotl : _data[_i + 3]; + var _asca = use_data? _bind[i].applySca : _data[_i + 4]; + var _psca = use_data? _bind[i].applyScal : _data[_i + 5]; var _rot = _aang * (_pang? _b.angle : _b.pose_local_angle) + _tran[TRANSFORM.rot]; var _anc = _b.getPoint(0.5); @@ -871,10 +953,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr } static attributeSerialize = function() { - var att = { - boneIDMap, - }; - + var att = { boneIDMap }; return att; } diff --git a/scripts/node_armature_mesh_rig/node_armature_mesh_rig.gml b/scripts/node_armature_mesh_rig/node_armature_mesh_rig.gml index bcf3ffd9b..c5e377698 100644 --- a/scripts/node_armature_mesh_rig/node_armature_mesh_rig.gml +++ b/scripts/node_armature_mesh_rig/node_armature_mesh_rig.gml @@ -1,8 +1,11 @@ -function RiggedMeshedSurface() constructor { - mesh = noone; - rigMap = {}; +function RiggedMeshedSurface() : dynaSurf() constructor { + mesh = noone; + bone = noone; + boneMap = noone; + rigMap = {}; - static getSurface = function() { return mesh == noone? noone : mesh.surface; } + static getSurface = function() { return mesh == noone? noone : mesh.surface; } + static getSurfacePreview = function() { return getSurface(); } } function Node_Armature_Mesh_Rig(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { @@ -18,58 +21,354 @@ function Node_Armature_Mesh_Rig(_x, _y, _group = noone) : Node(_x, _y, _group) c newInput(2, nodeValue_Trigger("Autoweight", self, false )) .setDisplay(VALUE_DISPLAY.button, { name: "Auto weight", UI : true, onClick: function() /*=>*/ {return AutoWeightPaint()} }); + newInput(3, nodeValue_Float("Radius", self, 8)) + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - newOutput(0, nodeValue_Output("Rigged mesh", self, VALUE_TYPE.mesh, noone)); + newOutput(0, nodeValue_Output("Rigged Surface", self, VALUE_TYPE.dynaSurface, noone)); - rigdata = {}; + bone_posed = noone; + rigdata = noone; + anchor_selecting = noone; - static AutoWeightPaint = function() { - var _bones = inputs[0].getValue(); + attributes.bonePoseData = {}; + attributes.rigBones = noone; + attributes.display_name = true; + attributes.display_bone = 0; + + array_push(attributeEditors, "Display"); + array_push(attributeEditors, ["Display name", function() /*=>*/ {return attributes.display_name}, new checkBox(function() /*=>*/ { attributes.display_name = !attributes.display_name; })]); + array_push(attributeEditors, ["Display bone", function() /*=>*/ {return attributes.display_bone}, new scrollBox(["Octahedral", "Stick"], function(ind) /*=>*/ { attributes.display_bone = ind; })]); + + tools = [ + new NodeTool( "Pose", THEME.bone_tool_pose ) + ]; + + layer_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { + var _b = inputs[0].getValue(); + if(_b == noone) return 0; + + var amo = _b.childCount(); + var _hh = ui(28); + var bh = ui(32 + 16) + amo * _hh; + var ty = _y; + + draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); + draw_text_add(_x + ui(16), ty + ui(4), __txt("Bones")); + ty += ui(28); + + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, ty, _w, bh - ui(32), COLORS.node_composite_bg_blend, 1); + ty += ui(8); + + var hovering = noone; + var _bst = ds_stack_create(); + ds_stack_push(_bst, [ _b, _x, _w ]); + + anchor_selecting = noone; + + while(!ds_stack_empty(_bst)) { + var _st = ds_stack_pop(_bst); + var _bone = _st[0]; + var __x = _st[1]; + var __w = _st[2]; + var _sel = attributes.rigBones == noone? true : array_exists(attributes.rigBones, _bone.ID); + + for( var i = 0, n = array_length(_bone.childs); i < n; i++ ) + ds_stack_push(_bst, [ _bone.childs[i], __x + 16, __w - 16 ]); + + if(_bone.is_main) continue; + var _dx = __x + ui(24); + + draw_sprite_stretched_ext(THEME.checkbox_def, 0, _x + ui(16), ty + ui(4), ui(20), ui(20), c_white); + if(_sel) draw_sprite_stretched_ext(THEME.checkbox_def, 2, _x + ui(16), ty + ui(4), ui(20), ui(20), COLORS._main_accent); + + if(_bone.parent_anchor) draw_sprite_ui(THEME.bone, 1, _dx + 12, ty + 14,,,, COLORS._main_icon); + else if(_bone.IKlength) draw_sprite_ui(THEME.bone, 2, _dx + 12, ty + 14,,,, COLORS._main_icon); + else draw_sprite_ui(THEME.bone, 0, _dx + 12, ty + 14,,,, COLORS._main_icon); + + draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text); + draw_text_add(_dx + 24, ty + 12, _bone.name); + + var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, ty, _x + _w, ty + _hh - 1); + + if(_hov) { + anchor_selecting = [ _bone, 2 ]; + + if(mouse_press(mb_left, _focus)) { + if(attributes.rigBones == noone) + attributes.rigBones = [ _bone.ID ]; + else { + if(array_exists(attributes.rigBones, _bone.ID)) + array_remove(attributes.rigBones, _bone.ID); + else + array_push(attributes.rigBones, _bone.ID); + } + } + } + + ty += _hh; + + if(!ds_stack_empty(_bst)) { + draw_set_color(COLORS.node_composite_separator); + draw_line(_x + 16, ty, _x + _w - 16, ty); + } + } + + ds_stack_destroy(_bst); + + layer_renderer.h = bh; + return layer_renderer.h; + + }); + + input_display_list = [ 0, 1, + ["Autoweight", false], 2, 3, + ["Armature", false], layer_renderer, + ]; + + anchor_selecting = noone; + posing_bone = noone; + posing_input = 0; + posing_type = 0; + posing_sx = 0; + posing_sy = 0; + posing_sz = 0; + posing_mx = 0; + posing_my = 0; + + static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { + var _bones = inputs[0].getValue(); + var _mesh = inputs[1].getValue(); + + if(_mesh != noone) { + __weights = anchor_selecting == noone? noone : struct_try_get(rigdata, anchor_selecting[0].ID, noone); + __x = _x; + __y = _y; + __s = _s; + + draw_set_circle_precision(4); + + if(__weights == noone) { + array_foreach(_mesh.points, function(_p) /*=>*/ { + if(!is(_p, MeshedPoint)) return; + + _p.drx = __x + _p.x * __s; + _p.dry = __y + _p.y * __s; + _p.color = COLORS._main_accent; + + draw_set_color(_p.color); + draw_circle(_p.drx, _p.dry, 2, false); + }); + + } else { + array_foreach(_mesh.points, function(_p, i) /*=>*/ { + if(!is(_p, MeshedPoint)) return; + + _p.drx = __x + _p.x * __s; + _p.dry = __y + _p.y * __s; + var _w = array_safe_get_fast(__weights, i); + _p.color = merge_color(COLORS._main_accent, c_white, _w); + + draw_set_color(_p.color); + draw_circle(_p.drx, _p.dry, 2, false); + }); + } + + draw_set_alpha(.5); + array_foreach(_mesh.links, function(_l) /*=>*/ { + var _p0 = _l.p0; + var _p1 = _l.p1; + var _c0 = _p0.color; + var _c1 = _p1.color; + + draw_line_color(_p0.drx, _p0.dry, _p1.drx, _p1.dry, _c0, _c1); + }); + draw_set_alpha(1); + + } + + if(bone_posed == noone) return; + + if(isUsingTool("Pose")) { + anchor_selecting = bone_posed.draw(attributes, active * 0b111, _x, _y, _s, _mx, _my, anchor_selecting, posing_bone); + + var mx = (_mx - _x) / _s; + var my = (_my - _y) / _s; + + var smx = value_snap(mx, _snx); + var smy = value_snap(my, _sny); + + if(posing_bone) { + if(posing_type == 0 && posing_bone.parent) { //move + var ang = posing_bone.parent.pose_angle; + var pp = point_rotate(smx - posing_mx, smy - posing_my, 0, 0, -ang); + var bx = posing_sx + pp[0]; + var by = posing_sy + pp[1]; + + posing_input[TRANSFORM.pos_x] = bx; + posing_input[TRANSFORM.pos_y] = by; + triggerRender(); + + } else if(posing_type == 1) { //scale + var ss = point_distance(posing_mx, posing_my, smx, smy) / posing_sx; + var ori = posing_bone.getHead(); + var ang = point_direction(ori.x, ori.y, smx, smy); + var rot = ang - posing_sy - posing_bone.parent.pose_angle; + + posing_input[TRANSFORM.sca_x] = ss; + posing_input[TRANSFORM.rot] = rot; + triggerRender(); + + } else if(posing_type == 2) { //rotate + var ori = posing_bone.getHead(); + var ang = point_direction(ori.x, ori.y, mx, my); + var rot = angle_difference(ang, posing_sy); + posing_sy = ang; + posing_sx += rot; + + posing_input[TRANSFORM.rot] = posing_sx; + triggerRender(); + } + + if(mouse_release(mb_left)) { + posing_bone = noone; + posing_type = noone; + UNDO_HOLDING = false; + } + } + + if(anchor_selecting != noone && mouse_press(mb_left, active)) { + posing_bone = anchor_selecting[0]; + if(!struct_has(attributes.bonePoseData, posing_bone.ID)) + attributes.bonePoseData[$ posing_bone.ID] = [ 0, 0, 0, 1, 1 ]; + posing_input = attributes.bonePoseData[$ posing_bone.ID]; + + if(anchor_selecting[1] == 0 || anchor_selecting[0].IKlength) { // move + + posing_type = 0; + + posing_sx = posing_input[TRANSFORM.pos_x]; + posing_sy = posing_input[TRANSFORM.pos_y]; + + var _p = anchor_selecting[2]; + posing_mx = _p.x; + posing_my = _p.y; + + } else if(anchor_selecting[1] == 1) { // scale + + posing_type = 1; + + var ori = posing_bone.getHead(); + posing_sx = posing_bone.length / posing_bone.pose_scale * posing_bone.parent.pose_scale; + posing_sy = posing_bone.angle - posing_bone.pose_local_angle; + posing_sz = point_direction(ori.x, ori.y, smx, smy); + + var pnt = posing_bone.getHead(); + posing_mx = pnt.x; + posing_my = pnt.y; + + } else if(anchor_selecting[1] == 2) { // rotate + + posing_type = 2; + + var ori = posing_bone.getHead(); + posing_sx = posing_input[TRANSFORM.rot]; + posing_sy = point_direction(ori.x, ori.y, mx, my); + + posing_mx = mx; + posing_my = my; + } + } + return; + } + + var _boneArr = bone_posed.toArray(); + + for( var i = 0, n = array_length(_boneArr); i < n; i++ ) { + var _b = _boneArr[i]; + var _l = attributes.rigBones == noone || array_exists(attributes.rigBones, _b.ID); + _b.__drawBoneUI(attributes, false, _x, _y, _s, _mx, _my, anchor_selecting, noone, c_white, 0.25 + _l * 0.75); + } + } + + static AutoWeightPaint = function(_render = true) { var _mesh = inputs[1].getValue(); + var _rad = inputs[3].getValue(); - if(!is(_bones, __Bone)) return; + if(!is(bone_posed, __Bone)) return; if(!is(_mesh, MeshedSurface)) return; rigdata = {}; - var _boneArr = _bones.toArray(); - var _boneDat = array_create(array_length(_boneArr)); + var _pnts = _mesh.points; + var _plen = array_length(_pnts); + + var _boneArr = bone_posed.toArray(); + var _boneDat = []; for( var i = 0, n = array_length(_boneArr); i < n; i++ ) { var _b = _boneArr[i]; + if(attributes.rigBones != noone && !array_exists(attributes.rigBones, _b.ID)) continue; - _boneDat[i] = { + array_push(_boneDat, { b : _b, ID : _b.ID, - p0 : _b.getPoint(0), - p1 : _b.getPoint(1), - }; + p0 : _b.getHead(), + p1 : _b.getTail(), + }); + + rigdata[$ _b.ID] = array_create(_plen, 0); } - var _pnts = _mesh.points; - for( var i = 0, n = array_length(_pnts); i < n; i++ ) { var _p = _pnts[i]; + if(!is(_p, MeshedPoint)) continue; + var _px = _p.x; var _py = _p.y; var _minDist = 9999; var _minBone = noone; + var _boneWi = array_create(array_length(_boneDat), 0); for( var j = 0, m = array_length(_boneDat); j < m; j++ ) { var _b = _boneDat[j]; - var _dist = distance_to_line(_px, _py, _b.p0.x, _b.p0.y, _b.p1.x, _b.p1.y); + var _dist = distance_to_line(_px, _py, _b.p0.x, _b.p0.y, _b.p1.x, _b.p1.y); + _boneWi[j] = _dist; + if(_dist < _minDist) { _minDist = _dist; - _minBone = _b; + _minBone = _b.ID; } } + if(_minBone == noone) continue; + + if(_minDist >= _rad) { + rigdata[$ _minBone][i] = 1; + continue; + } + + var _totalWeight = 0; + for( var j = 0, m = array_length(_boneDat); j < m; j++ ) { + _boneWi[j] = max(_rad - _boneWi[j], 0); + _totalWeight += _boneWi[j]; + } + + for( var j = 0, m = array_length(_boneDat); j < m; j++ ) { + _boneWi[j] /= _totalWeight; + var _b = _boneDat[j]; + + rigdata[$ _b.ID][i] = _boneWi[j]; + } } + + if(_render) triggerRender(); } + current_bone = noone; + static update = function() { var _bones = inputs[0].getValue(); var _mesh = inputs[1].getValue(); @@ -77,10 +376,49 @@ function Node_Armature_Mesh_Rig(_x, _y, _group = noone) : Node(_x, _y, _group) c if(!is(_bones, __Bone)) return; if(!is(_mesh, MeshedSurface)) return; - var _meshRigged = new RiggedMeshedSurface(); - _meshRigged.mesh = _mesh; - _meshRigged.rigMap = rigdata; + var _map = ds_map_create(); + + bone_posed = _bones.clone(); + current_bone = _bones; + + bone_posed.connect(); + bone_posed.resetPose(); + + var _barr = bone_posed.toArray(); + for( var i = 0, n = array_length(_barr); i < n; i++ ) { + var _b = _barr[i]; + + _map[? _b.ID] = _b; + if(!struct_has(attributes.bonePoseData, _b.ID)) continue; + + var _trn = attributes.bonePoseData[$ _b.ID]; + _b.pose_posit = [ _trn[TRANSFORM.pos_x], _trn[TRANSFORM.pos_y] ]; + _b.pose_angle = _trn[TRANSFORM.rot]; + _b.pose_scale = _trn[TRANSFORM.sca_x]; + } + + bone_posed.setPose(,,, false); + + if(rigdata == noone) AutoWeightPaint(false); + + var _meshRigged = new RiggedMeshedSurface(); + _meshRigged.rigMap = rigdata; + _meshRigged.mesh = _mesh.clone(); + _meshRigged.bone = bone_posed; + _meshRigged.boneMap = _map; outputs[0].setValue(_meshRigged); } + + static getGraphPreviewSurface = function() { return noone; } + + static getPreviewValues = function() { + var _mesh = inputs[1].getValue(); + return is(_mesh, MeshedSurface)? _mesh.surface : noone; + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + var bbox = drawGetBbox(xx, yy, _s); + draw_sprite_fit(s_node_armature_mesh_rig, 0, bbox.xc, bbox.yc, bbox.w, bbox.h); + } } \ No newline at end of file diff --git a/scripts/node_armature_path/node_armature_path.gml b/scripts/node_armature_path/node_armature_path.gml index 37fe0de42..66d2bb4d7 100644 --- a/scripts/node_armature_path/node_armature_path.gml +++ b/scripts/node_armature_path/node_armature_path.gml @@ -84,14 +84,14 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const if(bone.IKlength) continue; if(!bone.is_main) { - var _p0 = bone.getPoint(0); - var _p1 = bone.getPoint(1); + var _p0 = bone.getHead(); + var _p1 = bone.getTail(); array_push(lines, [ [_p0.x, _p0.y, 1], [_p1.x, _p1.y, 1], ]); - + current_length += point_distance(_p0.x, _p0.y, _p1.x, _p1.y); } diff --git a/scripts/node_armature_pose/node_armature_pose.gml b/scripts/node_armature_pose/node_armature_pose.gml index 90221cf31..1183b8593 100644 --- a/scripts/node_armature_pose/node_armature_pose.gml +++ b/scripts/node_armature_pose/node_armature_pose.gml @@ -92,14 +92,14 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const tools = []; anchor_selecting = noone; - posing_bone = noone; - posing_input = 0; - posing_type = 0; - posing_sx = 0; - posing_sy = 0; - posing_sz = 0; - posing_mx = 0; - posing_my = 0; + posing_bone = noone; + posing_input = 0; + posing_type = 0; + posing_sx = 0; + posing_sy = 0; + posing_sz = 0; + posing_mx = 0; + posing_my = 0; static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { var _b = outputs[0].getValue(); @@ -129,7 +129,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const } else if(posing_type == 1) { //scale var ss = point_distance(posing_mx, posing_my, smx, smy) / posing_sx; - var ori = posing_bone.getPoint(0); + var ori = posing_bone.getHead(); var ang = point_direction(ori.x, ori.y, smx, smy); var rot = ang - posing_sy - posing_bone.parent.pose_angle; @@ -141,7 +141,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const UNDO_HOLDING = true; } else if(posing_type == 2) { //rotate - var ori = posing_bone.getPoint(0); + var ori = posing_bone.getHead(); var ang = point_direction(ori.x, ori.y, mx, my); var rot = angle_difference(ang, posing_sy); posing_sy = ang; @@ -162,11 +162,12 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const } if(anchor_selecting != noone && mouse_press(mb_left, active)) { + posing_bone = anchor_selecting[0]; + if(!ds_map_exists(boneMap, posing_bone.ID)) setBone(); + posing_input = boneMap[? posing_bone.ID]; + if(anchor_selecting[1] == 0 || anchor_selecting[0].IKlength) { // move - posing_bone = anchor_selecting[0]; - if(!ds_map_exists(boneMap, posing_bone.ID)) - setBone(); - posing_input = boneMap[? posing_bone.ID]; + posing_type = 0; var val = posing_input.getValue(); @@ -174,34 +175,28 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const posing_sy = val[TRANSFORM.pos_y]; var _p = anchor_selecting[2]; - posing_mx = (_p.x - _x) / _s; - posing_my = (_p.y - _y) / _s; + posing_mx = _p.x; + posing_my = _p.y; } else if(anchor_selecting[1] == 1) { // scale - posing_bone = anchor_selecting[0]; - if(!ds_map_exists(boneMap, posing_bone.ID)) - setBone(); - posing_input = boneMap[? posing_bone.ID]; + posing_type = 1; - var ori = posing_bone.getPoint(0); + var ori = posing_bone.getHead(); var val = posing_input.getValue(); posing_sx = posing_bone.length / posing_bone.pose_scale * posing_bone.parent.pose_scale; posing_sy = posing_bone.angle - posing_bone.pose_local_angle; posing_sz = point_direction(ori.x, ori.y, smx, smy); - var pnt = posing_bone.getPoint(0); + var pnt = posing_bone.getHead(); posing_mx = pnt.x; posing_my = pnt.y; } else if(anchor_selecting[1] == 2) { // rotate - posing_bone = anchor_selecting[0]; - if(!ds_map_exists(boneMap, posing_bone.ID)) - setBone(); - posing_input = boneMap[? posing_bone.ID]; + posing_type = 2; - var ori = posing_bone.getPoint(0); + var ori = posing_bone.getHead(); var val = posing_input.getValue(); posing_sx = val[TRANSFORM.rot]; posing_sy = point_direction(ori.x, ori.y, mx, my); @@ -232,8 +227,8 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const var _bone_pose = _b.clone(); _bone_pose.connect(); - _bone_pose.resetPose(); + var _bst = ds_stack_create(); ds_stack_push(_bst, _bone_pose); @@ -257,6 +252,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const } ds_stack_destroy(_bst); + _bone_pose.setPose(); outputs[0].setValue(_bone_pose); @@ -278,8 +274,8 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const var __b = ds_stack_pop(_bst); for( var i = 0, n = array_length(__b.childs); i < n; i++ ) { - var p0 = __b.childs[i].getPoint(0); - var p1 = __b.childs[i].getPoint(1); + var p0 = __b.childs[i].getHead(); + var p1 = __b.childs[i].getTail(); minx = min(minx, p0.x); miny = min(miny, p0.y); maxx = max(maxx, p0.x); maxy = max(maxy, p0.y); diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 3524548de..31d903d27 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -1101,8 +1101,12 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { static isRenderable = function(log = false) { //Check if every input is ready (updated) if(!active || !isRenderActive()) return false; - for(var j = 0; j < array_length(inputs); j++) - if(!inputs[j].isRendered()) return false; + for(var j = 0; j < array_length(inputs); j++) { + if(!inputs[j].isRendered()) { + LOG_IF(global.FLAG.render == 1, $"→→ x Node {internalName} {inputs[j]} not rendered."); + return false; + } + } return true; } @@ -1201,8 +1205,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { } } - LOG_IF(global.FLAG.render == 1, $"→→ Push {nodeNames} to queue."); - LOG_BLOCK_END(); return nodes; } @@ -1453,11 +1455,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { var tx = xx + 6 * _s; var tw = w * _s - 8 * _s; - if(!previewable) { - tx += _s * 4; - tw -= _s * 4; - } - if(_panel && _panel.is_searching && _panel.search_string != "" && search_match == -9999) aa *= .15; @@ -1482,8 +1479,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { BLEND_NORMAL draw_set_alpha(1); - - // draw_line_width(_tx, _ty, _tx + tw, _ty, 4); } static drawJunctionWidget = function(_x, _y, _mx, _my, _s, _hover, _focus) { diff --git a/scripts/node_mesh_warp/node_mesh_warp.gml b/scripts/node_mesh_warp/node_mesh_warp.gml index ed288eca0..643546794 100644 --- a/scripts/node_mesh_warp/node_mesh_warp.gml +++ b/scripts/node_mesh_warp/node_mesh_warp.gml @@ -4,18 +4,33 @@ function MeshedSurface() constructor { tris = []; links = []; controls = []; + + static clone = function() { + var n = new MeshedSurface(); + n.surface = surface; + n.controls = controls; + + p = array_create_ext(array_length(points), function(i) /*=>*/ { return is(points[i], MeshedPoint)? points[i].clone() : points[i]; }); + n.points = p; + + var l = array_create_ext(array_length(links), function(i) /*=>*/ {return links[i].clone(p)}); + n.links = l; + + var t = array_create_ext(array_length(tris), function(i) /*=>*/ {return tris[i].clone(p)}); + n.tris = t; + + return n; + } } -function MeshedPoint(node, index, _x, _y) constructor { +function MeshedPoint(index, _x, _y) constructor { self.index = index; - self.node = node; + x = _x; y = _y; xp = x; yp = y; - node.points[index] = self; - ndx = 0; ndy = 0; @@ -26,6 +41,12 @@ function MeshedPoint(node, index, _x, _y) constructor { u = 0; v = 0; + drx = 0; + dry = 0; + + weight = 0; + color = c_white; + controlWeights = []; static reset = function(_mesh_data) { @@ -49,6 +70,8 @@ function MeshedPoint(node, index, _x, _y) constructor { } static draw = function(_x, _y, _s) { + draw_set_circle_precision(4); + if(pin) { draw_set_color(COLORS._main_accent); draw_circle_prec(_x + x * _s, _y + y * _s, 3, false); @@ -67,6 +90,14 @@ function MeshedPoint(node, index, _x, _y) constructor { static setPin = function(pin) { self.pin = pin; } static equal = function(point) { return x == point.x && y == point.y; } + + static clone = function() { + var p = new MeshedPoint(index, x, y); + p.u = u; + p.v = v; + + return p; + } } function MeshedLink(_p0, _p1, _k = 1) constructor { @@ -94,9 +125,15 @@ function MeshedLink(_p0, _p1, _k = 1) constructor { static draw = function(_x, _y, _s) { INLINE - draw_set_color(c_red); + draw_set_color(COLORS._main_accent); draw_line(_x + p0.x * _s, _y + p0.y * _s, _x + p1.x * _s, _y + p1.y * _s); } + + static clone = function(pointArr) { + var _p0 = pointArr[p0.index]; + var _p1 = pointArr[p1.index]; + return new MeshedLink(_p0, _p1, k); + } } function MeshedTriangle(_p0, _p1, _p2) constructor { @@ -143,9 +180,16 @@ function MeshedTriangle(_p0, _p1, _p2) constructor { static contain = function(p) { INLINE - return p == p0 || p == p1 || p == p2; } + + static clone = function(pointArr) { + var _p0 = pointArr[p0.index]; + var _p1 = pointArr[p1.index]; + var _p2 = pointArr[p2.index]; + + return new MeshedTriangle(_p0, _p1, _p2); + } } function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { @@ -497,7 +541,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var px = min(j * gw, ww); var py = min(i * gh, hh); - mesh_data.points[i * _sam + j] = new MeshedPoint(self, ind++, px, py); + mesh_data.points[i * _sam + j] = new MeshedPoint(i * _sam + j, px, py); if(i == 0) continue; if(j && mesh_data.points[(i - 1) * _sam + j] != 0 && mesh_data.points[i * _sam + j - 1] != 0) @@ -583,9 +627,10 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) mesh_data.points = array_create(_mb + array_length(_p)); for( var i = 0, n = _mb; i < n; i++ ) - mesh_data.points[i] = new MeshedPoint(self, ind++, _m[i][0], _m[i][1]); + mesh_data.points[i] = new MeshedPoint(i, _m[i][0], _m[i][1]); + for( var i = 0, n = array_length(_p); i < n; i++ ) - mesh_data.points[_mb + i] = new MeshedPoint(self, ind++, _p[i][0], _p[i][1]); + mesh_data.points[_mb + i] = new MeshedPoint(_mb + i, _p[i][0], _p[i][1]); var _t = delaunay_triangulation(mesh_data.points); @@ -599,7 +644,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) } } - static Mesh_build = function() { + static Mesh_build = function(_render = true) { var _inSurf = getInputData(0); var _type = getInputData(8); @@ -614,7 +659,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) for(var i = 0; i < array_length(mesh_data.tris); i++) mesh_data.tris[i].initSurface(is_array(_inSurf)? _inSurf[0] : _inSurf); - triggerRender(); + if(_render) triggerRender(); if(loadPin != noone) { for( var i = 0, n = array_length(loadPin); i < n; i++ ) { @@ -709,7 +754,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) static processData = function(_outData, _data, _output_index, _array_index) { if(will_triangluate) { - Mesh_build(); + Mesh_build(false); will_triangluate = false; } diff --git a/scripts/node_pin/node_pin.gml b/scripts/node_pin/node_pin.gml index 20a395b1f..265dc6c38 100644 --- a/scripts/node_pin/node_pin.gml +++ b/scripts/node_pin/node_pin.gml @@ -79,6 +79,7 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { var jhov = hover.drawJunction(_s, _mx, _my); if(!isHovering) return noone; + if(!jhov) draw_sprite_ext(THEME.view_pan, 0, _mx + ui(16), _my + ui(24), 1, 1, 0, COLORS._main_accent); hover_junction = jhov? hover : noone; hover_scale_to = 1; diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index e0cafe7fc..a7fb9712b 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -861,11 +861,12 @@ function __initNodes() { addNodeObject(compose, "Pack Sprites", s_node_pack_sprite, "Node_Pack_Sprites", [1, Node_Pack_Sprites],, "Combine array of images with different dimension using different algorithms.").setVersion(1140); ds_list_add(compose, "Armature"); - addNodeObject(compose, "Armature Create", s_node_armature_create, "Node_Armature", [1, Node_Armature], ["rigging", "bone"], "Create new armature system.").setVersion(1146); - addNodeObject(compose, "Armature Pose", s_node_armature_pose, "Node_Armature_Pose", [1, Node_Armature_Pose], ["rigging", "bone"], "Pose armature system.").setVersion(1146); - addNodeObject(compose, "Armature Bind", s_node_armature_bind, "Node_Armature_Bind", [1, Node_Armature_Bind], ["rigging", "bone"], "Bind and render image to an armature system.").setVersion(1146); - addNodeObject(compose, "Armature Path", s_node_armature_path, "Node_Armature_Path", [1, Node_Armature_Path], ["rigging", "bone"], "Generate path from armature system.").setVersion(1146); - addNodeObject(compose, "Armature Sample", s_node_armature_sample, "Node_Armature_Sample", [1, Node_Armature_Sample], ["rigging", "bone"], "Sample point from armature system.").setVersion(1147); + addNodeObject(compose, "Armature Create", s_node_armature_create, "Node_Armature", [1, Node_Armature], ["rigging", "bone"], "Create new armature system.").setVersion(1146); + addNodeObject(compose, "Armature Pose", s_node_armature_pose, "Node_Armature_Pose", [1, Node_Armature_Pose], ["rigging", "bone"], "Pose armature system.").setVersion(1146); + addNodeObject(compose, "Armature Bind", s_node_armature_bind, "Node_Armature_Bind", [1, Node_Armature_Bind], ["rigging", "bone"], "Bind and render image to an armature system.").setVersion(1146); + addNodeObject(compose, "Armature Path", s_node_armature_path, "Node_Armature_Path", [1, Node_Armature_Path], ["rigging", "bone"], "Generate path from armature system.").setVersion(1146); + addNodeObject(compose, "Armature Mesh Rig", s_node_armature_mesh_rig, "Node_Armature_Mesh_Rig", [1, Node_Armature_Mesh_Rig], ["rigging", "bone"], "Rig mesh to armature system.").setVersion(1_18_04_0); + addNodeObject(compose, "Armature Sample", s_node_armature_sample, "Node_Armature_Sample", [1, Node_Armature_Sample], ["rigging", "bone"], "Sample point from armature system.").setVersion(1147); if(!DEMO) { ds_list_add(compose, "Export"); diff --git a/scripts/node_tunnel_in/node_tunnel_in.gml b/scripts/node_tunnel_in/node_tunnel_in.gml index 271aa1fe8..d5b7e3914 100644 --- a/scripts/node_tunnel_in/node_tunnel_in.gml +++ b/scripts/node_tunnel_in/node_tunnel_in.gml @@ -201,9 +201,12 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct isHovering = point_in_circle(_mx, _my, xx, yy, _s * 24); junction_hover = inputs[1].drawJunction(_s, _mx, _my); + if(!isHovering) return noone; + if(!junction_hover) draw_sprite_ext(THEME.view_pan, 0, _mx + ui(16), _my + ui(24), 1, 1, 0, COLORS._main_accent); hover_scale_to = 1; + return junction_hover? inputs[1] : noone; } diff --git a/scripts/node_tunnel_out/node_tunnel_out.gml b/scripts/node_tunnel_out/node_tunnel_out.gml index dd66dd8c0..3ea753fb6 100644 --- a/scripts/node_tunnel_out/node_tunnel_out.gml +++ b/scripts/node_tunnel_out/node_tunnel_out.gml @@ -126,7 +126,9 @@ function Node_Tunnel_Out(_x, _y, _group = noone) : Node(_x, _y, _group) construc isHovering = point_in_circle(_mx, _my, xx, yy, _s * 24); junction_hover = outputs[0].drawJunction(_s, _mx, _my); + if(!isHovering) return noone; + if(!junction_hover) draw_sprite_ext(THEME.view_pan, 0, _mx + ui(16), _my + ui(24), 1, 1, 0, COLORS._main_accent); hover_scale_to = 1; return junction_hover? outputs[0] : noone; diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index cf2f5693b..a2c860df8 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -993,11 +993,13 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru extract_node = "Node_Canvas"; break; - case VALUE_TYPE.pathnode : editWidget = new pathnodeBox(self); extract_node = "Node_Path"; break; - case VALUE_TYPE.tileset : editWidget = new tilesetBox(self); extract_node = "Node_Tile_Tileset"; break; - case VALUE_TYPE.armature : editWidget = new armatureBox(self); break; - case VALUE_TYPE.struct : editWidget = new outputStructBox(); break; - case VALUE_TYPE.particle : editWidget = noone; break; + case VALUE_TYPE.dynaSurface : editWidget = new surfaceDynaBox(); break; + case VALUE_TYPE.pathnode : editWidget = new pathnodeBox(self); extract_node = "Node_Path"; break; + case VALUE_TYPE.tileset : editWidget = new tilesetBox(self); extract_node = "Node_Tile_Tileset"; break; + case VALUE_TYPE.armature : editWidget = new armatureBox(self); break; + case VALUE_TYPE.mesh : editWidget = new meshBox(self); break; + case VALUE_TYPE.struct : editWidget = new outputStructBox(); break; + case VALUE_TYPE.particle : editWidget = noone; break; default : editWidget = new outputBox(); break; } @@ -1022,8 +1024,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static isRendered = function() { if(type == VALUE_TYPE.node) return true; - - if(value_from == noone) return true; + if(value_from == noone) return true; var controlNode = value_from.from? value_from.from : value_from.node; if(!controlNode.active) return true; @@ -2464,7 +2465,7 @@ function drawJuncConnection(from, to, params) { switch(PREFERENCES.curve_connection_line) { case 0 : if(downDirection) _hdist = distance_to_line(mx, my, jx, jy, frx, fry); - else _hdist = distance_to_linear_connection(mx, my, jx, jy, frx, fry, _s, _drawParam); + else _hdist = distance_to_linear_connection(mx, my, frx, fry, jx, jy, _s, _drawParam); break; case 1 : diff --git a/scripts/point_rotate/point_rotate.gml b/scripts/point_rotate/point_rotate.gml index af96c60ec..251028c0b 100644 --- a/scripts/point_rotate/point_rotate.gml +++ b/scripts/point_rotate/point_rotate.gml @@ -4,24 +4,33 @@ function point_rotate(px, py, ox, oy, a, p = undefined) { p ??= [ px, py ]; a = angle_difference(a, 0); - if(a == 0) { - p[0] = px; - p[1] = py; - return p; - } - - if(a == 180) { - p[0] = ox + (ox - px); - p[1] = oy + (oy - py); - return p; - } + if(a == 0) { p[0] = px; p[1] = py; return p; } + else if(a == 180) { p[0] = ox + (ox - px); p[1] = oy + (oy - py); return p; } var cx = px - ox; var cy = py - oy; - var d = -degtorad(a); - p[0] = ox + cx * cos(d) - cy * sin(d); - p[1] = oy + cx * sin(d) + cy * cos(d); + var dc = dcos(-a); + var ds = dsin(-a); + + p[0] = ox + cx * dc - cy * ds; + p[1] = oy + cx * ds + cy * dc; + + return p; +} + +function point_rotate_origin(px, py, a, p) { + INLINE + + a = angle_difference(a, 0); + if(a == 0) { p[0] = px; p[1] = py; return p; } + else if(a == 180) { p[0] = -px; p[1] = -py; return p; } + + var dc = dcos(-a); + var ds = dsin(-a); + + p[0] = px * dc - py * ds; + p[1] = px * ds + py * dc; return p; } \ No newline at end of file diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index 5de9239ba..f34623907 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -243,6 +243,7 @@ function Render(partial = false, runAction = false) { #region if(!is_instanceof(nextNode, __Node_Base)) continue; if(!nextNode.isRenderable()) continue; + LOG_IF(global.FLAG.render == 1, $"→→ Push {nextNode.internalName} to queue."); RENDER_QUEUE.enqueue(nextNode); } diff --git a/scripts/surfaceDynaBox/surfaceDynaBox.gml b/scripts/surfaceDynaBox/surfaceDynaBox.gml new file mode 100644 index 000000000..b048fa5f2 --- /dev/null +++ b/scripts/surfaceDynaBox/surfaceDynaBox.gml @@ -0,0 +1,51 @@ +function surfaceDynaBox() : widget() constructor { + + static trigger = function() {} + + static setInteract = function(interactable) { } + + static drawParam = function(params) { + return draw(params.x, params.y, params.w, params.h, params.data); + } + + static draw = function(_x, _y, _w, _h, _surface) { + x = _x; + y = _y; + w = _w; + h = _h; + + draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h); + if(!is(_surface, dynaSurf)) return h; + + _surface = _surface.getSurfacePreview(); + + var pad = ui(12); + var sw = min(_w - pad, _h - pad); + var sh = sw; + + var sx0 = _x + _w / 2 - sw / 2; + var sx1 = sx0 + sw; + var sy0 = _y + _h / 2 - sh / 2; + var sy1 = sy0 + sh; + + ui_rect(sx0, sy0, sx1, sy1, COLORS.widget_surface_frame); + + if(surface_exists(_surface)) { + var sfw = surface_get_width(_surface); + var sfh = surface_get_height(_surface); + var ss = min(sw / sfw, sh / sfh); + var _sx = sx0 + sw / 2 - ss * sfw / 2; + var _sy = sy0 + sh / 2 - ss * sfh / 2; + + draw_surface_ext_safe(_surface, _sx, _sy, ss, ss, 0, c_white, 1); + } + + resetFocus(); + + return h; + } + + static clone = function() { + return new surfaceDynaBox(); + } +} \ No newline at end of file diff --git a/scripts/surfaceDynaBox/surfaceDynaBox.yy b/scripts/surfaceDynaBox/surfaceDynaBox.yy new file mode 100644 index 000000000..d8577dde3 --- /dev/null +++ b/scripts/surfaceDynaBox/surfaceDynaBox.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"surfaceDynaBox", + "isCompatibility":false, + "isDnD":false, + "name":"surfaceDynaBox", + "parent":{ + "name":"widgets", + "path":"folders/widgets.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/shaders/sh_2d_light_apply/sh_2d_light_apply.fsh b/shaders/sh_2d_light_apply/sh_2d_light_apply.fsh new file mode 100644 index 000000000..16a686dad --- /dev/null +++ b/shaders/sh_2d_light_apply/sh_2d_light_apply.fsh @@ -0,0 +1,12 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform sampler2D base; +uniform sampler2D light; + +void main() { + vec4 b = texture2D( base, v_vTexcoord ); + vec4 l = texture2D( light, v_vTexcoord ); + + gl_FragColor = vec4(b.rgb + l.rgb, b.a); +} diff --git a/shaders/sh_2d_light_apply/sh_2d_light_apply.vsh b/shaders/sh_2d_light_apply/sh_2d_light_apply.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_2d_light_apply/sh_2d_light_apply.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_2d_light_apply/sh_2d_light_apply.yy b/shaders/sh_2d_light_apply/sh_2d_light_apply.yy new file mode 100644 index 000000000..c4a8f6ba6 --- /dev/null +++ b/shaders/sh_2d_light_apply/sh_2d_light_apply.yy @@ -0,0 +1,12 @@ +{ + "$GMShader":"", + "%Name":"sh_2d_light_apply", + "name":"sh_2d_light_apply", + "parent":{ + "name":"generator", + "path":"folders/shader/generator.yy", + }, + "resourceType":"GMShader", + "resourceVersion":"2.0", + "type":1, +} \ No newline at end of file diff --git a/sprites/s_bone_IK/31c83e1e-8539-4edf-a5f1-82ed6726abb6.png b/sprites/s_bone_IK/31c83e1e-8539-4edf-a5f1-82ed6726abb6.png deleted file mode 100644 index 47cae58ca7f3987e5f725d2853bd9846fe9b0a50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 964 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweEpc6VX;4}uH!E}zW6z_i`d#W5t~-rK0R6K5L; z)Si2?U$c>~k8jcI2UZ*}56H?aonyVASwr@Rl?UgNroHlO+P+3jGF-F4cJkbd43jSG zTYhz&U4pxdhK6puy_e<(-sIxP#zIrlC0j9GH0^V2!6^;7w` zFx>n3??kxzskvI!$3>FDJ6riJ81@Ih{cO7QiD>YOz0!?x(=R@CZ#p0!n$Pf|ET74c zv-h3Q`Lv)crQ1ILgad+@Ul=`=U3T)UThF6HUzd4$s#CH*{yFFDld_iSdhtA#h~l{Q zueL=C6s)n>Ub16p_|~mK-raVFi|@NE5PeW&TOV*faWo?a-Z{6P4p_oV%cl&!CnxVgHhf1Q*U^KGB2is#nnqHIYyp`NXbrao&Xqjl##~hFUOvw74&HY>C;MO*vWmoR{(5OPtTX&pFW{rlVT4Y-;as z(F5zZnr5#!7x>^s(Y2|2%OV*6P1u;`&vyEy<+VsJr>1xrforqk-8k$ot7pyHzVK#C z!#0+S%z2v6-Guz73!U0}X6v;y7L|#5&I>j($z8fEuUluHvH18OfA=_B{)&dfvF+A! z>!aVW+cd;K`g!6&oalvcpKP5E)~gTn$0k1yxKx>JydwBq&Z6s9T&+oZUJsRAD5he3e>~k>FVdQ&MBb@018l#QUCw| diff --git a/sprites/s_bone_IK/8fdfbcea-ea77-48fd-ba17-e77e525adfc6.png b/sprites/s_bone_IK/8fdfbcea-ea77-48fd-ba17-e77e525adfc6.png new file mode 100644 index 0000000000000000000000000000000000000000..a2fc5479bc760c33ed4e5094a336bb05be1bc390 GIT binary patch literal 875 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweEpc6VX;4}uH!E}zW6z!c}{;uw-~?`_nLJlttU}ow;~iTeaD|4N>~p_t2ux^nI8M-+jhA ztUbG#KPYedZ&k9QE6yiX`Cy<&G$NWO?~1zQv2R?p8Dy^dUyVnSud&Bh`2PbH6T={F2{GwzSKY%<1a;F2|I9 zs`KbYgFX8eP1z^M6o2a3KEw2VV&`<3SovflPEFhAD92=e$##`vf{ImM4a=0`Qj=*r z&ur&+w_T{b@P=A*>h2(q+BbCu-vw?QQ7XHha${PS%VOKx8IC4*n%A5U;Wtv2I=;ob z)A03lq4T^yL!QJAd*|%}8Qp`os!L5P8|m4Shkp_w+2G%zS% zcjqXIhTQy=%(P0}8rVLkR01_oTAo22WQ%mvv4FO#tb5 BY9Igr literal 0 HcmV?d00001 diff --git a/sprites/s_bone_IK/layers/31c83e1e-8539-4edf-a5f1-82ed6726abb6/c522ca13-4db7-451f-8192-17561ae92385.png b/sprites/s_bone_IK/layers/31c83e1e-8539-4edf-a5f1-82ed6726abb6/c522ca13-4db7-451f-8192-17561ae92385.png deleted file mode 100644 index 47cae58ca7f3987e5f725d2853bd9846fe9b0a50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 964 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweEpc6VX;4}uH!E}zW6z_i`d#W5t~-rK0R6K5L; z)Si2?U$c>~k8jcI2UZ*}56H?aonyVASwr@Rl?UgNroHlO+P+3jGF-F4cJkbd43jSG zTYhz&U4pxdhK6puy_e<(-sIxP#zIrlC0j9GH0^V2!6^;7w` zFx>n3??kxzskvI!$3>FDJ6riJ81@Ih{cO7QiD>YOz0!?x(=R@CZ#p0!n$Pf|ET74c zv-h3Q`Lv)crQ1ILgad+@Ul=`=U3T)UThF6HUzd4$s#CH*{yFFDld_iSdhtA#h~l{Q zueL=C6s)n>Ub16p_|~mK-raVFi|@NE5PeW&TOV*faWo?a-Z{6P4p_oV%cl&!CnxVgHhf1Q*U^KGB2is#nnqHIYyp`NXbrao&Xqjl##~hFUOvw74&HY>C;MO*vWmoR{(5OPtTX&pFW{rlVT4Y-;as z(F5zZnr5#!7x>^s(Y2|2%OV*6P1u;`&vyEy<+VsJr>1xrforqk-8k$ot7pyHzVK#C z!#0+S%z2v6-Guz73!U0}X6v;y7L|#5&I>j($z8fEuUluHvH18OfA=_B{)&dfvF+A! z>!aVW+cd;K`g!6&oalvcpKP5E)~gTn$0k1yxKx>JydwBq&Z6s9T&+oZUJsRAD5he3e>~k>FVdQ&MBb@018l#QUCw| diff --git a/sprites/s_bone_IK/layers/8fdfbcea-ea77-48fd-ba17-e77e525adfc6/8d65c061-a3b2-4290-98d8-2d158525536d.png b/sprites/s_bone_IK/layers/8fdfbcea-ea77-48fd-ba17-e77e525adfc6/8d65c061-a3b2-4290-98d8-2d158525536d.png new file mode 100644 index 0000000000000000000000000000000000000000..a2fc5479bc760c33ed4e5094a336bb05be1bc390 GIT binary patch literal 875 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweEpc6VX;4}uH!E}zW6z!c}{;uw-~?`_nLJlttU}ow;~iTeaD|4N>~p_t2ux^nI8M-+jhA ztUbG#KPYedZ&k9QE6yiX`Cy<&G$NWO?~1zQv2R?p8Dy^dUyVnSud&Bh`2PbH6T={F2{GwzSKY%<1a;F2|I9 zs`KbYgFX8eP1z^M6o2a3KEw2VV&`<3SovflPEFhAD92=e$##`vf{ImM4a=0`Qj=*r z&ur&+w_T{b@P=A*>h2(q+BbCu-vw?QQ7XHha${PS%VOKx8IC4*n%A5U;Wtv2I=;ob z)A03lq4T^yL!QJAd*|%}8Qp`os!L5P8|m4Shkp_w+2G%zS% zcjqXIhTQy=%(P0}8rVLkR01_oTAo22WQ%mvv4FO#tb5 BY9Igr literal 0 HcmV?d00001 diff --git a/sprites/s_bone_IK/s_bone_IK.yy b/sprites/s_bone_IK/s_bone_IK.yy index 9fcb095b5..f1ca332b8 100644 --- a/sprites/s_bone_IK/s_bone_IK.yy +++ b/sprites/s_bone_IK/s_bone_IK.yy @@ -2,24 +2,24 @@ "$GMSprite":"", "%Name":"s_bone_IK", "bboxMode":0, - "bbox_bottom":47, - "bbox_left":0, - "bbox_right":47, - "bbox_top":0, + "bbox_bottom":45, + "bbox_left":2, + "bbox_right":45, + "bbox_top":2, "collisionKind":1, "collisionTolerance":0, "DynamicTexturePage":false, "edgeFiltering":false, "For3D":false, "frames":[ - {"$GMSpriteFrame":"","%Name":"31c83e1e-8539-4edf-a5f1-82ed6726abb6","name":"31c83e1e-8539-4edf-a5f1-82ed6726abb6","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"8fdfbcea-ea77-48fd-ba17-e77e525adfc6","name":"8fdfbcea-ea77-48fd-ba17-e77e525adfc6","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, ], "gridX":0, "gridY":0, "height":48, "HTile":false, "layers":[ - {"$GMImageLayer":"","%Name":"c522ca13-4db7-451f-8192-17561ae92385","blendMode":0,"displayName":"default","isLocked":false,"name":"c522ca13-4db7-451f-8192-17561ae92385","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + {"$GMImageLayer":"","%Name":"8d65c061-a3b2-4290-98d8-2d158525536d","blendMode":0,"displayName":"default","isLocked":false,"name":"8d65c061-a3b2-4290-98d8-2d158525536d","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, ], "name":"s_bone_IK", "nineSlice":null, @@ -69,8 +69,8 @@ "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"31c83e1e-8539-4edf-a5f1-82ed6726abb6","path":"sprites/s_bone_IK/s_bone_IK.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"3a2d3c50-7975-4295-b363-cad98cd4e44e","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"8fdfbcea-ea77-48fd-ba17-e77e525adfc6","path":"sprites/s_bone_IK/s_bone_IK.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"b67cb8f4-299a-4324-84ec-f9ee0a802602","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, diff --git a/sprites/s_node_armature_mesh/4c4d464f-55b1-43f1-83f6-9e5cb7313927.png b/sprites/s_node_armature_mesh/4c4d464f-55b1-43f1-83f6-9e5cb7313927.png new file mode 100644 index 0000000000000000000000000000000000000000..99424a5d365e0e182faeb7d0bb2d01709c40b9c1 GIT binary patch literal 471 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`3dtTpz6=aiY77hwEes65fI|H(?D00fv#WBR<^wG&1c@G%~ zxXzz=+e32?gX@a9oF`OFdJZtO%oCl!YQ3bL_s;T!1{bDI#=a(nnF4}SL@J-&{rmp% z_O&i5Y}XuIx_9k6&)CzszUDIn-!8%T)@%l9%lKvI)G(e)y!^X}J0W*d_DiD#P8TbU zc~gTbEuO|~Wc9dw)IHYa)3Jug_kFfL`3qLPDl<`wtBikC`*Zq-b-Qslu&$)gsooRREBHKgnGq)`F2OAi3`FnGH9xvX|H(?D00fv#WBR<^wG&1c@G%~ zxXzz=+e32?gX@a9oF`OFdJZtO%oCl!YQ3bL_s;T!1{bDI#=a(nnF4}SL@J-&{rmp% z_O&i5Y}XuIx_9k6&)CzszUDIn-!8%T)@%l9%lKvI)G(e)y!^X}J0W*d_DiD#P8TbU zc~gTbEuO|~Wc9dw)IHYa)3Jug_kFfL`3qLPDl<`wtBikC`*Zq-b-Qslu&$)gsooRREBHKgnGq)`F2OAi3`FnGH9xvX":"", + "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_armature_mesh", + "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":"4c4d464f-55b1-43f1-83f6-9e5cb7313927","path":"sprites/s_node_armature_mesh/s_node_armature_mesh.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"13f8b5ba-8fba-4554-875b-7b57ecd738a7","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":8, + "yorigin":8, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":16, +} \ No newline at end of file diff --git a/sprites/s_node_armature_mesh_rig/cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea.png b/sprites/s_node_armature_mesh_rig/cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea.png new file mode 100644 index 0000000000000000000000000000000000000000..97ee7ca2608a3985a9b71e4b9d4872aa13de7c19 GIT binary patch literal 2179 zcmZ{ldpOgN7so&5Hn%p0h|Jx0v6)0`q~#L1%o@^7rde_sTlu;clSr&4Np3Oao-#tx zS1pMO&7E#DM43w=6ym%7`ThR-KIb{-{XFM9ujf3^dCqgr6$0K-L3W!g000UHo$QGs z#r<)xlqgmP()l9MCOZ+`03gN?02r45U{#c2d`xh;;>ExE{J+)@KgLxmVqi|acS zRf;kW%l;-1C9dL(ZA(H3`kAWC9b%F?+Q$g@P8XfkCG>(u?fNR&&R}qHN^1?BXw)TV zhCekFF{9rw{_w)G0(|)`|I>%P-)?_X@`;TPr0~oaJ3ALgasnoEZYP3d|6(&hHcilq zoh6wATs+B`K!0MDXBd+p&ehUsy;&!dqA?<7()1~-6E?)~vQ6p0=QtpgBjdnKqtF-l zN1dK}?91yK%b{OYY&}a|7vmh?Um7F?Yn%ba)t6fxw-oFH=epffioqg z_Q)m2c0Q$V_!$r(o|nC3Y@;n7B7PFYzmdD(iCP<%;OS}mRHa1pVd7HR%owkuAkEC& z1qagF)ANS7AZPRImP6|a^hR^={x9<@`rXiU4||8VeD^tUdT#BuGYuWAEnKU;v^a?a zcLgv`m3&K@pu!zjQEyZjk{`vo`*P`*1EW7vn*#ys`|BMVj#b@w7lyP#76tc5U0Z(f zu<+tQTEL<=KB8x$n%y4njhA`V0Q;y=m8)all4f+{>LW4@6xS^laQXg1>3qa_*Doq! z$2+g=M!m?<;471r>iW>?c{gvq)XjAFn#EW~C$!Cbm`|ON3L81d zbL{k3%h3(iBXviX88ok7>lD^ZE2ttnlRoXy<_`9}x57nT8#zs{zRI}w)LMtj+hyhv z?lYFyH83?$g9fwS-&sBZ6a2E~A`6mp48B)$u@9}cC5CNJG$!-0izn0uvyM~ZQPev_ zz6FEPIPCAj712a>8Q!yP;u5KXU$g~IgWhLx3Z-@)a2uyi*=GjoX?O^tnI2?E&#V@f zhG6PgdBf0W&ZGIrcO!z9bUs++;j1}X)QBj9jPlzA9ZLIL@jCxAKcQ{(?5APRVOjMZ(^!RO!nfSuk9J z1(X+JrVpFQuiFN_Q4z?^_-bT2_58@S_q~mFk*#&ujDKvzC+lE>l<;>`82g8 z)9TBq8Sj3K);eaijE3B?$8*ejohSOa=PT(So!$lfh(34c`Ev!Ytd_k7hu=9J3SF^P zR2;kAtB?;K(D7+N^{C}*B)^?T&z(!O&;p0W0}zdpyA}PwJVCbl3+Jw^jci`s=Uf7I(NDh8^f%4Yd{2L53yQ z`^klTX)WbSn^0ahZ|B!i_=uinLEyTSbtH(mU3IPrZbSavSZ7zhY6_Dn^SS_`y|RO^ zC74>N7uxO0hRqHUH6YztGp$HtAEF6#B-aLE#d6+Q#=2rpj{V&G-K|LI9ac0C)K9ib zUw^C;qgOFagCq+rxy_L0xZOV@UyQ`B*fF^!Uga@ENK5O4zRA{|kTiF^b3bwX0)^PKF%E`~5}hWY9dAg%_hUzSUi&XB zoSYnqc3}{frn$VXTBHTXO5UsFq09T;Q^Rra^JEH9MRbKX+f82m-kv#gS3OF;+yy*% zQ-jxq$WB!s3e!XbA&=x1gCu~~Tc4^)Po%+w$w)Ik9Qc__SSlvzegmi6plL<{QRm*a zsMK@n)r*9eZ`Ur;W%ZrDN?N+O{ZjglX_E@rlWg4Bx-igDUXdtmd65>+E09SiqH=lE z9!(`W6a&__py)vT+xe}}XFskYahW3Uz&thu={8jVGxRoxf={Qds})G+_R)6xG81Sq*Q jiGaWU*C9NRN;wzqN2UEYgO(1Wh#26Y1K$3DE$QOFD#zWa literal 0 HcmV?d00001 diff --git a/sprites/s_node_armature_mesh_rig/layers/cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea/4c6f6f4a-829e-4a0f-896e-f2402548b091.png b/sprites/s_node_armature_mesh_rig/layers/cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea/4c6f6f4a-829e-4a0f-896e-f2402548b091.png new file mode 100644 index 0000000000000000000000000000000000000000..97ee7ca2608a3985a9b71e4b9d4872aa13de7c19 GIT binary patch literal 2179 zcmZ{ldpOgN7so&5Hn%p0h|Jx0v6)0`q~#L1%o@^7rde_sTlu;clSr&4Np3Oao-#tx zS1pMO&7E#DM43w=6ym%7`ThR-KIb{-{XFM9ujf3^dCqgr6$0K-L3W!g000UHo$QGs z#r<)xlqgmP()l9MCOZ+`03gN?02r45U{#c2d`xh;;>ExE{J+)@KgLxmVqi|acS zRf;kW%l;-1C9dL(ZA(H3`kAWC9b%F?+Q$g@P8XfkCG>(u?fNR&&R}qHN^1?BXw)TV zhCekFF{9rw{_w)G0(|)`|I>%P-)?_X@`;TPr0~oaJ3ALgasnoEZYP3d|6(&hHcilq zoh6wATs+B`K!0MDXBd+p&ehUsy;&!dqA?<7()1~-6E?)~vQ6p0=QtpgBjdnKqtF-l zN1dK}?91yK%b{OYY&}a|7vmh?Um7F?Yn%ba)t6fxw-oFH=epffioqg z_Q)m2c0Q$V_!$r(o|nC3Y@;n7B7PFYzmdD(iCP<%;OS}mRHa1pVd7HR%owkuAkEC& z1qagF)ANS7AZPRImP6|a^hR^={x9<@`rXiU4||8VeD^tUdT#BuGYuWAEnKU;v^a?a zcLgv`m3&K@pu!zjQEyZjk{`vo`*P`*1EW7vn*#ys`|BMVj#b@w7lyP#76tc5U0Z(f zu<+tQTEL<=KB8x$n%y4njhA`V0Q;y=m8)all4f+{>LW4@6xS^laQXg1>3qa_*Doq! z$2+g=M!m?<;471r>iW>?c{gvq)XjAFn#EW~C$!Cbm`|ON3L81d zbL{k3%h3(iBXviX88ok7>lD^ZE2ttnlRoXy<_`9}x57nT8#zs{zRI}w)LMtj+hyhv z?lYFyH83?$g9fwS-&sBZ6a2E~A`6mp48B)$u@9}cC5CNJG$!-0izn0uvyM~ZQPev_ zz6FEPIPCAj712a>8Q!yP;u5KXU$g~IgWhLx3Z-@)a2uyi*=GjoX?O^tnI2?E&#V@f zhG6PgdBf0W&ZGIrcO!z9bUs++;j1}X)QBj9jPlzA9ZLIL@jCxAKcQ{(?5APRVOjMZ(^!RO!nfSuk9J z1(X+JrVpFQuiFN_Q4z?^_-bT2_58@S_q~mFk*#&ujDKvzC+lE>l<;>`82g8 z)9TBq8Sj3K);eaijE3B?$8*ejohSOa=PT(So!$lfh(34c`Ev!Ytd_k7hu=9J3SF^P zR2;kAtB?;K(D7+N^{C}*B)^?T&z(!O&;p0W0}zdpyA}PwJVCbl3+Jw^jci`s=Uf7I(NDh8^f%4Yd{2L53yQ z`^klTX)WbSn^0ahZ|B!i_=uinLEyTSbtH(mU3IPrZbSavSZ7zhY6_Dn^SS_`y|RO^ zC74>N7uxO0hRqHUH6YztGp$HtAEF6#B-aLE#d6+Q#=2rpj{V&G-K|LI9ac0C)K9ib zUw^C;qgOFagCq+rxy_L0xZOV@UyQ`B*fF^!Uga@ENK5O4zRA{|kTiF^b3bwX0)^PKF%E`~5}hWY9dAg%_hUzSUi&XB zoSYnqc3}{frn$VXTBHTXO5UsFq09T;Q^Rra^JEH9MRbKX+f82m-kv#gS3OF;+yy*% zQ-jxq$WB!s3e!XbA&=x1gCu~~Tc4^)Po%+w$w)Ik9Qc__SSlvzegmi6plL<{QRm*a zsMK@n)r*9eZ`Ur;W%ZrDN?N+O{ZjglX_E@rlWg4Bx-igDUXdtmd65>+E09SiqH=lE z9!(`W6a&__py)vT+xe}}XFskYahW3Uz&thu={8jVGxRoxf={Qds})G+_R)6xG81Sq*Q jiGaWU*C9NRN;wzqN2UEYgO(1Wh#26Y1K$3DE$QOFD#zWa literal 0 HcmV?d00001 diff --git a/sprites/s_node_armature_mesh_rig/s_node_armature_mesh_rig.yy b/sprites/s_node_armature_mesh_rig/s_node_armature_mesh_rig.yy new file mode 100644 index 000000000..e272174fc --- /dev/null +++ b/sprites/s_node_armature_mesh_rig/s_node_armature_mesh_rig.yy @@ -0,0 +1,90 @@ +{ + "$GMSprite":"", + "%Name":"s_node_armature_mesh_rig", + "bboxMode":0, + "bbox_bottom":57, + "bbox_left":3, + "bbox_right":60, + "bbox_top":6, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea","name":"cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":64, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"4c6f6f4a-829e-4a0f-896e-f2402548b091","blendMode":0,"displayName":"default","isLocked":false,"name":"4c6f6f4a-829e-4a0f-896e-f2402548b091","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"s_node_armature_mesh_rig", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"transform", + "path":"folders/nodes/icons/transform.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"s_node_armature_mesh_rig", + "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_armature_mesh_rig", + "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":"cada5ad0-5cc6-4a4f-9e92-a41fdaa5bfea","path":"sprites/s_node_armature_mesh_rig/s_node_armature_mesh_rig.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"02143a61-9a30-4973-8167-8a8223d0d4d2","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