diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 0faefcc98..97330179a 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -234,6 +234,7 @@ {"name":"widget","order":10,"path":"folders/theme/widget.yy",}, {"name":"VCT","order":154,"path":"folders/VCT.yy",}, {"name":"widgets","order":155,"path":"folders/widgets.yy",}, + {"name":"object","order":18,"path":"folders/widgets/object.yy",}, ], "ResourceOrderSettings":[ {"name":"ac_disappear","order":2,"path":"animcurves/ac_disappear/ac_disappear.yy",}, @@ -437,6 +438,7 @@ {"name":"area_function","order":2,"path":"scripts/area_function/area_function.yy",}, {"name":"areaBox","order":13,"path":"scripts/areaBox/areaBox.yy",}, {"name":"argumentRenderer","order":2,"path":"scripts/argumentRenderer/argumentRenderer.yy",}, + {"name":"armatureBox","order":2,"path":"scripts/armatureBox/armatureBox.yy",}, {"name":"array_functions","order":2,"path":"scripts/array_functions/array_functions.yy",}, {"name":"ase_object","order":7,"path":"scripts/ase_object/ase_object.yy",}, {"name":"ase_reader","order":1,"path":"scripts/ase_reader/ase_reader.yy",}, @@ -1340,7 +1342,6 @@ {"name":"path_reader","order":5,"path":"scripts/path_reader/path_reader.yy",}, {"name":"pathAnchorBox","order":17,"path":"scripts/pathAnchorBox/pathAnchorBox.yy",}, {"name":"pathArrayBox","order":12,"path":"scripts/pathArrayBox/pathArrayBox.yy",}, - {"name":"pathnodeBox","order":17,"path":"scripts/pathnodeBox/pathnodeBox.yy",}, {"name":"pcx_parse","order":3,"path":"scripts/pcx_parse/pcx_parse.yy",}, {"name":"pcx_server","order":2,"path":"scripts/pcx_server/pcx_server.yy",}, {"name":"perlin_noise","order":5,"path":"scripts/perlin_noise/perlin_noise.yy",}, @@ -1403,7 +1404,7 @@ {"name":"tiler_tool_fill","order":3,"path":"scripts/tiler_tool_fill/tiler_tool_fill.yy",}, {"name":"tiler_tool_selection_shape","order":6,"path":"scripts/tiler_tool_selection_shape/tiler_tool_selection_shape.yy",}, {"name":"tiler_tool_selection","order":5,"path":"scripts/tiler_tool_selection/tiler_tool_selection.yy",}, - {"name":"tilesetBox","order":16,"path":"scripts/tilesetBox/tilesetBox.yy",}, + {"name":"tilesetBox","order":1,"path":"scripts/tilesetBox/tilesetBox.yy",}, {"name":"time_source","order":25,"path":"scripts/time_source/time_source.yy",}, {"name":"timeline_data","order":18,"path":"scripts/timeline_data/timeline_data.yy",}, {"name":"toggleGroup","order":7,"path":"scripts/toggleGroup/toggleGroup.yy",}, @@ -1866,6 +1867,7 @@ {"name":"s_bone_tool_detach","order":5,"path":"sprites/s_bone_tool_detach/s_bone_tool_detach.yy",}, {"name":"s_bone_tool_IK","order":6,"path":"sprites/s_bone_tool_IK/s_bone_tool_IK.yy",}, {"name":"s_bone_tool_move","order":7,"path":"sprites/s_bone_tool_move/s_bone_tool_move.yy",}, + {"name":"s_bone_tool_pose","order":69,"path":"sprites/s_bone_tool_pose/s_bone_tool_pose.yy",}, {"name":"s_bone_tool_remove","order":8,"path":"sprites/s_bone_tool_remove/s_bone_tool_remove.yy",}, {"name":"s_bone_tool_scale","order":9,"path":"sprites/s_bone_tool_scale/s_bone_tool_scale.yy",}, {"name":"s_bone_tool_transform","order":10,"path":"sprites/s_bone_tool_transform/s_bone_tool_transform.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 19607b56f..071f1a326 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -354,6 +354,7 @@ {"$GMFolder":"","%Name":"widget","folderPath":"folders/VCT/widget.yy","name":"widget","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"widgets","folderPath":"folders/widgets.yy","name":"widgets","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"button","folderPath":"folders/widgets/button.yy","name":"button","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"object","folderPath":"folders/widgets/object.yy","name":"object","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"rotator","folderPath":"folders/widgets/rotator.yy","name":"rotator","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"sliders","folderPath":"folders/widgets/sliders.yy","name":"sliders","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"text","folderPath":"folders/widgets/text.yy","name":"text","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -935,6 +936,7 @@ {"id":{"name":"area_function","path":"scripts/area_function/area_function.yy",},}, {"id":{"name":"areaBox","path":"scripts/areaBox/areaBox.yy",},}, {"id":{"name":"argumentRenderer","path":"scripts/argumentRenderer/argumentRenderer.yy",},}, + {"id":{"name":"armatureBox","path":"scripts/armatureBox/armatureBox.yy",},}, {"id":{"name":"array_functions","path":"scripts/array_functions/array_functions.yy",},}, {"id":{"name":"ase_object","path":"scripts/ase_object/ase_object.yy",},}, {"id":{"name":"ase_reader","path":"scripts/ase_reader/ase_reader.yy",},}, @@ -2584,6 +2586,7 @@ {"id":{"name":"s_bone_tool_detach","path":"sprites/s_bone_tool_detach/s_bone_tool_detach.yy",},}, {"id":{"name":"s_bone_tool_IK","path":"sprites/s_bone_tool_IK/s_bone_tool_IK.yy",},}, {"id":{"name":"s_bone_tool_move","path":"sprites/s_bone_tool_move/s_bone_tool_move.yy",},}, + {"id":{"name":"s_bone_tool_pose","path":"sprites/s_bone_tool_pose/s_bone_tool_pose.yy",},}, {"id":{"name":"s_bone_tool_remove","path":"sprites/s_bone_tool_remove/s_bone_tool_remove.yy",},}, {"id":{"name":"s_bone_tool_scale","path":"sprites/s_bone_tool_scale/s_bone_tool_scale.yy",},}, {"id":{"name":"s_bone_tool_transform","path":"sprites/s_bone_tool_transform/s_bone_tool_transform.yy",},}, diff --git a/datafiles/data/Theme.zip b/datafiles/data/Theme.zip index 0507808e1..4772abf94 100644 Binary files a/datafiles/data/Theme.zip and b/datafiles/data/Theme.zip differ diff --git a/scripts/__bone/__bone.gml b/scripts/__bone/__bone.gml index e1bfe6a2b..e1fad214d 100644 --- a/scripts/__bone/__bone.gml +++ b/scripts/__bone/__bone.gml @@ -46,20 +46,20 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = direction = parent.angle; } - static addChild = function(bone) { #region + static addChild = function(bone) { array_push(childs, bone); bone.parent = self; return self; - } #endregion + } - static childCount = function() { #region + static childCount = function() { var amo = array_length(childs); for( var i = 0, n = array_length(childs); i < n; i++ ) amo += childs[i].childCount(); return amo; - } #endregion + } - static freeze = function() { #region + static freeze = function() { freeze_data = { angle: angle, length: length, @@ -69,9 +69,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].freeze(); - } #endregion + } - static findBone = function(_id) { #region + static findBone = function(_id) { if(ID == _id) return self; @@ -82,9 +82,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } return noone; - } #endregion + } - static findBoneByName = function(_name) { #region + static findBoneByName = function(_name) { //print($"Print {string_length(string_trim(name))} : {string_length(string_trim(_name))}"); if(string_trim(name) == string_trim(_name)) return self; @@ -96,9 +96,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } return noone; - } #endregion + } - static getPoint = function(progress, pose = true) { #region + static getPoint = function(progress, pose = true) { var _len = pose? length : init_length; var _ang = pose? angle : init_angle; @@ -118,18 +118,18 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = .addElement(lengthdir_x(distance, direction), lengthdir_y(distance, direction)) .addElement(lengthdir_x(len, _ang), lengthdir_y(len, _ang)) return p; - } #endregion + } - static draw = function(attributes, edit = false, _x = 0, _y = 0, _s = 1, _mx = 0, _my = 0, hovering = noone, selecting = noone) { #region + 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); drawControl(attributes); return hover; - } #endregion + } 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) { #region + static _drawBone = function(attributes, edit = false, _x = 0, _y = 0, _s = 1, _mx = 0, _my = 0, hovering = noone, selecting = noone) { var hover = noone; var p0 = getPoint(0); @@ -166,11 +166,31 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = if(attributes.display_bone == 0) { var _ppx = lerp(p0.x, p1.x, 0.2); var _ppy = lerp(p0.y, p1.y, 0.2); - draw_line_width2(p0.x, p0.y, _ppx, _ppy, 2 * pose_scale, 12 * pose_scale); - draw_line_width2(_ppx, _ppy, p1.x, p1.y, 12 * pose_scale, 2 * pose_scale); + 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); @@ -225,9 +245,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } return hover; - } #endregion + } - static drawControl = function(attributes) { #region + static drawControl = function(attributes) { if(parent != noone && IKlength == 0) { var spr, ind0, ind1; if(attributes.display_bone == 0) { @@ -243,23 +263,23 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].drawControl(attributes); - } #endregion + } - static resetPose = function() { #region + static resetPose = function() { pose_angle = 0; pose_scale = 1; pose_posit = [ 0, 0 ]; for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].resetPose(); - } #endregion + } - static setPose = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) { #region + static setPose = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) { setPoseTransform(_position, _angle, _scale); setIKconstrain(); - } #endregion + } - static setPoseTransform = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) { #region + static setPoseTransform = function(_position = [ 0, 0 ], _angle = 0, _scale = 1) { if(is_main) { for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].setPoseTransform(_position, _angle, _scale); @@ -288,9 +308,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].setPoseTransform(_position, pose_angle, pose_scale); - } #endregion + } - static setIKconstrain = function() { #region + static setIKconstrain = function() { if(IKlength > 0 && IKTarget != noone) { var points = array_create(IKlength + 1); var lengths = array_create(IKlength); @@ -329,10 +349,10 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].setIKconstrain(); - } #endregion + } FABRIK_result = []; - static FABRIK = function(bones, points, lengths, dx, dy) { #region + 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++ ) @@ -368,9 +388,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } FABRIK_result[i] = p1; - } #endregion + } - static FABRIK_backward = function(points, lengths, dx, dy) { #region + static FABRIK_backward = function(points, lengths, dx, dy) { var tx = dx; var ty = dy; @@ -389,9 +409,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = tx = p0.x; ty = p0.y; } - } #endregion + } - static FABRIK_forward = function(points, lengths, sx, sy) { #region + static FABRIK_forward = function(points, lengths, sx, sy) { var tx = sx; var ty = sy; @@ -410,9 +430,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = tx = p1.x; ty = p1.y; } - } #endregion + } - static __getBBOX = function() { #region + static __getBBOX = function() { var p0 = getPoint(0); var p1 = getPoint(1); @@ -422,9 +442,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = var y1 = max(p0.y, p1.y); return [ x0, y0, x1, y1 ]; - } #endregion + } - static bbox = function() { #region + static bbox = function() { var _bbox = __getBBOX(); //print($"BBOX: {_bbox}") @@ -439,9 +459,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } return _bbox; - } #endregion + } - static serialize = function() { #region + static serialize = function() { var bone = {}; bone.ID = ID; @@ -465,9 +485,9 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = bone.childs[i] = childs[i].serialize(); return bone; - } #endregion + } - static deserialize = function(bone, node) { #region + static deserialize = function(bone, node) { ID = bone.ID; name = bone.name; distance = bone.distance; @@ -493,18 +513,18 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = } return self; - } #endregion + } - static connect = function() { #region + static connect = function() { IKTarget = noone; if(parent != noone && IKTargetID != "") IKTarget = parent.findBone(IKTargetID); for( var i = 0, n = array_length(childs); i < n; i++ ) childs[i].connect(); - } #endregion + } - static clone = function() { #region + static clone = function() { var _b = new __Bone(parent, distance, direction, angle, length); _b.ID = ID; _b.name = name; @@ -521,7 +541,7 @@ function __Bone(parent = noone, distance = 0, direction = 0, angle = 0, length = _b.addChild(childs[i].clone()); return _b; - } #endregion + } static toString = function() { return $"Bone {name} [{ID}]"; } } \ No newline at end of file diff --git a/scripts/__node_3d_object/__node_3d_object.gml b/scripts/__node_3d_object/__node_3d_object.gml index a716d6bac..5fc420f15 100644 --- a/scripts/__node_3d_object/__node_3d_object.gml +++ b/scripts/__node_3d_object/__node_3d_object.gml @@ -50,10 +50,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr tool_pos = new NodeTool( "Transform", THEME.tools_3d_transform, "Node_3D_Object" ); tool_rot = new NodeTool( "Rotate", THEME.tools_3d_rotate, "Node_3D_Object" ); tool_sca = new NodeTool( "Scale", THEME.tools_3d_scale, "Node_3D_Object" ); - - tool_euler = [ tool_pos, tool_sca ]; - tool_quate = [ tool_pos, tool_rot, tool_sca ]; - tools = tool_quate; + tools = [ tool_pos, tool_rot, tool_sca ]; tool_axis_edit = new scrollBox([ "local", "global" ], function(val) { tool_attribute.context = val; }); tool_attribute.context = 0; @@ -198,7 +195,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr axis_hover = _hover; #endregion display - if(drag_axis != noone) { #region editing + if(drag_axis != noone) { // editing if(!MOUSE_WRAPPING) { drag_mx += _mx - drag_px; drag_my += _my - drag_py; @@ -263,9 +260,9 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr setMouseWrap(); drag_px = _mx; drag_py = _my; - } #endregion + } - if(_hover != noone && mouse_press(mb_left, active)) { #region + if(_hover != noone && mouse_press(mb_left, active)) { drag_axis = _hover; drag_prev = undefined; drag_mx = _mx; @@ -277,7 +274,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr drag_val = _pos; drag_original = new __vec3(_pos); - } #endregion + } } static drawGizmoRotation = function(index, object, _vpos, active, params, _mx, _my, _snx, _sny, _panel) { @@ -290,7 +287,8 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr var _qview = new BBMOD_Quaternion().FromEuler(_camera.focus_angle_y, -_camera.focus_angle_x, 0); var _ang = inputs[index].display_data.angle_display; - var _global = _ang == QUARTERNION_DISPLAY.quarterion? tool_attribute.context : 1; + var _quat = _ang == QUARTERNION_DISPLAY.quarterion; + var _global = _quat? tool_attribute.context : 1; var _hover = noone; var _hoverDist = 10; @@ -322,8 +320,8 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr switch(i) { case 0 : np = new BBMOD_Vec3(0, lengthdir_x(size, ang), lengthdir_y(size, ang)); break; - case 1 : np = new BBMOD_Vec3(lengthdir_x(size, ang), lengthdir_y(size, ang), 0); break; - case 2 : np = new BBMOD_Vec3(lengthdir_x(size, ang), 0, lengthdir_y(size, ang)); break; + case 1 : np = new BBMOD_Vec3(lengthdir_x(size, ang), 0, lengthdir_y(size, ang)); break; + case 2 : np = new BBMOD_Vec3(lengthdir_x(size, ang), lengthdir_y(size, ang), 0); break; } if(_global) np = _qview.Rotate(_qinv.Rotate(np)); @@ -344,51 +342,77 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr axis_hover = _hover; #endregion - if(drag_axis != noone) { #region - var mAng = point_direction(cx, cy, _mx, _my); - - if(drag_rot_axis == undefined) { - drag_rot_axis = BBMOD_VEC3_FORWARD; + if(_quat) { + if(drag_axis != noone) { + var mAng = point_direction(cx, cy, _mx, _my); - switch(drag_axis) { - case 0 : drag_rot_axis = new BBMOD_Vec3(-1, 0, 0); break; - case 1 : drag_rot_axis = new BBMOD_Vec3( 0, 0, -1); break; - case 2 : drag_rot_axis = new BBMOD_Vec3( 0, -1, 0); break; + if(drag_rot_axis == undefined) { + drag_rot_axis = BBMOD_VEC3_FORWARD; + + switch(drag_axis) { + case 0 : drag_rot_axis = new BBMOD_Vec3(-1, 0, 0); break; + case 1 : drag_rot_axis = new BBMOD_Vec3( 0, -1, 0); break; + case 2 : drag_rot_axis = new BBMOD_Vec3( 0, 0, -1); break; + } + + if(!_global) drag_rot_axis = _qrot.Rotate(drag_rot_axis).Normalize(); } - - if(!_global) drag_rot_axis = _qrot.Rotate(drag_rot_axis).Normalize(); + + var _nv = _qview.Rotate(_qinv.Rotate(drag_rot_axis)); + draw_line_round(cx, cy, cx + _nv.X * 100, cy + _nv.Y * 100, 2); + + if(drag_prev != undefined) { + var _rd = (mAng - drag_prev) * (_nv.Z > 0? 1 : -1); + drag_dist += _rd; + var _dist = value_snap(drag_dist, _sny); + + var _currR = new BBMOD_Quaternion().FromAxisAngle(drag_rot_axis, _dist); + var _val = _currR.Mul(drag_val); + var _Nrot = _val.ToArray(); + + if(inputs[index].setValue(_Nrot)) + UNDO_HOLDING = true; + } + + draw_set_color(COLORS._main_accent); + draw_line_dashed(cx, cy, _mx, _my, 1, 4); + + drag_prev = mAng; + } + + if(_hover != noone && mouse_press(mb_left, active)) { + drag_axis = _hover; + drag_prev = undefined; + drag_val = _qrot.Clone(); + drag_dist = 0; + + drag_rot_axis = undefined; } - var _nv = _qview.Rotate(_qinv.Rotate(drag_rot_axis)); - draw_line_round(cx, cy, cx + _nv.X * 100, cy + _nv.Y * 100, 2); + } else { + if(drag_axis != noone) { + var mAng = point_direction(cx, cy, _mx, _my); - if(drag_prev != undefined) { - var _rd = (mAng - drag_prev) * (_nv.Z > 0? 1 : -1); - drag_dist += _rd; - var _dist = value_snap(drag_dist, _sny); + if(drag_prev != undefined) { + drag_dist += drag_prev - mAng; + + var _Nrot = array_clone(drag_val); + _Nrot[drag_axis] += drag_dist; + + if(inputs[index].setValue(_Nrot)) + UNDO_HOLDING = true; + } - var _currR = new BBMOD_Quaternion().FromAxisAngle(drag_rot_axis, _dist); - var _val = _currR.Mul(drag_val); - var _Nrot = _ang == QUARTERNION_DISPLAY.quarterion? _val.ToArray() : _val.ToEuler(true); - - if(inputs[index].setValue(_Nrot)) - UNDO_HOLDING = true; - } - - draw_set_color(COLORS._main_accent); - draw_line_dashed(cx, cy, _mx, _my, 1, 4); - - drag_prev = mAng; - } #endregion + drag_prev = mAng; + } - if(_hover != noone && mouse_press(mb_left, active)) { #region - drag_axis = _hover; - drag_prev = undefined; - drag_val = _qrot.Clone(); - drag_dist = 0; - - drag_rot_axis = undefined; - } #endregion + if(_hover != noone && mouse_press(mb_left, active)) { + drag_axis = _hover; + drag_prev = undefined; + drag_val = inputs[index].getValue(CURRENT_FRAME, false); + drag_dist = 0; + } + } } static drawGizmoScale = function(index, object, _vpos, active, params, _mx, _my, _snx, _sny, _panel) { @@ -507,7 +531,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr axis_hover = _hover; #endregion - if(drag_axis != noone) { #region editing + if(drag_axis != noone) { // editing if(!MOUSE_WRAPPING) { drag_mx += _mx - drag_px; drag_my += _my - drag_py; @@ -566,9 +590,9 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr setMouseWrap(); drag_px = _mx; drag_py = _my; - } #endregion + } - if(_hover != noone && mouse_press(mb_left, active)) { #region + if(_hover != noone && mouse_press(mb_left, active)) { drag_axis = _hover; drag_prev = undefined; drag_mx = _mx; @@ -580,15 +604,10 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr drag_val = [ _sca[0], _sca[1], _sca[2] ]; drag_original = new __vec3(_sca); - } #endregion + } } static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) { - var _rot = inputs[1].display_data.angle_display; - tools = _rot == QUARTERNION_DISPLAY.quarterion? tool_quate : tool_euler; - if(_rot == QUARTERNION_DISPLAY.euler && isUsingTool("Rotate")) - PANEL_PREVIEW.tool_current = noone; - var object = getPreviewObjects(); if(array_empty(object)) return; object = object[0]; diff --git a/scripts/__node_VFX_effector/__node_VFX_effector.gml b/scripts/__node_VFX_effector/__node_VFX_effector.gml index e12fea32f..a96607d0c 100644 --- a/scripts/__node_VFX_effector/__node_VFX_effector.gml +++ b/scripts/__node_VFX_effector/__node_VFX_effector.gml @@ -44,8 +44,7 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr newInput(7, nodeValue_Vec2_Range("Scale particle", self, [ 0, 0, 0, 0 ] , { linked : true })) .rejectArray(); - newInput(8, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }) + newInput(8, nodeValueSeed(self)) .rejectArray(); effector_input_length = array_length(inputs); diff --git a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml index 7cf7739db..651b89e7a 100644 --- a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml +++ b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml @@ -74,8 +74,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co newInput(31, nodeValue_Surface("Atlas", self, [])) .setArrayDepth(1); - newInput(32, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[32].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(32, nodeValueSeed(self)); newInput(33, nodeValue_Rotation("Gravity direction", self, -90)); diff --git a/scripts/armatureBox/armatureBox.gml b/scripts/armatureBox/armatureBox.gml new file mode 100644 index 000000000..c4e89ba34 --- /dev/null +++ b/scripts/armatureBox/armatureBox.gml @@ -0,0 +1,51 @@ +function armatureBox(_junction) : widget() constructor { + self.junction = _junction; + + b_newTileset = button(function() /*=>*/ { + var b = nodeBuild("Node_Armature", junction.node.x - 160, junction.ry - 32); + junction.setFrom(b.outputs[0]); + }); + + b_newTileset.text = __txt("New armature"); + b_newTileset.icon = THEME.add_16; + b_newTileset.icon_size = .75; + b_newTileset.icon_blend = COLORS._main_value_positive; + + 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, _armature, _m) { + x = _x; + y = _y; + w = _w; + h = TEXTBOX_HEIGHT; + + if(_armature == noone) { + b_newTileset.setFocusHover(active, hover); + var param = new widgetParam(x, y, w, h, noone, {}, _m, rx, ry); + b_newTileset.drawParam(param); + + } else { + var ic = s_bone; + 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, "Armature"); + } + + return h; + } + + static clone = function() { return new tilesetBox(); } +} diff --git a/scripts/armatureBox/armatureBox.yy b/scripts/armatureBox/armatureBox.yy new file mode 100644 index 000000000..02cd8d847 --- /dev/null +++ b/scripts/armatureBox/armatureBox.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"armatureBox", + "isCompatibility":false, + "isDnD":false, + "name":"armatureBox", + "parent":{ + "name":"object", + "path":"folders/widgets/object.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/buttonColor/buttonColor.gml b/scripts/buttonColor/buttonColor.gml index fa3e8d1db..1b560a1d6 100644 --- a/scripts/buttonColor/buttonColor.gml +++ b/scripts/buttonColor/buttonColor.gml @@ -170,6 +170,7 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor { if(_a == 1) { draw_sprite_stretched_ext(THEME.palette_mask, 1, _bx, _by, _bww, _bh, current_color, 1); } else { + // draw_sprite_stretched_ext(THEME.button_def, 0, _bx, _by, _bww, _bh, boxColor, 1); draw_sprite_stretched_ext(THEME.palette_mask, 1, _bx, _by, _bww, _bh - ui(8), current_color, 1); draw_sprite_stretched_ext(THEME.palette_mask, 1, _bx, _by + _bh - ui(6), _bww, ui(6), c_black, 1); @@ -190,10 +191,10 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor { return h; } - static clone = function() { #region + static clone = function() { var cln = new buttonColor(onApply, parentDialog); return cln; - } #endregion + } } function drawColor(color, _x, _y, _w, _h, _alp = true, _ind = 1) { diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 1dc00bd8a..97c5be9e3 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -42,7 +42,7 @@ LATEST_VERSION = 1_18_00_0; VERSION = 1_18_03_1; SAVE_VERSION = 1_18_02_0; - VERSION_STRING = MAC? "1.18.003m" : "1.18.3.1"; + VERSION_STRING = MAC? "1.18.003m" : "1.18.3.2"; BUILD_NUMBER = 1_18_03_1; HOTKEYS = ds_map_create(); diff --git a/scripts/node_3d_camera/node_3d_camera.gml b/scripts/node_3d_camera/node_3d_camera.gml index a3a649b9a..4ea81c72f 100644 --- a/scripts/node_3d_camera/node_3d_camera.gml +++ b/scripts/node_3d_camera/node_3d_camera.gml @@ -104,11 +104,6 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group) } static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) { - var _rot = inputs[1].display_data.angle_display; - tools = _rot == QUARTERNION_DISPLAY.quarterion? tool_quate : tool_euler; - if(_rot == QUARTERNION_DISPLAY.euler && isUsingTool("Rotate")) - PANEL_PREVIEW.tool_current = noone; - var preObj = getPreviewObjects(); if(array_empty(preObj)) return; preObj = preObj[0]; diff --git a/scripts/node_FLIP_spawner/node_FLIP_spawner.gml b/scripts/node_FLIP_spawner/node_FLIP_spawner.gml index ed67fe385..913632654 100644 --- a/scripts/node_FLIP_spawner/node_FLIP_spawner.gml +++ b/scripts/node_FLIP_spawner/node_FLIP_spawner.gml @@ -27,8 +27,7 @@ function Node_FLIP_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group) constr newInput(8, nodeValue_Float("Spawn Radius", self, 2 )) .setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 0.1] }); - newInput(9, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[9].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(9, nodeValueSeed(self)); newInput(10, nodeValue_Rotation_Random("Spawn Direction", self, [ 0, 45, 135, 0, 0 ] )); diff --git a/scripts/node_armature/node_armature.gml b/scripts/node_armature/node_armature.gml index 92f88af45..baf72727d 100644 --- a/scripts/node_armature/node_armature.gml +++ b/scripts/node_armature/node_armature.gml @@ -5,22 +5,20 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo //newInput(0, nodeValue_Int("Axis", self, 0)); bone_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { - var _b = attributes.bones; + var _b = bones; 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_p0, fa_left, fa_top, COLORS._main_text); + 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(32); + 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)); - + // 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; @@ -42,8 +40,10 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo if(bone.parent_anchor) draw_sprite_ui(THEME.bone, 1, __x + 12, ty + 14,,,, COLORS._main_icon); + else if(bone.IKlength) draw_sprite_ui(THEME.bone, 2, __x + 12, ty + 14,,,, COLORS._main_icon); + else { if(_hover && point_in_circle(_m[0], _m[1], __x + 12, ty + 12, 12)) { draw_sprite_ui(THEME.bone, 0, __x + 12, ty + 14,,,, COLORS._main_icon_light); @@ -98,8 +98,10 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo ty += _hh; - draw_set_color(COLORS.node_composite_separator); - draw_line(_x + 16, ty, _x + _w - 16, ty); + 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); @@ -109,7 +111,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo if(bone_remove != noone) { var _par = bone_remove.parent; - recordAction(ACTION_TYPE.struct_modify, attributes.bones, attributes.bones.serialize()); + recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); array_remove(_par.childs, bone_remove); for( var i = 0, n = array_length(bone_remove.childs); i < n; i++ ) { @@ -128,12 +130,12 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo ]; static createBone = function(parent, distance, direction) { - recordAction(ACTION_TYPE.struct_modify, attributes.bones, attributes.bones.serialize()); + recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); var bone = new __Bone(parent, distance, direction,,, self); parent.addChild(bone); - if(parent == attributes.bones) + if(parent == bones) bone.parent_anchor = false; return bone; } @@ -141,10 +143,10 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo newOutput(0, nodeValue_Output("Armature", self, VALUE_TYPE.armature, noone)); #region ++++ attributes ++++ - attributes.bones = new __Bone(,,,,, self); - attributes.bones.name = "Main"; - attributes.bones.is_main = true; - attributes.bones.node = self; + bones = new __Bone(,,,,, self); + bones.name = "Main"; + bones.is_main = true; + bones.node = self; attributes.display_name = true; attributes.display_bone = 0; @@ -192,7 +194,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo var smx = value_snap(mx, _snx); var smy = value_snap(my, _sny); - var _b = attributes.bones; + var _b = bones; if(builder_bone != noone) { anchor_selecting = _b.draw(attributes, false, _x, _y, _s, _mx, _my, anchor_selecting); @@ -291,7 +293,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo 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, attributes.bones, attributes.bones.serialize()); + recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); var IKbone = new __Bone(anc, _len, _ang, ik_dragging.angle + 90, 0, self); anc.addChild(IKbone); @@ -349,7 +351,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo builder_mx = mx; builder_my = my; - recordAction(ACTION_TYPE.struct_modify, attributes.bones, attributes.bones.serialize()); + recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); } } else draw_set_color(c_white); @@ -422,7 +424,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo builder_mx = _mx; builder_my = _my; - recordAction(ACTION_TYPE.struct_modify, attributes.bones, attributes.bones.serialize()); + recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); } } @@ -432,7 +434,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo if(mouse_press(mb_left, active)) { if(anchor_selecting == noone) { - builder_bone = createBone(attributes.bones, point_distance(0, 0, smx, smy), point_direction(0, 0, smx, smy)); + 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; @@ -447,7 +449,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo } else if(anchor_selecting[1] == 2) { var _pr = anchor_selecting[0]; - recordAction(ACTION_TYPE.struct_modify, attributes.bones, attributes.bones.serialize()); + recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); var _md = new __Bone(noone, 0, 0, _pr.angle, _pr.length / 2, self); _pr.length = _md.length; @@ -464,7 +466,7 @@ 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 + 24, _my + 24, 1, 1, 0, c_white, 1); + 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); @@ -531,7 +533,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo builder_bone = anchor_selecting[0]; builder_type = anchor_selecting[1]; - recordAction(ACTION_TYPE.struct_modify, attributes.bones, attributes.bones.serialize()); + recordAction(ACTION_TYPE.struct_modify, bones, bones.serialize()); if(builder_type == 0) { var orig = builder_bone.parent.getPoint(0); @@ -562,7 +564,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo static step = function() {} static update = function(frame = CURRENT_FRAME) { - outputs[0].setValue(attributes.bones); + outputs[0].setValue(bones); } static getPreviewBoundingBox = function() { @@ -571,7 +573,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo var maxx = -9999999; var maxy = -9999999; - var _b = attributes.bones; + var _b = bones; var _bst = ds_stack_create(); ds_stack_push(_bst, _b); @@ -599,16 +601,15 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo } static doSerialize = function(_map) { - _map.bones = attributes.bones.serialize(); + _map.bones = bones.serialize(); } - // static attributeDeserialize = function() {} - static postDeserialize = function() { + if(struct_has(attributes, "bones")) struct_remove(attributes, "bones"); if(!struct_has(load_map, "bones")) return; - attributes.bones = new __Bone(,,,,, self); - attributes.bones.deserialize(load_map.bones, self); - attributes.bones.connect(); + bones = new __Bone(,,,,, self); + bones.deserialize(load_map.bones, self); + bones.connect(); } static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { diff --git a/scripts/node_armature_bind/node_armature_bind.gml b/scripts/node_armature_bind/node_armature_bind.gml index 4c018831d..471cb8ddd 100644 --- a/scripts/node_armature_bind/node_armature_bind.gml +++ b/scripts/node_armature_bind/node_armature_bind.gml @@ -10,7 +10,6 @@ function __armature_bind_data(_surface, _bone, _tran, _aang, _pang, _asca, _psca function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Armature Bind"; - batch_output = false; newInput(0, nodeValue_Dimension(self)); @@ -27,6 +26,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr newInput(4, nodeValue_Float("Bone scale", self, 1)) .setDisplay(VALUE_DISPLAY.slider, { range: [ 0.1, 2, 0.01 ] }); + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); newOutput(1, nodeValue_Output("Atlas data", self, VALUE_TYPE.surface, [])) @@ -47,44 +48,42 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr 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; - })]); + 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; })]); - boneMap = ds_map_create(); - surfMap = ds_map_create(); + tools = [ + new NodeTool( "Pose", THEME.bone_tool_pose ) + ]; + + boneMap = ds_map_create(); + surfMap = ds_map_create(); + boneIDMap = []; hold_visibility = true; hold_select = true; + _layer_dragging = noone; + _layer_drag_y = noone; layer_dragging = noone; layer_remove = -1; layer_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { ds_map_clear(surfMap); - var index = -1; var amo = min(array_length(inputs) - data_length, array_length(current_data)); var _bind = getSingleValue(2); var use_data = _bind != noone; + var _surfAmo = getInputAmount(); - for(var i = input_fix_len; i < amo; i += data_length) { - index++; - var _surf = current_data[i]; - var _id = inputs[i].display_data.bone_id; + for(var i = 0; i < _surfAmo; i++) { + var _surf = current_data[input_fix_len + i * data_length]; + var _id = array_safe_get(boneIDMap, i, ""); if(_id == "") continue; - if(ds_map_exists(surfMap, _id)) - array_push(surfMap[? _id], [ index, _surf ]); - else - surfMap[? _id] = [ [ index, _surf ] ]; + if(!ds_map_exists(surfMap, _id)) surfMap[? _id] = []; + array_push(surfMap[? _id], [ i, _surf ]); } - #region draw bones + #region draw bones var _b = bone; if(_b == noone) return 0; var amo = _b.childCount(); @@ -92,17 +91,13 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var bh = ui(32 + 16) + amo * _hh; var ty = _y; - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); + 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(32); + ty += ui(28); var _ty = ty; 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; @@ -122,16 +117,13 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr if(_bone.is_main) continue; - if(_bone.parent_anchor) - draw_sprite_ui(THEME.bone, 1, __x + 12, ty + 14,,,, COLORS._main_icon); - else if(_bone.IKlength) - draw_sprite_ui(THEME.bone, 2, __x + 12, ty + 14,,,, COLORS._main_icon); - else - draw_sprite_ui(THEME.bone, 0, __x + 12, ty + 14,,,, COLORS._main_icon); + if(_bone.parent_anchor) draw_sprite_ui(THEME.bone, 1, __x + 12, ty + 14,,,, COLORS._main_icon); + else if(_bone.IKlength) draw_sprite_ui(THEME.bone, 2, __x + 12, ty + 14,,,, COLORS._main_icon); + else draw_sprite_ui(THEME.bone, 0, __x + 12, ty + 14,,,, COLORS._main_icon); draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text); - draw_text(__x + 24, ty + 12, _bone.name); - + draw_text_add(__x + 24, ty + 12, _bone.name); + if(ds_map_exists(surfMap, _bone.ID)) { var _sdata = surfMap[? _bone.ID]; @@ -150,15 +142,18 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr if(_hover && point_in_rectangle(_m[0], _m[1], _sx, _sy, _sx + _sw * _ss, _sy + _sh * _ss)) { TOOLTIP = [ _surf, VALUE_TYPE.surface ]; if(mouse_press(mb_left, _focus)) { - layer_dragging = _sid; - inputs[input_fix_len + _sid * data_length].display_data.bone_id = ""; + layer_dragging = _sid; + boneIDMap[_sid] = ""; } draw_set_color(COLORS._main_accent); - } else - draw_set_color(COLORS.node_composite_bg); - draw_rectangle(_sx, _sy, _sx + _sw * _ss, _sy + _sh * _ss, true); + draw_sprite_stretched_add(THEME.s_box_r2, 1, _sx, _sy, _sw * _ss, _sh * _ss, COLORS._main_accent, 1); + } else { + draw_set_color(COLORS.node_composite_bg); + draw_sprite_stretched_add(THEME.s_box_r2, 1, _sx, _sy, _sw * _ss, _sh * _ss, COLORS._main_icon, .3); + } + _sx += _sw * _ss + 4; } } @@ -174,16 +169,16 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr ty += _hh; - draw_set_color(COLORS.node_composite_separator); - draw_line(_x + 16, ty, _x + _w - 16, ty); + 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); if(layer_dragging != noone && hovering && mouse_release(mb_left)) { - var _lind = input_fix_len + layer_dragging * data_length; - inputs[_lind].display_data.bone_id = hovering.ID; - + boneIDMap[layer_dragging] = hovering.ID; layer_dragging = noone; triggerRender(); } @@ -200,139 +195,136 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr return layer_renderer.h; } - var ty = _y + bh + ui(8); + var ty = _y + bh; - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text_add(_x + ui(16), ty + ui(4), __txt("Surfaces")); - - ty += ui(32); + draw_sprite_ext(THEME.arrow, 1, _x + _w / 2, ty + ui(6), 1, 1, 0, COLORS._main_icon); + ty += ui(16); #region draw surface - var lh = 32; - var sh = 8 + max(1, amo) * (lh + 4) + 8; + var lh = 28; + var sh = 4 + max(1, amo) * (lh + 4) + 4; draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, ty, _w, sh, COLORS.node_composite_bg_blend, 1); - + var _vis = attributes.layer_visible; var _sel = attributes.layer_selectable; - var ly = ty + 8; + var ly = ty + 6; var ssh = lh - 6; var hoverIndex = noone; - draw_set_color(COLORS.node_composite_separator); - draw_line(_x + 16, ly, _x + _w - 16, ly); - + layer_remove = -1; - var index = amo; for(var i = 0; i < amo; i++) { - var _inp = input_fix_len + (amo - i - 1) * data_length; - var _surf = current_data[_inp]; + var _ind = amo - i - 1; + var _inp = input_fix_len + _ind * data_length; + var _surf = current_data[_inp]; + var binded = array_safe_get(boneIDMap, _ind, "") != ""; - index--; var _bx = _x + _w - 24; - var _cy = ly + index * (lh + 4); + var _cy = ly + _ind * (lh + 4); if(point_in_circle(_m[0], _m[1], _bx, _cy + lh / 2, 16)) { draw_sprite_ui_uniform(THEME.icon_delete, 3, _bx, _cy + lh / 2, 1, COLORS._main_value_negative); if(mouse_press(mb_left, _focus)) - layer_remove = index; + layer_remove = _ind; } else draw_sprite_ui_uniform(THEME.icon_delete, 3, _bx, _cy + lh / 2, 1, COLORS._main_icon); _bx -= 32; - //if(point_in_circle(_m[0], _m[1], _bx, _cy + lh / 2, 16)) { - // draw_sprite_ui_uniform(THEME.reset_16, 3, _bx, _cy + lh / 2, 1, COLORS._main_value_negative); - - // if(mouse_press(mb_left, _focus)) - // resetTransform(i); - //} else - // draw_sprite_ui_uniform(THEME.reset_16, 3, _bx, _cy + lh / 2, 1, COLORS._main_icon); + if(binded) { + if(point_in_circle(_m[0], _m[1], _bx, _cy + lh / 2, 16)) { + draw_sprite_ui_uniform(THEME.reset_16, 3, _bx, _cy + lh / 2, 1, COLORS._main_value_negative); + + if(mouse_press(mb_left, _focus)) + resetTransform(_ind); + } else + draw_sprite_ui_uniform(THEME.reset_16, 3, _bx, _cy + lh / 2, 1, COLORS._main_icon); + } if(!is_surface(_surf)) continue; - var aa = (index != layer_dragging || layer_dragging == noone)? 1 : 0.5; - var vis = _vis[index]; - var sel = _sel[index]; - var hover = point_in_rectangle(_m[0], _m[1], _x, _cy, _x + _w, _cy + lh); - - draw_set_color(COLORS.node_composite_separator); - draw_line(_x + 16, _cy + lh + 2, _x + _w - 16, _cy + lh + 2); - - var _bx = _x + 24 * 2 + 8; + var aa = (_ind != layer_dragging || layer_dragging == noone)? 1 : 0.5; + var vis = _vis[_ind]; + var sel = _sel[_ind]; + var hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _cy, _x + _w, _cy + lh); + + var _bx = _x + 24; if(point_in_circle(_m[0], _m[1], _bx, _cy + lh / 2, 12)) { draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _cy + lh / 2, 1, c_white); if(mouse_press(mb_left, _focus)) - hold_visibility = !_vis[index]; + hold_visibility = !_vis[_ind]; - if(mouse_click(mb_left, _focus) && _vis[index] != hold_visibility) { - _vis[index] = hold_visibility; + if(mouse_click(mb_left, _focus) && _vis[_ind] != hold_visibility) { + _vis[_ind] = hold_visibility; doUpdate(); } } else draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _cy + lh / 2, 1, COLORS._main_icon, 0.5 + 0.5 * vis); - _bx += 24 + 8; + _bx += 24 + 1; if(point_in_circle(_m[0], _m[1], _bx, _cy + lh / 2, 12)) { draw_sprite_ui_uniform(THEME.cursor_select, sel, _bx, _cy + lh / 2, 1, c_white); if(mouse_press(mb_left, _focus)) - hold_select = !_sel[index]; + hold_select = !_sel[_ind]; - if(mouse_click(mb_left, _focus) && _sel[index] != hold_select) - _sel[index] = hold_select; + if(mouse_click(mb_left, _focus) && _sel[_ind] != hold_select) + _sel[_ind] = hold_select; } else draw_sprite_ui_uniform(THEME.cursor_select, sel, _bx, _cy + lh / 2, 1, COLORS._main_icon, 0.5 + 0.5 * sel); - + draw_set_color(COLORS.node_composite_bg); - var _sx0 = _bx + 24; + var _sx0 = _bx + 18; var _sx1 = _sx0 + ssh; var _sy0 = _cy + 3; var _sy1 = _sy0 + ssh; - draw_rectangle(_sx0, _sy0, _sx1, _sy1, true); - + var _ssw = surface_get_width_safe(_surf); var _ssh = surface_get_height_safe(_surf); var _sss = min(ssh / _ssw, ssh / _ssh); + var _ins = _ind == dynamic_input_inspecting; + draw_surface_ext_safe(_surf, _sx0, _sy0, _sss, _sss, 0, c_white, 1); - - draw_set_text(f_p1, fa_left, fa_center, hover? COLORS._main_text : COLORS._main_text); + if(_ins) draw_sprite_stretched_add(THEME.s_box_r2, 1, _sx0, _sy0, ssh, ssh, COLORS._main_text_accent, 1); + else draw_sprite_stretched_add(THEME.s_box_r2, 1, _sx0, _sy0, ssh, ssh, COLORS._main_icon, .3); + + var tc = _ins? COLORS._main_text_accent : COLORS._main_icon; + if(hov) tc = COLORS._main_text; + + draw_set_text(f_p2, fa_left, fa_center, tc); draw_set_alpha(aa); - draw_text(_sx1 + 12, _cy + lh / 2, inputs[_inp].name); + draw_text_add(_sx1 + 12, _cy + lh / 2, inputs[_inp].name); draw_set_alpha(1); - + if(_hover && point_in_rectangle(_m[0], _m[1], _x, _cy, _x + _w, _cy + lh)) { - hoverIndex = index; + hoverIndex = _ind; + + if(mouse_press(mb_left, _focus)) { + _layer_dragging = _ind; + _layer_drag_y = _m[1]; + + dynamic_input_inspecting = _ind; + refreshDynamicDisplay(); + } + if(layer_dragging != noone) { draw_set_color(COLORS._main_accent); - if(layer_dragging > index) - draw_line_width(_x + 16, _cy + lh + 2, _x + _w - 16, _cy + lh + 2, 2); - else if(layer_dragging < index) - draw_line_width(_x + 16, _cy - 2, _x + _w - 16, _cy - 2, 2); - } - } - - var binded = inputs[_inp].display_data.bone_id != ""; - - if(layer_dragging == noone || layer_dragging == index) { - var _bx = _x + 24; - if(point_in_circle(_m[0], _m[1], _bx, _cy + lh / 2, 16)) { - draw_sprite_ui_uniform(THEME.hamburger_s, 3, _bx, _cy + lh / 2, 1, c_white); - - if(mouse_press(mb_left, _focus)) - layer_dragging = index; - } else { - if(!binded) { - var cc = merge_color(COLORS._main_icon, COLORS._main_accent, 0.5 + 0.5 * (sin(current_time / 100) * 0.5 + 0.5)); - draw_sprite_ui_uniform(THEME.hamburger_s, 3, _bx, _cy + lh / 2, 1, cc); - } else - draw_sprite_ui_uniform(THEME.hamburger_s, 3, _bx, _cy + lh / 2, 1, COLORS._main_icon); + if(layer_dragging < _ind) draw_line_width(_x + 16, _cy + lh + 2, _x + _w - 16, _cy + lh + 2, 2); + else if(layer_dragging > _ind) draw_line_width(_x + 16, _cy - 2, _x + _w - 16, _cy - 2, 2); } } } + + if(_layer_dragging != noone) { + if(abs(_m[1] - _layer_drag_y) > 4) + layer_dragging = _layer_dragging; + } #endregion + if(mouse_release(mb_left)) _layer_dragging = noone; + if(layer_dragging != noone && mouse_release(mb_left)) { if(layer_dragging != hoverIndex && hoverIndex != noone) { var index = input_fix_len + layer_dragging * data_length; @@ -364,7 +356,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr layer_dragging = noone; } - layer_renderer.h = bh + ui(40) + sh; + layer_renderer.h = bh + ui(16) + sh; return layer_renderer.h; }); @@ -372,9 +364,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr input_display_list = [ 1, 2, ["Output", true], 0, ["Armature", false], 3, 4, layer_renderer, - ["Surfaces", true], ]; - input_display_list_len = array_length(input_display_list); function deleteLayer(index) { var idx = input_fix_len + index * data_length; @@ -394,30 +384,32 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr static createNewInput = function() { var index = array_length(inputs); var _s = floor((index - input_fix_len) / data_length); + if(!LOADING && !APPENDING) boneIDMap = array_verify(boneIDMap, max(array_length(boneIDMap), _s + 1)); newInput(index + 0, nodeValue_Surface("Surface", self)); inputs[index + 0].surface_index = index; inputs[index + 0].hover_effect = 0; - inputs[index + 0].display_data.bone_id = ""; - newInput(index + 1, nodeValue_Float("Transform", self, [ 0, 0, 0, 1, 1 ] )) + newInput(index + 1, nodeValue_Float("Transform", self, [ 0, 0, 0, 1, 1 ] )) .setDisplay(VALUE_DISPLAY.transform); - newInput(index + 2, nodeValue_Bool("Inherit Rotation", self, true )); + newInput(index + 2, nodeValue_Bool("Inherit Rotation", self, true )); newInput(index + 3, nodeValue_Bool("Apply Bone Rotation", self, false )); - newInput(index + 4, nodeValue_Bool("Inherit Scale", self, false )); - newInput(index + 5, nodeValue_Bool("Apply Bone Scale", self, false )); + newInput(index + 4, nodeValue_Bool("Inherit Scale", self, false )); + newInput(index + 5, nodeValue_Bool("Apply Bone Scale", self, false )); - for( var i = 0; i < data_length; i++ ) - array_push(input_display_list, index + i); - - while(_s >= array_length(attributes.layer_visible)) - array_push(attributes.layer_visible, true); - while(_s >= array_length(attributes.layer_selectable)) - array_push(attributes.layer_selectable, true); + while(_s >= array_length(attributes.layer_visible)) array_push(attributes.layer_visible, true); + while(_s >= array_length(attributes.layer_selectable)) array_push(attributes.layer_selectable, true); + refreshDynamicDisplay(); return inputs[index + 0]; - } setDynamicInput(6); + } + + input_display_dynamic = [ + ["Surface data", false], 0, 1, 2, 3, 4, 5, + ]; + + setDynamicInput(6, true, VALUE_TYPE.surface); temp_surface = [ surface_create(1, 1), surface_create(1, 1), surface_create(1, 1) ]; blend_temp_surface = temp_surface[2]; @@ -470,6 +462,13 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr } static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { + if(isUsingTool("Pose")) { + var _arm = inputs[1].value_from; + if(_arm == noone) return; + + return _arm.node.drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); + } + var dim = getInputData(0); var _bind = getInputData(2); @@ -509,7 +508,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr _tran = array_clone(_tran); - var _bone = inputs[surf_dragging].display_data.bone_id; + var _bone = array_safe_get(boneIDMap, (surf_dragging - input_fix_len) / data_length, ""); _bone = boneMap[? _bone]; if(drag_type == NODE_COMPOSE_DRAG.move) { @@ -579,11 +578,9 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var _surf = array_safe_get_fast(current_data, index); if(!_surf || is_array(_surf)) continue; - var _bone = inputs[index].display_data.bone_id; - if(!ds_map_exists(boneMap, _bone)) { - //print($"Bone not found {_bone}"); - continue; - } + var _bone = array_safe_get(boneIDMap, i, ""); + if(!ds_map_exists(boneMap, _bone)) continue; + _bone = boneMap[? _bone]; var _tran = current_data[index + 1]; @@ -644,9 +641,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var _surf = array_safe_get_fast(current_data, index); if(!_surf || is_array(_surf)) continue; - var _bone = inputs[index].display_data.bone_id; - if(!ds_map_exists(boneMap, _bone)) - continue; + var _bone = array_safe_get(boneIDMap, i, ""); + if(!ds_map_exists(boneMap, _bone)) continue; var a = anchors[index]; @@ -749,18 +745,13 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr } } - static processData = function(_outSurf, _data, _output_index, _array_index) { - if(_output_index == 1) return atlas_data; - if(_output_index == 2) return bind_data; - if(_output_index == 0 && _array_index == 0) { - atlas_data = []; - bind_data = []; - } + static processData = function(_outData, _data, _output_index, _array_index) { + var atlas_data = []; + var bind_data = []; var _dim = _data[0]; var _bone = _data[1]; var _bind = _data[2]; - var _dpos = _data[3]; var _dsca = _data[4]; var cDep = attrDepth(); @@ -769,6 +760,9 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr ////////////////////////////////////////// + if(getInputAmount() == 0) return _outData; + dynamic_input_inspecting = clamp(dynamic_input_inspecting, 0, getInputAmount() - 1); + overlay_w = _dim[0]; overlay_h = _dim[1]; @@ -802,10 +796,8 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr if(!is_surface(_s)) continue; - var _b = use_data? _bind[i].bone : inputs[datInd].display_data.bone_id; - - if(!ds_map_exists(boneMap, _b)) - continue; + var _b = use_data? _bind[i].bone : array_safe_get(boneIDMap, i, ""); + if(!ds_map_exists(boneMap, _b)) continue; _b = boneMap[? _b]; @@ -846,24 +838,24 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr _bg = !_bg; } - _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], cDep); + var _outSurf = surface_verify(_outData[0], _dim[0], _dim[1], cDep); surface_set_shader(_outSurf); draw_surface_safe(temp_surface[!_bg]); surface_reset_shader(); - return _outSurf; + return [ _outSurf, atlas_data, bind_data ]; } static resetTransform = function(surfIndex) { - var _bind = getInputData(2); + var _bind = getInputData(2); var use_data = _bind != noone; var _surf = getInputData(surfIndex + 0); var _tran = getInputData(surfIndex + 1); var _arot = getInputData(surfIndex + 2); - var _b = use_data? _bind[i].bone : inputs[surfIndex].display_data.bone_id; + var _b = use_data? _bind[i].bone : array_safe_get(boneIDMap, (surfIndex - input_fix_len) / data_length, ""); if(!ds_map_exists(boneMap, _b)) return; _b = boneMap[? _b]; @@ -879,24 +871,16 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr } static attributeSerialize = function() { - var att = {}; - att.layer_visible = attributes.layer_visible; - att.layer_selectable = attributes.layer_selectable; + var att = { + boneIDMap, + }; return att; } static attributeDeserialize = function(attr) { - struct_append(attributes, attr); - - if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension")) - attributes.use_project_dimension = false; - - if(struct_has(attr, "layer_visible")) - attributes.layer_visible = attr.layer_visible; - - if(struct_has(attr, "layer_selectable")) - attributes.layer_selectable = attr.layer_selectable; + struct_append(attributes, attr); + boneIDMap = struct_try_get(attr, "boneIDMap", boneIDMap); } static doApplyDeserialize = function() { diff --git a/scripts/node_armature_path/node_armature_path.gml b/scripts/node_armature_path/node_armature_path.gml index c0b87458c..37fe0de42 100644 --- a/scripts/node_armature_path/node_armature_path.gml +++ b/scripts/node_armature_path/node_armature_path.gml @@ -13,7 +13,6 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const current_length = 0; boundary = new BoundingBox(); - #region ++++ attributes ++++ attributes.display_name = true; attributes.display_bone = 0; @@ -26,14 +25,13 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const new scrollBox(["Octahedral", "Stick"], function(ind) { attributes.display_bone = ind; })]); - #endregion - static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region - var _b = getInputData(0); - + static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { + var _b = getInputData(0); if(_b == noone) return; + _b.draw(attributes, false, _x, _y, _s, _mx, _my); - } #endregion + } static getBoundary = function() { return boundary; } @@ -42,11 +40,9 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const static getLength = function() { return current_length; } static getAccuLength = function() { return [ 0, current_length ]; } - static getWeightDistance = function (_dist, _ind = 0) { #region - return getWeightRatio(_dist / current_length, _ind); - } #endregion + static getWeightDistance = function (_dist, _ind = 0) { return getWeightRatio(_dist / current_length, _ind); } - static getWeightRatio = function (_rat, _ind = 0) { #region + static getWeightRatio = function (_rat, _ind = 0) { var _p0 = lines[_ind][0]; var _p1 = lines[_ind][1]; @@ -54,11 +50,11 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const if(!is_array(_p1) || array_length(_p1) < 3) return 1; return lerp(_p0[2], _p1[2], _rat); - } #endregion + } static getPointDistance = function(_dist, _ind = 0, out = undefined) { return getPointRatio(_dist / current_length, _ind, out); } - static getPointRatio = function(_rat, _ind = 0, out = undefined) { #region + static getPointRatio = function(_rat, _ind = 0, out = undefined) { if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; } var _p0 = lines[_ind][0]; @@ -71,9 +67,9 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const out.y = lerp(_p0[1], _p1[1], _rat); return out; - } #endregion + } - static update = function() { #region + static update = function() { var _bone = getInputData(0); if(_bone == noone) return; @@ -108,10 +104,10 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const ds_stack_destroy(_bst); outputs[0].setValue(self); - } #endregion + } - static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { var bbox = drawGetBbox(xx, yy, _s); draw_sprite_fit(s_node_armature_path, 0, bbox.xc, bbox.yc, bbox.w, bbox.h); - } #endregion + } } \ No newline at end of file diff --git a/scripts/node_armature_sample/node_armature_sample.gml b/scripts/node_armature_sample/node_armature_sample.gml index c6377595c..50626cba0 100644 --- a/scripts/node_armature_sample/node_armature_sample.gml +++ b/scripts/node_armature_sample/node_armature_sample.gml @@ -14,7 +14,6 @@ function Node_Armature_Sample(_x, _y, _group = noone) : Node(_x, _y, _group) con newOutput(0, nodeValue_Output("Position", self, VALUE_TYPE.integer, [ 0, 0 ])) .setDisplay(VALUE_DISPLAY.vector); - #region ++++ attributes ++++ attributes.display_name = true; attributes.display_bone = 0; @@ -27,16 +26,15 @@ function Node_Armature_Sample(_x, _y, _group = noone) : Node(_x, _y, _group) con new scrollBox(["Octahedral", "Stick"], function(ind) { attributes.display_bone = ind; })]); - #endregion - static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region + static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { var _b = getInputData(0); if(_b == noone) return; _b.draw(attributes, false, _x, _y, _s, _mx, _my); - } #endregion + } - static update = function() { #region + static update = function() { var _bone = getInputData(0); var _name = getInputData(1); var _prog = getInputData(2); @@ -53,10 +51,10 @@ function Node_Armature_Sample(_x, _y, _group = noone) : Node(_x, _y, _group) con var _p = _b.getPoint(_prog); outputs[0].setValue([_p.x, _p.y]); - } #endregion + } - static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { var bbox = drawGetBbox(xx, yy, _s); draw_sprite_fit(s_node_armature_sample, 0, bbox.xc, bbox.yc, bbox.w, bbox.h); - } #endregion + } } \ No newline at end of file diff --git a/scripts/node_array_sample/node_array_sample.gml b/scripts/node_array_sample/node_array_sample.gml index b000ea8b0..45a3d6754 100644 --- a/scripts/node_array_sample/node_array_sample.gml +++ b/scripts/node_array_sample/node_array_sample.gml @@ -12,7 +12,7 @@ function Node_Array_Sample(_x, _y, _group = noone) : Node(_x, _y, _group) constr newInput(3, nodeValue_Int("Shift", self, 0)) - newInput(4, nodeValueSeed(self, VALUE_TYPE.float)); + newInput(4, nodeValueSeed(self)); newInput(5, nodeValue_Int("Amount", self, 4)) diff --git a/scripts/node_array_shuffle/node_array_shuffle.gml b/scripts/node_array_shuffle/node_array_shuffle.gml index a5a701133..332d452f4 100644 --- a/scripts/node_array_shuffle/node_array_shuffle.gml +++ b/scripts/node_array_shuffle/node_array_shuffle.gml @@ -6,8 +6,7 @@ function Node_Array_Shuffle(_x, _y, _group = noone) : Node(_x, _y, _group) const newInput(0, nodeValue("Array in", self, CONNECT_TYPE.input, VALUE_TYPE.any, [])) .setVisible(true, true); - newInput(1, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }) + newInput(1, nodeValueSeed(self)) .rejectArray(); newOutput(0, nodeValue_Output("Shuffled array", self, VALUE_TYPE.any, [])); diff --git a/scripts/node_bevel/node_bevel.gml b/scripts/node_bevel/node_bevel.gml index d467792c9..6b2fac622 100644 --- a/scripts/node_bevel/node_bevel.gml +++ b/scripts/node_bevel/node_bevel.gml @@ -70,7 +70,7 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con var _shf = _data[2]; var _sca = _data[3]; var _slp = _data[4]; - var _sam = struct_try_get(attributes, "oversample"); + var _sam = getAttribute("oversample"); var _dim = surface_get_dimension(_data[0]); surface_set_shader(_outSurf, max(_dim[0], _dim[1]) < 256? sh_bevel : sh_bevel_highp); diff --git a/scripts/node_blur/node_blur.gml b/scripts/node_blur/node_blur.gml index d259b5594..22819ba3f 100644 --- a/scripts/node_blur/node_blur.gml +++ b/scripts/node_blur/node_blur.gml @@ -54,7 +54,7 @@ function Node_Blur(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons static processData = function(_outSurf, _data, _output_index, _array_index) { var _surf = _data[0]; var _size = min(128, _data[1]); - var _clamp = struct_try_get(attributes, "oversample"); + var _clamp = getAttribute("oversample"); var _isovr = _data[3]; var _mask = _data[5]; var _mix = _data[6]; diff --git a/scripts/node_blur_directional/node_blur_directional.gml b/scripts/node_blur_directional/node_blur_directional.gml index 5b1399dd6..4e4e4e8ec 100644 --- a/scripts/node_blur_directional/node_blur_directional.gml +++ b/scripts/node_blur_directional/node_blur_directional.gml @@ -75,7 +75,7 @@ function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y, shader_set_f_map("direction", _data[ 2], _data[10], inputs[ 2]); shader_set_i("scale", _data[11]); shader_set_i("gamma", _data[12]); - shader_set_i("sampleMode", struct_try_get(attributes, "oversample")); + shader_set_i("sampleMode", getAttribute("oversample")); draw_surface_safe(_data[0]); surface_reset_shader(); diff --git a/scripts/node_blur_path/node_blur_path.gml b/scripts/node_blur_path/node_blur_path.gml index 39b5bb2b8..8e856699c 100644 --- a/scripts/node_blur_path/node_blur_path.gml +++ b/scripts/node_blur_path/node_blur_path.gml @@ -58,7 +58,7 @@ function Node_Blur_Path(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) static processData = function(_outSurf, _data, _output_index, _array_index) { if(!is_surface(_data[0])) return _outSurf; - var _samp = struct_try_get(attributes, "oversample"); + var _samp = getAttribute("oversample"); var _surf = _data[0]; var _path = _data[1]; var _reso = _data[2]; diff --git a/scripts/node_blur_shape/node_blur_shape.gml b/scripts/node_blur_shape/node_blur_shape.gml index 8ce57ce6e..ab38b2886 100644 --- a/scripts/node_blur_shape/node_blur_shape.gml +++ b/scripts/node_blur_shape/node_blur_shape.gml @@ -39,7 +39,7 @@ function Node_Blur_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group static processData = function(_outSurf, _data, _output_index, _array_index) { #region if(!is_surface(_data[0])) return _outSurf; - var _samp = struct_try_get(attributes, "oversample"); + var _samp = getAttribute("oversample"); var _blur = _data[1]; var _mask = _data[2]; var _mode = _data[7]; diff --git a/scripts/node_blur_simple/node_blur_simple.gml b/scripts/node_blur_simple/node_blur_simple.gml index bd6c504a0..ceb9678d1 100644 --- a/scripts/node_blur_simple/node_blur_simple.gml +++ b/scripts/node_blur_simple/node_blur_simple.gml @@ -58,7 +58,7 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou static processData = function(_outSurf, _data, _output_index, _array_index) { if(!is_surface(_data[0])) return _outSurf; var _size = _data[1]; - var _samp = struct_try_get(attributes, "oversample"); + var _samp = getAttribute("oversample"); var _mask = _data[3]; var _isovr = _data[4]; var _overc = _data[5]; diff --git a/scripts/node_blur_slope/node_blur_slope.gml b/scripts/node_blur_slope/node_blur_slope.gml index 62c6067e1..7f26449a0 100644 --- a/scripts/node_blur_slope/node_blur_slope.gml +++ b/scripts/node_blur_slope/node_blur_slope.gml @@ -57,7 +57,7 @@ function Node_Blur_Slope(_x, _y, _group = noone) : Node_Processor(_x, _y, _group shader_set_f("stepSize", _data[10]); shader_set_surface("slopeMap", _data[2]); shader_set_f("slopeMapDim", surface_get_dimension(_data[2])); - shader_set_i("sampleMode", struct_try_get(attributes, "oversample")); + shader_set_i("sampleMode", getAttribute("oversample")); shader_set_i("gamma", _data[11]); draw_surface_safe(_data[0]); diff --git a/scripts/node_blur_zoom/node_blur_zoom.gml b/scripts/node_blur_zoom/node_blur_zoom.gml index d5247727d..0c8874675 100644 --- a/scripts/node_blur_zoom/node_blur_zoom.gml +++ b/scripts/node_blur_zoom/node_blur_zoom.gml @@ -65,7 +65,7 @@ function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) } static processData = function(_outSurf, _data, _output_index, _array_index) { - var _sam = struct_try_get(attributes, "oversample"); + var _sam = getAttribute("oversample"); var _cen = array_clone(_data[2]); _cen[0] /= surface_get_width_safe(_outSurf); diff --git a/scripts/node_brush_linear/node_brush_linear.gml b/scripts/node_brush_linear/node_brush_linear.gml index 04dd5190d..3f7bb5f35 100644 --- a/scripts/node_brush_linear/node_brush_linear.gml +++ b/scripts/node_brush_linear/node_brush_linear.gml @@ -9,8 +9,7 @@ function Node_Brush_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro newInput(2, nodeValue_Int("Iteration", self, 10)) .setValidator(VV_min(1)); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }) + newInput(3, nodeValueSeed(self)); newInput(4, nodeValue_Float("Length", self, 10)); diff --git a/scripts/node_caustic/node_caustic.gml b/scripts/node_caustic/node_caustic.gml index 882e186ea..e663129c0 100644 --- a/scripts/node_caustic/node_caustic.gml +++ b/scripts/node_caustic/node_caustic.gml @@ -9,11 +9,10 @@ function Node_Caustic(_x, _y, _group = noone) : Node_Shader_Generator(_x, _y, _g newInput(2, nodeValue_Vec2("Scale", self, [ 4, 4 ])); addShaderProp(SHADER_UNIFORM.float, "scale"); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); - newInput(4, nodeValue_Float("Progress", self, 0)) + newInput(4, nodeValue_Float("Progress", self, 0)); addShaderProp(SHADER_UNIFORM.float, "progress"); newInput(5, nodeValue_Float("Detail", self, 1.24)) diff --git a/scripts/node_cellular/node_cellular.gml b/scripts/node_cellular/node_cellular.gml index 85ece912f..00ddd727b 100644 --- a/scripts/node_cellular/node_cellular.gml +++ b/scripts/node_cellular/node_cellular.gml @@ -9,8 +9,7 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(2, nodeValue_Float("Scale", self, 4)) .setMappable(11); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); newInput(4, nodeValue_Enum_Scroll("Type", self, 0, [ "Point", "Edge", "Cell", "Crystal" ])); diff --git a/scripts/node_color_replace/node_color_replace.gml b/scripts/node_color_replace/node_color_replace.gml index fee1b62e4..2e3f38844 100644 --- a/scripts/node_color_replace/node_color_replace.gml +++ b/scripts/node_color_replace/node_color_replace.gml @@ -29,7 +29,7 @@ function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr newInput(13, nodeValue_Enum_Scroll("Mode", self, 0, [ "Closet", "Random" ])); - newInput(14, nodeValueSeed(self, VALUE_TYPE.float)); + newInput(14, nodeValueSeed(self)); input_display_list = [ 9, 10, 14, ["Surfaces", true], 0, 7, 8, 11, 12, diff --git a/scripts/node_composite/node_composite.gml b/scripts/node_composite/node_composite.gml index 792b162d4..8bee6b270 100644 --- a/scripts/node_composite/node_composite.gml +++ b/scripts/node_composite/node_composite.gml @@ -226,12 +226,12 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) draw_sprite_ui_uniform(THEME.icon_canvas, 0, _icx, _icy, 1, _icc, _ica); draw_set_alpha(aa); - draw_text(_txx + ui(8 + 16), _txy, _txt); + draw_text_add(_txx + ui(8 + 16), _txy, _txt); draw_set_alpha(1); } else { draw_set_alpha(aa); - draw_text(_txx, _txy, _txt); + draw_text_add(_txx, _txy, _txt); draw_set_alpha(1); } } @@ -429,11 +429,6 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(index + 5, nodeValue_Float($"Opacity {_s}", self, 1)) .setDisplay(VALUE_DISPLAY.slider); - for( var i = 0; i < data_length; i++ ) { - array_push(input_display_list, index + i); - inputs[index + i].surface_index = index; - } - while(_s >= array_length(attributes.layer_visible)) array_push(attributes.layer_visible, true); @@ -771,7 +766,6 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _outSurf = _outData[0]; if(getInputAmount() == 0) return _outData; - dynamic_input_inspecting = clamp(dynamic_input_inspecting, 0, getInputAmount() - 1); var _pad = _data[0]; diff --git a/scripts/node_crop_content/node_crop_content.gml b/scripts/node_crop_content/node_crop_content.gml index 42a25b9c4..891f55f3f 100644 --- a/scripts/node_crop_content/node_crop_content.gml +++ b/scripts/node_crop_content/node_crop_content.gml @@ -9,11 +9,13 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr .setTooltip("Cropping mode for dealing with image array."); newInput(3, nodeValue_Padding("Padding", self, [ 0, 0, 0, 0 ], "Add padding back after crop.")); + + newInput(4, nodeValue_Color("Background", self, cola(c_black, 0))); newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); input_display_list = [ 1, - ["Surfaces", false], 0, 2, + ["Surfaces", false], 0, 2, 4, ["Padding", false], 3, ] @@ -24,13 +26,14 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr drag_my = 0; drag_sv = 0; - temp_surface = [ surface_create(1, 1, surface_r32float), surface_create(1, 1, surface_r32float) ]; + temp_surface = [ 0, 0 ]; static update = function() { var _inSurf = getInputData(0); var _active = getInputData(1); var _array = getInputData(2); var _padd = getInputData(3); + var _bg = getInputData(4); var _outSurf = outputs[0].getValue(); surface_array_free(_outSurf); @@ -38,7 +41,6 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(!_active) { _outSurf = surface_array_clone(_inSurf); outputs[0].setValue(_outSurf); - return; } @@ -63,23 +65,33 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _dim = [ surface_get_width_safe(_surf), surface_get_height_safe(_surf) ]; var _minx = 0, _miny = 0, _maxx = _dim[0] - 1, _maxy = _dim[1] - 1; - temp_surface[0] = surface_verify(temp_surface[0], _dim[0], _dim[1], surface_r32float); - temp_surface[1] = surface_verify(temp_surface[1], _dim[0], _dim[1], surface_r32float); + temp_surface[0] = surface_verify(temp_surface[0], _dim[0], _dim[1], surface_r8unorm); + temp_surface[1] = surface_verify(temp_surface[1], _dim[0], _dim[1], surface_r8unorm); surface_set_shader(temp_surface[0], sh_find_boundary_stretch_x); + shader_set_color("background", _bg); shader_set_f("dimension", _dim); + draw_surface_safe(_surf); surface_reset_shader(); surface_set_shader(temp_surface[1], sh_find_boundary_stretch_y); + shader_set_color("background", _bg); shader_set_f("dimension", _dim); + draw_surface_safe(_surf); surface_reset_shader(); - for( ; _minx < _dim[0]; _minx++ ) if(surface_get_pixel(temp_surface[0], _minx, 0) > 0) break; - for( ; _maxx >= 0; _maxx-- ) if(surface_get_pixel(temp_surface[0], _maxx, 0) > 0) break; - for( ; _miny < _dim[1]; _miny++ ) if(surface_get_pixel(temp_surface[1], 0, _miny) > 0) break; - for( ; _maxy >= 0; _maxy-- ) if(surface_get_pixel(temp_surface[1], 0, _maxy) > 0) break; + var _buff0 = buffer_from_surface(temp_surface[0], false); + var _buff1 = buffer_from_surface(temp_surface[1], false); + + for( ; _minx < _dim[0]; _minx++ ) if(buffer_read_at(_buff0, _minx, buffer_u8) > 0) break; + for( ; _maxx >= 0; _maxx-- ) if(buffer_read_at(_buff0, _maxx, buffer_u8) > 0) break; + for( ; _miny < _dim[1]; _miny++ ) if(buffer_read_at(_buff1, _dim[0] * _miny, buffer_u8) > 0) break; + for( ; _maxy >= 0; _maxy-- ) if(buffer_read_at(_buff1, _dim[0] * _maxy, buffer_u8) > 0) break; + + buffer_delete(_buff0); + buffer_delete(_buff1); if(_array) { minx[j] = _minx; diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 8c0e0aa90..3524548de 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -2419,7 +2419,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { postLoad(); } - anim_timeline = attributes.show_timeline; + anim_timeline = struct_try_get(attributes, "show_timeline", false); if(anim_timeline) refreshTimeline(); } diff --git a/scripts/node_diffuse/node_diffuse.gml b/scripts/node_diffuse/node_diffuse.gml index 8601d9a33..2a6364d46 100644 --- a/scripts/node_diffuse/node_diffuse.gml +++ b/scripts/node_diffuse/node_diffuse.gml @@ -15,8 +15,7 @@ function Node_Diffuse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor newInput(5, nodeValue_Slider_Range("Threshold", self, [ 0.5, 0.7 ])); - newInput(6, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[6].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(6, nodeValueSeed(self)); newInput(7, nodeValue_Surface("External", self)); diff --git a/scripts/node_dilate/node_dilate.gml b/scripts/node_dilate/node_dilate.gml index d4ba4f399..bf1ee4869 100644 --- a/scripts/node_dilate/node_dilate.gml +++ b/scripts/node_dilate/node_dilate.gml @@ -71,7 +71,7 @@ function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co } static processData = function(_outSurf, _data, _output_index, _array_index) { - var sam = struct_try_get(attributes, "oversample"); + var sam = getAttribute("oversample"); surface_set_shader(_outSurf, sh_dilate); shader_set_interpolation(_data[0]); diff --git a/scripts/node_dither/node_dither.gml b/scripts/node_dither/node_dither.gml index 0e51e3fd4..276bf432a 100644 --- a/scripts/node_dither/node_dither.gml +++ b/scripts/node_dither/node_dither.gml @@ -44,8 +44,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co __init_mask_modifier(7); // inputs 11, 12, - newInput(13, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[13].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(13, nodeValueSeed(self)); newInput(14, nodeValue_Bool("Use palette", self, true)); diff --git a/scripts/node_edge_detect/node_edge_detect.gml b/scripts/node_edge_detect/node_edge_detect.gml index 7e83b9537..14f4dbeaf 100644 --- a/scripts/node_edge_detect/node_edge_detect.gml +++ b/scripts/node_edge_detect/node_edge_detect.gml @@ -41,7 +41,7 @@ function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou static processData = function(_outSurf, _data, _output_index, _array_index) { var ft = _data[1]; - var ov = struct_try_get(attributes, "oversample"); + var ov = getAttribute("oversample"); surface_set_target(_outSurf); DRAW_CLEAR diff --git a/scripts/node_fn_wiggler/node_fn_wiggler.gml b/scripts/node_fn_wiggler/node_fn_wiggler.gml index f9d09d68d..ad43dc935 100644 --- a/scripts/node_fn_wiggler/node_fn_wiggler.gml +++ b/scripts/node_fn_wiggler/node_fn_wiggler.gml @@ -6,8 +6,7 @@ function Node_Wiggler(_x, _y, _group = noone) : Node_Fn(_x, _y, _group) construc newInput(inl + 1, nodeValue_Int("Frequency", self, 4 )) .setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 0.1] }); - newInput(inl + 2, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[inl + 2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(inl + 2, nodeValueSeed(self)); newInput(inl + 3, nodeValue_Toggle("Clip", self, 0b11 , { data : [ "Start", "End" ] })); diff --git a/scripts/node_gabor_noise/node_gabor_noise.gml b/scripts/node_gabor_noise/node_gabor_noise.gml index 1062cb410..9b8d205b0 100644 --- a/scripts/node_gabor_noise/node_gabor_noise.gml +++ b/scripts/node_gabor_noise/node_gabor_noise.gml @@ -10,8 +10,7 @@ function Node_Gabor_Noise(_x, _y, _group = noone) : Node_Shader_Generator(_x, _y .setMappable(8); addShaderProp(SHADER_UNIFORM.float, "scale"); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(4, nodeValue_Float("Density", self, 2)) diff --git a/scripts/node_grain/node_grain.gml b/scripts/node_grain/node_grain.gml index 0ddee0e16..15e0e77f4 100644 --- a/scripts/node_grain/node_grain.gml +++ b/scripts/node_grain/node_grain.gml @@ -21,8 +21,7 @@ function Node_Grain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con newInput(8, nodeValueMap("Brightness map", self)); - newInput(9, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[9].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(9, nodeValueSeed(self)); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/scripts/node_grid/node_grid.gml b/scripts/node_grid/node_grid.gml index da0641b12..d9a37b1f8 100644 --- a/scripts/node_grid/node_grid.gml +++ b/scripts/node_grid/node_grid.gml @@ -31,8 +31,7 @@ function Node_Grid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons newInput(10, nodeValue_Enum_Scroll("Render type", self, 0, ["Colored tile", "Colored tile (Accurate)", "Height map", "Texture grid", "Texture sample"])); - newInput(11, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[11].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(11, nodeValueSeed(self)); newInput(12, nodeValue_Bool("Anti aliasing", self, false)); diff --git a/scripts/node_grid_hex/node_grid_hex.gml b/scripts/node_grid_hex/node_grid_hex.gml index fd3e6577a..bec5f1638 100644 --- a/scripts/node_grid_hex/node_grid_hex.gml +++ b/scripts/node_grid_hex/node_grid_hex.gml @@ -23,8 +23,7 @@ function Node_Grid_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(7, nodeValue_Enum_Scroll("Render type", self, 0, ["Colored tile", "Height map", "Texture grid", "Texture sample"])); - newInput(8, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(8, nodeValueSeed(self)); newInput(9, nodeValue_Surface("Texture", self)); diff --git a/scripts/node_grid_noise/node_grid_noise.gml b/scripts/node_grid_noise/node_grid_noise.gml index 90e4792ee..75554a60e 100644 --- a/scripts/node_grid_noise/node_grid_noise.gml +++ b/scripts/node_grid_noise/node_grid_noise.gml @@ -8,8 +8,7 @@ function Node_Grid_Noise(_x, _y, _group = noone) : Node_Processor(_x, _y, _group newInput(2, nodeValue_Vec2("Scale", self, [ 8, 8 ])); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); newInput(4, nodeValue_Float("Shift", self, 0)) .setDisplay(VALUE_DISPLAY.slider, { range: [-0.5, 0.5, 0.01] }); diff --git a/scripts/node_grid_pentagonal/node_grid_pentagonal.gml b/scripts/node_grid_pentagonal/node_grid_pentagonal.gml index 70ec8d5c3..4b34a7124 100644 --- a/scripts/node_grid_pentagonal/node_grid_pentagonal.gml +++ b/scripts/node_grid_pentagonal/node_grid_pentagonal.gml @@ -25,8 +25,7 @@ function Node_Grid_Pentagonal(_x, _y, _group = noone) : Node_Processor(_x, _y, _ newInput(8, nodeValue_Enum_Scroll("Render type", self, 0, ["Colored tile", "Height map", "Texture grid"])); - newInput(9, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[9].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(9, nodeValueSeed(self)); newInput(10, nodeValue_Bool("Anti aliasing", self, false)); diff --git a/scripts/node_grid_tri/node_grid_tri.gml b/scripts/node_grid_tri/node_grid_tri.gml index d265e65b2..d257732ef 100644 --- a/scripts/node_grid_tri/node_grid_tri.gml +++ b/scripts/node_grid_tri/node_grid_tri.gml @@ -25,8 +25,7 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(8, nodeValue_Enum_Scroll("Render type", self, 0, ["Colored tile", "Height map", "Texture grid", "Texture sample"])); - newInput(9, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[9].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(9, nodeValueSeed(self)); newInput(10, nodeValue_Bool("Anti aliasing", self, false)); diff --git a/scripts/node_herringbone_tile/node_herringbone_tile.gml b/scripts/node_herringbone_tile/node_herringbone_tile.gml index d815adeaf..bc8cfe38d 100644 --- a/scripts/node_herringbone_tile/node_herringbone_tile.gml +++ b/scripts/node_herringbone_tile/node_herringbone_tile.gml @@ -23,8 +23,7 @@ function Node_Herringbone_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, newInput(7, nodeValue_Enum_Scroll("Render type", self, 0, ["Colored tile", "Height map", "Texture grid"])); - newInput(8, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(8, nodeValueSeed(self)); newInput(9, nodeValue_Surface("Texture", self)); diff --git a/scripts/node_honey_noise/node_honey_noise.gml b/scripts/node_honey_noise/node_honey_noise.gml index faedbcbe3..93dcd985e 100644 --- a/scripts/node_honey_noise/node_honey_noise.gml +++ b/scripts/node_honey_noise/node_honey_noise.gml @@ -15,8 +15,7 @@ function Node_Honeycomb_Noise(_x, _y, _group = noone) : Node_Shader_Generator(_x newInput(4, nodeValue_Enum_Button("Mode", self, 0, [ "Hexagon", "Star" ])); addShaderProp(SHADER_UNIFORM.integer, "mode"); - newInput(5, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }) + newInput(5, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(6, nodeValue_Int("Iteration", self, 1)); diff --git a/scripts/node_liquefy/node_liquefy.gml b/scripts/node_liquefy/node_liquefy.gml index 94bac7d3d..c3c90b49f 100644 --- a/scripts/node_liquefy/node_liquefy.gml +++ b/scripts/node_liquefy/node_liquefy.gml @@ -296,7 +296,7 @@ function Node_Liquefy(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c var _amo = getInputAmount(); if(_amo == 0) return _outSurf; - var sam = struct_try_get(attributes, "oversample"); + var sam = getAttribute("oversample"); var _surf = _data[0]; if(!is_surface(_surf)) return _outSurf; diff --git a/scripts/node_local_analyze/node_local_analyze.gml b/scripts/node_local_analyze/node_local_analyze.gml index 44b58bb52..63cbd1fc9 100644 --- a/scripts/node_local_analyze/node_local_analyze.gml +++ b/scripts/node_local_analyze/node_local_analyze.gml @@ -45,7 +45,7 @@ function Node_Local_Analyze(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr var _alg = _data[1]; var _siz = _data[2]; var _shp = _data[4]; - var _sam = struct_try_get(attributes, "oversample"); + var _sam = getAttribute("oversample"); surface_set_shader(_outSurf, sh_local_analyze); shader_set_f("dimension" , surface_get_dimension(_data[0])); diff --git a/scripts/node_lovify/node_lovify.gml b/scripts/node_lovify/node_lovify.gml index fed42564a..c6e6015a1 100644 --- a/scripts/node_lovify/node_lovify.gml +++ b/scripts/node_lovify/node_lovify.gml @@ -4,8 +4,7 @@ function Node_Lovify(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co newInput(0, nodeValue_Surface("Surface in", self)); - newInput(1, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(1, nodeValueSeed(self)); newInput(2, nodeValue_Float("Density", self, 0.5 )) .setDisplay(VALUE_DISPLAY.slider); diff --git a/scripts/node_mesh_warp/node_mesh_warp.gml b/scripts/node_mesh_warp/node_mesh_warp.gml index d75962632..0ff69503c 100644 --- a/scripts/node_mesh_warp/node_mesh_warp.gml +++ b/scripts/node_mesh_warp/node_mesh_warp.gml @@ -178,8 +178,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(8, nodeValue_Enum_Scroll("Mesh Type", self, 0, [ new scrollItem("Grid", s_node_mesh_type, 0), new scrollItem("Custom", s_node_mesh_type, 1), ] )); - newInput(9, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[9].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(9, nodeValueSeed(self)); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/scripts/node_mk_blinker/node_mk_blinker.gml b/scripts/node_mk_blinker/node_mk_blinker.gml index 8541cb58a..0dc802958 100644 --- a/scripts/node_mk_blinker/node_mk_blinker.gml +++ b/scripts/node_mk_blinker/node_mk_blinker.gml @@ -6,8 +6,7 @@ function Node_MK_Blinker(_x, _y, _group = noone) : Node_Processor(_x, _y, _group newInput(1, nodeValue_Surface("Mask", self)); - newInput(2, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(2, nodeValueSeed(self)); newInput(3, nodeValue_Float("Amount", self, 0.5)) .setDisplay(VALUE_DISPLAY.slider); diff --git a/scripts/node_mk_brownian/node_mk_brownian.gml b/scripts/node_mk_brownian/node_mk_brownian.gml index 1a3a06384..0cdab35d4 100644 --- a/scripts/node_mk_brownian/node_mk_brownian.gml +++ b/scripts/node_mk_brownian/node_mk_brownian.gml @@ -18,8 +18,7 @@ function Node_MK_Brownian(_x, _y, _group = noone) : Node(_x, _y, _group) constru newInput(7, nodeValue_Curve("Alpha", self, CURVE_DEF_11)); - newInput(8, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(8, nodeValueSeed(self)); newInput(9, nodeValue_Range("Angular speed", self, [ -45, 45 ])); diff --git a/scripts/node_mk_delay_machine/node_mk_delay_machine.gml b/scripts/node_mk_delay_machine/node_mk_delay_machine.gml index f27a89a01..df95dc7f3 100644 --- a/scripts/node_mk_delay_machine/node_mk_delay_machine.gml +++ b/scripts/node_mk_delay_machine/node_mk_delay_machine.gml @@ -16,8 +16,7 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co newInput(5, nodeValue_Enum_Scroll("Palette Select", self, 0, [ "Loop", "Pingpong", "Random" ])); - newInput(6, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[6].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(6, nodeValueSeed(self)); newInput(7, nodeValue_Bool("Loop", self, false)); diff --git a/scripts/node_mk_fall/node_mk_fall.gml b/scripts/node_mk_fall/node_mk_fall.gml index 46f6cdc7a..c97a58d26 100644 --- a/scripts/node_mk_fall/node_mk_fall.gml +++ b/scripts/node_mk_fall/node_mk_fall.gml @@ -6,8 +6,7 @@ function Node_MK_Fall(_x, _y, _group = noone) : Node(_x, _y, _group) constructor newInput(1, nodeValue_Dimension(self)); - newInput(2, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(2, nodeValueSeed(self)); newInput(3, nodeValue_Area("Area", self, DEF_AREA)); diff --git a/scripts/node_mk_gridballs/node_mk_gridballs.gml b/scripts/node_mk_gridballs/node_mk_gridballs.gml index 9eec03325..f2736ee1e 100644 --- a/scripts/node_mk_gridballs/node_mk_gridballs.gml +++ b/scripts/node_mk_gridballs/node_mk_gridballs.gml @@ -11,8 +11,7 @@ function Node_MK_GridBalls(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro newInput(4, nodeValue_Float("Scatter", self, 0)); - newInput(5, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(5, nodeValueSeed(self)); newInput(6, nodeValue_Float("Shading", self, 0.5)) .setDisplay(VALUE_DISPLAY.slider); diff --git a/scripts/node_mk_gridflip/node_mk_gridflip.gml b/scripts/node_mk_gridflip/node_mk_gridflip.gml index 4bf6aff51..a425a2006 100644 --- a/scripts/node_mk_gridflip/node_mk_gridflip.gml +++ b/scripts/node_mk_gridflip/node_mk_gridflip.gml @@ -7,8 +7,7 @@ function Node_MK_GridFlip(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput(2, nodeValue_Vec2("Amount", self, [ 4, 4 ])); - newInput(3, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); newInput(4, nodeValue_Surface("Surface back", self)); diff --git a/scripts/node_mk_rain/node_mk_rain.gml b/scripts/node_mk_rain/node_mk_rain.gml index 3cefb66f7..48345c04c 100644 --- a/scripts/node_mk_rain/node_mk_rain.gml +++ b/scripts/node_mk_rain/node_mk_rain.gml @@ -18,8 +18,7 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c newInput(7, nodeValue_Range("Velocity", self, [ 1, 2 ])); - newInput(8, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(8, nodeValueSeed(self)); newInput(9, nodeValue_Enum_Scroll("Shape", self, 0, [ new scrollItem("Rain", s_node_mk_rain_type, 0), new scrollItem("Snow", s_node_mk_rain_type, 1), diff --git a/scripts/node_mk_sparkle/node_mk_sparkle.gml b/scripts/node_mk_sparkle/node_mk_sparkle.gml index eb5c9e8e5..22b85778f 100644 --- a/scripts/node_mk_sparkle/node_mk_sparkle.gml +++ b/scripts/node_mk_sparkle/node_mk_sparkle.gml @@ -8,7 +8,7 @@ function Node_MK_Sparkle(_x, _y, _group = noone) : Node_Processor(_x, _y, _group newInput(0, nodeValue_Int("Size", self, 5)); - newInput(1, nodeValueSeed(self, VALUE_TYPE.float)); + newInput(1, nodeValueSeed(self)); newInput(2, nodeValue_Float("Speed", self, 1)) .setDisplay(VALUE_DISPLAY.slider) diff --git a/scripts/node_mk_subpixel/node_mk_subpixel.gml b/scripts/node_mk_subpixel/node_mk_subpixel.gml index 4b6077935..a37a44fb4 100644 --- a/scripts/node_mk_subpixel/node_mk_subpixel.gml +++ b/scripts/node_mk_subpixel/node_mk_subpixel.gml @@ -21,7 +21,7 @@ function Node_MK_Subpixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput(7, nodeValue_Surface("Surface", self)); - newInput(8, nodeValueSeed(self, VALUE_TYPE.float)); + newInput(8, nodeValueSeed(self)); newInput(9, nodeValue_Float("Ridge amount", self, 8)); diff --git a/scripts/node_noise/node_noise.gml b/scripts/node_noise/node_noise.gml index 89c0b349f..8ab7c02f0 100644 --- a/scripts/node_noise/node_noise.gml +++ b/scripts/node_noise/node_noise.gml @@ -3,8 +3,7 @@ function Node_Noise(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con newInput(0, nodeValue_Dimension(self)); - newInput(1, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(1, nodeValueSeed(self)); newInput(2, nodeValue_Enum_Button("Color mode", self, 0, [ "Greyscale", "RGB", "HSV" ])); diff --git a/scripts/node_noise_aniso/node_noise_aniso.gml b/scripts/node_noise_aniso/node_noise_aniso.gml index 8b035b4f2..3bbafba20 100644 --- a/scripts/node_noise_aniso/node_noise_aniso.gml +++ b/scripts/node_noise_aniso/node_noise_aniso.gml @@ -6,8 +6,7 @@ function Node_Noise_Aniso(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput(1, nodeValue_Float("X Amount", self, 2)) .setMappable(6); - newInput(2, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(2, nodeValueSeed(self)); newInput(3, nodeValue_Vec2("Position", self, [ 0, 0 ])) .setUnitRef(function(index) { return getDimension(index); }); @@ -30,8 +29,7 @@ function Node_Noise_Aniso(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput(9, nodeValue_Enum_Scroll("Render mode", self, 0, [ "Blend", "Waterfall" ] )) - newInput(10, nodeValue_Float("Color Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(10, nodeValueSeed(self)); input_display_list = [ ["Output", false], 0, diff --git a/scripts/node_noise_bubble/node_noise_bubble.gml b/scripts/node_noise_bubble/node_noise_bubble.gml index 5e62e3306..1162b4e11 100644 --- a/scripts/node_noise_bubble/node_noise_bubble.gml +++ b/scripts/node_noise_bubble/node_noise_bubble.gml @@ -6,8 +6,7 @@ function Node_Noise_Bubble(_x, _y, _group = noone) : Node_Shader_Generator(_x, _ .setDisplay(VALUE_DISPLAY.slider); addShaderProp(SHADER_UNIFORM.float, "density"); - newInput(2, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(2, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(3, nodeValue_Slider_Range("Scale", self, [ 0.5, 0.8 ] )); diff --git a/scripts/node_noise_cristal/node_noise_cristal.gml b/scripts/node_noise_cristal/node_noise_cristal.gml index 20b347d3c..801b88cbc 100644 --- a/scripts/node_noise_cristal/node_noise_cristal.gml +++ b/scripts/node_noise_cristal/node_noise_cristal.gml @@ -8,8 +8,7 @@ function Node_Noise_Cristal(_x, _y, _group = noone) : Node_Shader_Generator(_x, newInput(2, nodeValue_Vec2("Scale", self, [ 1, 1 ] )); addShaderProp(SHADER_UNIFORM.float, "scale"); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(4, nodeValue_Int("Iteration", self, 15 )); diff --git a/scripts/node_noise_fbm/node_noise_fbm.gml b/scripts/node_noise_fbm/node_noise_fbm.gml index 503cf93c1..dfd553c77 100644 --- a/scripts/node_noise_fbm/node_noise_fbm.gml +++ b/scripts/node_noise_fbm/node_noise_fbm.gml @@ -3,8 +3,7 @@ function Node_Noise_FBM(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(0, nodeValue_Dimension(self)); - newInput(1, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(1, nodeValueSeed(self)); newInput(2, nodeValue_Vec2("Position", self, [ 0, 0 ])); diff --git a/scripts/node_noise_hex/node_noise_hex.gml b/scripts/node_noise_hex/node_noise_hex.gml index 4499a555c..5f5a67619 100644 --- a/scripts/node_noise_hex/node_noise_hex.gml +++ b/scripts/node_noise_hex/node_noise_hex.gml @@ -13,8 +13,7 @@ function Node_Noise_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(0, nodeValue_Dimension(self)); - newInput(1, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(1, nodeValueSeed(self)); newInput(2, nodeValue_Vec2("Position", self, [ 0, 0] )); @@ -48,7 +47,7 @@ function Node_Noise_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _pos = _data[2]; var _sca = _data[3]; var _sam = _data[4]; - var _samTyp = struct_try_get(attributes, "oversample"); + var _samTyp = getAttribute("oversample"); _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth()); diff --git a/scripts/node_noise_strand/node_noise_strand.gml b/scripts/node_noise_strand/node_noise_strand.gml index d59ab797d..1e79b46be 100644 --- a/scripts/node_noise_strand/node_noise_strand.gml +++ b/scripts/node_noise_strand/node_noise_strand.gml @@ -10,8 +10,7 @@ function Node_Noise_Strand(_x, _y, _group = noone) : Node_Shader_Generator(_x, _ .setDisplay(VALUE_DISPLAY.slider); addShaderProp(SHADER_UNIFORM.float, "density"); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(4, nodeValue_Float("Slope", self, 0.5 )) diff --git a/scripts/node_noise_tri/node_noise_tri.gml b/scripts/node_noise_tri/node_noise_tri.gml index 141148e44..7846c88d0 100644 --- a/scripts/node_noise_tri/node_noise_tri.gml +++ b/scripts/node_noise_tri/node_noise_tri.gml @@ -13,8 +13,7 @@ function Node_Noise_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(0, nodeValue_Dimension(self)); - newInput(1, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(1, nodeValueSeed(self)); newInput(2, nodeValue_Vec2("Position", self, [ 0, 0] )); @@ -48,7 +47,7 @@ function Node_Noise_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _pos = _data[2]; var _sca = _data[3]; var _sam = _data[4]; - var _samTyp = struct_try_get(attributes, "oversample"); + var _samTyp = getAttribute("oversample"); _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth()); diff --git a/scripts/node_outline/node_outline.gml b/scripts/node_outline/node_outline.gml index b3e4f89b8..13643afd1 100644 --- a/scripts/node_outline/node_outline.gml +++ b/scripts/node_outline/node_outline.gml @@ -98,7 +98,7 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c var blend = _data[3]; var side = _data[5]; var aa = _data[6]; - var sam = struct_try_get(attributes, "oversample"); + var sam = getAttribute("oversample"); var _crop = _data[12]; surface_set_shader(_outSurf, sh_outline); diff --git a/scripts/node_palette_extract/node_palette_extract.gml b/scripts/node_palette_extract/node_palette_extract.gml index 2c64f1df6..d60b806cc 100644 --- a/scripts/node_palette_extract/node_palette_extract.gml +++ b/scripts/node_palette_extract/node_palette_extract.gml @@ -7,8 +7,7 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _ newInput(1, nodeValue_Int("Max colors", self, 5, "Amount of color in a palette.")) .rejectArray(); - newInput(2, nodeValue_Int("Seed", self, seed_random(6), "Random seed to be used to initialize K-mean algorithm.")) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }) + newInput(2, nodeValueSeed(self)) .rejectArray(); newInput(3, nodeValue_Enum_Scroll("Algorithm", self, 0, { data: [ "K-mean", "Frequency", "All colors" ], update_hover: false })) diff --git a/scripts/node_palette_shrink/node_palette_shrink.gml b/scripts/node_palette_shrink/node_palette_shrink.gml index 9eca428c8..e571e856a 100644 --- a/scripts/node_palette_shrink/node_palette_shrink.gml +++ b/scripts/node_palette_shrink/node_palette_shrink.gml @@ -10,7 +10,7 @@ function Node_Palette_Shrink(_x, _y, _group = noone) : Node_Processor(_x, _y, _g newInput(2, nodeValue_Int("Amount", self, 4)); - newInput(3, nodeValueSeed(self, VALUE_TYPE.float)); + newInput(3, nodeValueSeed(self)); newInput(4, nodeValue_Enum_Button("Color Space", self, 0, [ "RGB", "HSV" ])) diff --git a/scripts/node_path_l_system/node_path_l_system.gml b/scripts/node_path_l_system/node_path_l_system.gml index e1251f335..6193377ee 100644 --- a/scripts/node_path_l_system/node_path_l_system.gml +++ b/scripts/node_path_l_system/node_path_l_system.gml @@ -33,8 +33,7 @@ function Node_Path_L_System(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr newInput(6, nodeValue_Rotation("Starting Angle", self, 90)); - newInput(7, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[7].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(7, nodeValueSeed(self)); newInput(8, nodeValue_Bool("3D", self, false)); diff --git a/scripts/node_path_scatter/node_path_scatter.gml b/scripts/node_path_scatter/node_path_scatter.gml index f65ad0973..4f740834a 100644 --- a/scripts/node_path_scatter/node_path_scatter.gml +++ b/scripts/node_path_scatter/node_path_scatter.gml @@ -14,8 +14,7 @@ function Node_Path_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro newInput(4, nodeValue_Slider_Range("Scale", self, [ 0.5, 1 ])); - newInput(5, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(5, nodeValueSeed(self)); newInput(6, nodeValue_Curve("Scale over Length", self, CURVE_DEF_11)); diff --git a/scripts/node_path_wave/node_path_wave.gml b/scripts/node_path_wave/node_path_wave.gml index 5435fd2c3..952b7d6b4 100644 --- a/scripts/node_path_wave/node_path_wave.gml +++ b/scripts/node_path_wave/node_path_wave.gml @@ -13,8 +13,7 @@ function Node_Path_Wave(_x, _y, _group = noone) : Node(_x, _y, _group) construct newInput(4, nodeValue_Bool("Smooth", self, false)); - newInput(5, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(5, nodeValueSeed(self)); newInput(6, nodeValue_Bool("Wiggle", self, false)); diff --git a/scripts/node_pb_fx_highlight/node_pb_fx_highlight.gml b/scripts/node_pb_fx_highlight/node_pb_fx_highlight.gml index af0b1a056..ba882c97c 100644 --- a/scripts/node_pb_fx_highlight/node_pb_fx_highlight.gml +++ b/scripts/node_pb_fx_highlight/node_pb_fx_highlight.gml @@ -13,8 +13,7 @@ function Node_PB_Fx_Highlight(_x, _y, _group = noone) : Node_PB_Fx(_x, _y, _grou newInput(5, nodeValue_Float("Roughness Scale", self, 1 )); - newInput(6, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[6].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(6, nodeValueSeed(self)); holding_side = noone; diff --git a/scripts/node_perlin/node_perlin.gml b/scripts/node_perlin/node_perlin.gml index 03233a215..2e66c9c99 100644 --- a/scripts/node_perlin/node_perlin.gml +++ b/scripts/node_perlin/node_perlin.gml @@ -13,8 +13,7 @@ function Node_Perlin(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co newInput(4, nodeValue_Bool("Tile", self, true)); - newInput(5, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(5, nodeValueSeed(self)); newInput(6, nodeValue_Enum_Button("Color mode", self, 0, [ "Greyscale", "RGB", "HSV" ])); diff --git a/scripts/node_perlin_extra/node_perlin_extra.gml b/scripts/node_perlin_extra/node_perlin_extra.gml index 2ca81449a..49328cd6b 100644 --- a/scripts/node_perlin_extra/node_perlin_extra.gml +++ b/scripts/node_perlin_extra/node_perlin_extra.gml @@ -16,8 +16,7 @@ function Node_Perlin_Extra(_x, _y, _group = noone) : Node_Shader_Generator(_x, _ newInput(4, nodeValue_Bool("Tile", self, true, "Tiling only works with integer scale, and some effect type doesn't support tiling.")); addShaderProp(SHADER_UNIFORM.integer, "tile"); - newInput(5, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(5, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(6, nodeValue_Enum_Button("Color mode", self, 0, [ "Greyscale", "RGB", "HSV" ])); diff --git a/scripts/node_pixel_cloud/node_pixel_cloud.gml b/scripts/node_pixel_cloud/node_pixel_cloud.gml index 2a0b2eadc..72b9a1d21 100644 --- a/scripts/node_pixel_cloud/node_pixel_cloud.gml +++ b/scripts/node_pixel_cloud/node_pixel_cloud.gml @@ -3,8 +3,7 @@ function Node_Pixel_Cloud(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput(0, nodeValue_Surface("Surface in", self)); - newInput(1, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(1, nodeValueSeed(self)); newInput(2, nodeValue_Float("Strength", self, 0.1)) .setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 2, 0.01] }); diff --git a/scripts/node_pytagorean_tile/node_pytagorean_tile.gml b/scripts/node_pytagorean_tile/node_pytagorean_tile.gml index d1a1e1285..984d3ee04 100644 --- a/scripts/node_pytagorean_tile/node_pytagorean_tile.gml +++ b/scripts/node_pytagorean_tile/node_pytagorean_tile.gml @@ -23,8 +23,7 @@ function Node_Pytagorean_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _ newInput(7, nodeValue_Enum_Scroll("Render type", self, 0, ["Colored tile", "Height map", "Texture grid"])); - newInput(8, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(8, nodeValueSeed(self)); newInput(9, nodeValue_Surface("Texture", self)); diff --git a/scripts/node_random_shape/node_random_shape.gml b/scripts/node_random_shape/node_random_shape.gml index 03c7ca101..41069c9b2 100644 --- a/scripts/node_random_shape/node_random_shape.gml +++ b/scripts/node_random_shape/node_random_shape.gml @@ -3,8 +3,7 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro newInput(0, nodeValue_Dimension(self)); - newInput(1, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(1, nodeValueSeed(self)); newInput(2, nodeValue_Enum_Scroll("SSAA", self, 0, [ "None", "2x", "4x", "8x" ])); diff --git a/scripts/node_random_tile/node_random_tile.gml b/scripts/node_random_tile/node_random_tile.gml index c888be0b8..4ba4cde1a 100644 --- a/scripts/node_random_tile/node_random_tile.gml +++ b/scripts/node_random_tile/node_random_tile.gml @@ -23,8 +23,7 @@ function Node_Random_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput(7, nodeValue_Enum_Scroll("Render type", self, 0, ["Colored tile", "Height map", "Texture grid"])); - newInput(8, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(8, nodeValueSeed(self)); newInput(9, nodeValue_Surface("Texture", self)); diff --git a/scripts/node_region_fill/node_region_fill.gml b/scripts/node_region_fill/node_region_fill.gml index 7d22a36bf..94ae04acf 100644 --- a/scripts/node_region_fill/node_region_fill.gml +++ b/scripts/node_region_fill/node_region_fill.gml @@ -9,8 +9,7 @@ function Node_Region_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput(3, nodeValue_Bool("Fill", self, true)); - newInput(4, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[4].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(4, nodeValueSeed(self)); newInput(5, nodeValue_Color("Target Color", self, c_white)); diff --git a/scripts/node_repeat/node_repeat.gml b/scripts/node_repeat/node_repeat.gml index 0d52f1cc5..79566ee83 100644 --- a/scripts/node_repeat/node_repeat.gml +++ b/scripts/node_repeat/node_repeat.gml @@ -63,8 +63,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co newInput(16, nodeValue_Enum_Button("Array select", self, 0, [ "Order", "Random", "Spread" ])) .setTooltip("Whether to select image from an array in order, at random, or spread each image to its own output."); - newInput(17, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[17].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(17, nodeValueSeed(self)); newInput(18, nodeValue_Int("Column", self, 4)); @@ -659,6 +658,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co _y += _padd[1] - miny; } + // print(dec_to_hex(color_real(_a.color))); draw_surface_ext_safe(_a.surface, _x, _y, _a.sx, _a.sy, _a.rot, _a.color, _a.alpha); } diff --git a/scripts/node_repeat_texture/node_repeat_texture.gml b/scripts/node_repeat_texture/node_repeat_texture.gml index e9725950f..fa32b205d 100644 --- a/scripts/node_repeat_texture/node_repeat_texture.gml +++ b/scripts/node_repeat_texture/node_repeat_texture.gml @@ -8,8 +8,7 @@ function Node_Repeat_Texture(_x, _y, _group = noone) : Node_Processor(_x, _y, _g newInput(2, nodeValue_Enum_Scroll("Type", self, 1, [ "Tile", "Scatter", "Cell" ])); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }) + newInput(3, nodeValueSeed(self)); newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_rigid_object_spawner/node_rigid_object_spawner.gml b/scripts/node_rigid_object_spawner/node_rigid_object_spawner.gml index c7e738577..c511a78ee 100644 --- a/scripts/node_rigid_object_spawner/node_rigid_object_spawner.gml +++ b/scripts/node_rigid_object_spawner/node_rigid_object_spawner.gml @@ -29,8 +29,7 @@ function Node_Rigid_Object_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group newInput(6, nodeValue_Bool("Spawn", self, true)) .rejectArray(); - newInput(7, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[7].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(7, nodeValueSeed(self)); newOutput(0, nodeValue_Output("Object", self, VALUE_TYPE.rigid, object)); diff --git a/scripts/node_scale/node_scale.gml b/scripts/node_scale/node_scale.gml index d8dfbca85..cf011e0d0 100644 --- a/scripts/node_scale/node_scale.gml +++ b/scripts/node_scale/node_scale.gml @@ -27,12 +27,12 @@ function Node_Scale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con attribute_surface_depth(); attribute_interpolation(); - static step = function() { #region + static step = function() { var _surf = getSingleValue(0); var _atlas = is_instanceof(_surf, SurfaceAtlas); inputs[5].setVisible(_atlas); - } #endregion + } static processData = function(_outSurf, _data, _output_index, _array_index) { var surf = _data[0]; diff --git a/scripts/node_scatter/node_scatter.gml b/scripts/node_scatter/node_scatter.gml index e825f7057..fc2ec1cc7 100644 --- a/scripts/node_scatter/node_scatter.gml +++ b/scripts/node_scatter/node_scatter.gml @@ -34,8 +34,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c newInput(9, nodeValue_Enum_Button("Scatter", self, 1, [ "Uniform", "Random" ])); - newInput(10, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[10].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(10, nodeValueSeed(self)); newInput(11, nodeValue_Gradient("Random blend", self, new gradientObject(cola(c_white)))) .setMappable(28); diff --git a/scripts/node_scatter_points/node_scatter_points.gml b/scripts/node_scatter_points/node_scatter_points.gml index 42cb4f70d..6087cf6d1 100644 --- a/scripts/node_scatter_points/node_scatter_points.gml +++ b/scripts/node_scatter_points/node_scatter_points.gml @@ -20,8 +20,7 @@ function Node_Scatter_Points(_x, _y, _group = noone) : Node(_x, _y, _group) cons newInput(4, nodeValue_Surface("Distribution map", self)) .rejectArray(); - newInput(5, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }) + newInput(5, nodeValueSeed(self)) .rejectArray(); newInput(6, nodeValue_Bool("Fixed position", self, false, "Fix point position, and only select point in the area.")); diff --git a/scripts/node_shape/node_shape.gml b/scripts/node_shape/node_shape.gml index 406ffb6cf..4fd967c1b 100644 --- a/scripts/node_shape/node_shape.gml +++ b/scripts/node_shape/node_shape.gml @@ -354,9 +354,9 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con var sample = quality * segCount; var _step = 1 / sample; - path_points = array_verify(path_points, sample); + path_points = array_verify_ext(path_points, sample, function() /*=>*/ {return new __vec2()}); for( var i = 0; i < sample; i++ ) - path_points[i] = _path.getPointRatio(i * _step, array_safe_get(path_points, i, undefined)); + path_points[i] = _path.getPointRatio(i * _step, 0, array_safe_get(path_points, i, undefined)); var tri = polygon_triangulate(path_points); triangles = tri[0]; diff --git a/scripts/node_shard_noise/node_shard_noise.gml b/scripts/node_shard_noise/node_shard_noise.gml index 650586ab2..f4455b50e 100644 --- a/scripts/node_shard_noise/node_shard_noise.gml +++ b/scripts/node_shard_noise/node_shard_noise.gml @@ -10,8 +10,7 @@ function Node_Shard_Noise(_x, _y, _group = noone) : Node_Shader_Generator(_x, _y .setMappable(6); addShaderProp(SHADER_UNIFORM.float, "scale"); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(4, nodeValue_Float("Sharpness", self, 1)) diff --git a/scripts/node_skew/node_skew.gml b/scripts/node_skew/node_skew.gml index e1888b9d9..ffa4955cd 100644 --- a/scripts/node_skew/node_skew.gml +++ b/scripts/node_skew/node_skew.gml @@ -68,7 +68,7 @@ function Node_Skew(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons } static processData = function(_outSurf, _data, _output_index, _array_index) { - var _samp = struct_try_get(attributes, "oversample"); + var _samp = getAttribute("oversample"); surface_set_shader(_outSurf, sh_skew); shader_set_interpolation(_data[0]); diff --git a/scripts/node_smear/node_smear.gml b/scripts/node_smear/node_smear.gml index 2d0232b92..9ad327a55 100644 --- a/scripts/node_smear/node_smear.gml +++ b/scripts/node_smear/node_smear.gml @@ -86,7 +86,7 @@ function Node_Smear(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con shader_set_f_map("strength", _data[ 1], _data[ 9], inputs[ 1]); shader_set_f_map("direction", _data[ 2], _data[10], inputs[ 2]); - shader_set_i("sampleMode", struct_try_get(attributes, "oversample")); + shader_set_i("sampleMode", getAttribute("oversample")); shader_set_i("alpha", _data[11]); shader_set_i("inv", _data[14]); shader_set_i("blend", _data[15]); diff --git a/scripts/node_smoke_turbulence/node_smoke_turbulence.gml b/scripts/node_smoke_turbulence/node_smoke_turbulence.gml index 60fd3e90f..1501e3eb9 100644 --- a/scripts/node_smoke_turbulence/node_smoke_turbulence.gml +++ b/scripts/node_smoke_turbulence/node_smoke_turbulence.gml @@ -15,8 +15,7 @@ function Node_Smoke_Turbulence(_x, _y, _group = noone) : Node_Smoke(_x, _y, _gro newInput(3, nodeValue_Float("Scale", self, 4)) .setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 0.01] }); - newInput(4, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[4].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(4, nodeValueSeed(self)); newInput(5, nodeValue_Enum_Button("Mode", self, 0, [ "Override", "Add" ])); diff --git a/scripts/node_spherize/node_spherize.gml b/scripts/node_spherize/node_spherize.gml index 020f77197..0e7db5775 100644 --- a/scripts/node_spherize/node_spherize.gml +++ b/scripts/node_spherize/node_spherize.gml @@ -76,7 +76,7 @@ function Node_Spherize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) } #endregion static processData = function(_outSurf, _data, _output_index, _array_index) { #region - var sam = struct_try_get(attributes, "oversample"); + var sam = getAttribute("oversample"); surface_set_shader(_outSurf, sh_spherize); shader_set_interpolation(_data[0]); diff --git a/scripts/node_strand_break/node_strand_break.gml b/scripts/node_strand_break/node_strand_break.gml index 6b45fa656..c1a8c9937 100644 --- a/scripts/node_strand_break/node_strand_break.gml +++ b/scripts/node_strand_break/node_strand_break.gml @@ -9,8 +9,7 @@ function Node_Strand_Break(_x, _y, _group = noone) : _Node_Strand_Affector(_x, _ newInput(input_fix_len + 0, nodeValue_Float("Chance", self, 1)) .setDisplay(VALUE_DISPLAY.slider); - newInput(input_fix_len + 1, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[input_fix_len + 1].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(input_fix_len + 1, nodeValueSeed(self)); array_push(input_display_list, ["Break", false], input_fix_len + 0, input_fix_len + 1 diff --git a/scripts/node_strand_create/node_strand_create.gml b/scripts/node_strand_create/node_strand_create.gml index 5d2a41466..dc452111b 100644 --- a/scripts/node_strand_create/node_strand_create.gml +++ b/scripts/node_strand_create/node_strand_create.gml @@ -30,8 +30,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const newInput(9, nodeValue_Float("Structure", self, 0.2, "The ability to keep its original shape.")) .setDisplay(VALUE_DISPLAY.slider); - newInput(10, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[10].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(10, nodeValueSeed(self)); newInput(11, nodeValue_Float("Curl frequency", self, 0)); diff --git a/scripts/node_strand_force_apply/node_strand_force_apply.gml b/scripts/node_strand_force_apply/node_strand_force_apply.gml index 27d48df86..0d702bc4c 100644 --- a/scripts/node_strand_force_apply/node_strand_force_apply.gml +++ b/scripts/node_strand_force_apply/node_strand_force_apply.gml @@ -11,8 +11,7 @@ function Node_Strand_Force_Apply(_x, _y, _group = noone) : _Node_Strand_Affector newInput(input_fix_len + 1, nodeValue_Float("Turbulence", self, 0)); - newInput(input_fix_len + 2, nodeValue_Int("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[input_fix_len + 2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(input_fix_len + 2, nodeValueSeed(self)); newInput(input_fix_len + 3, nodeValue_Float("Turbulence frequency", self, 0.5)); diff --git a/scripts/node_strand_render/node_strand_render.gml b/scripts/node_strand_render/node_strand_render.gml index e28965432..b6832368f 100644 --- a/scripts/node_strand_render/node_strand_render.gml +++ b/scripts/node_strand_render/node_strand_render.gml @@ -19,8 +19,7 @@ function Node_Strand_Render(_x, _y, _group = noone) : Node(_x, _y, _group) const newInput(5, nodeValue_Gradient("Color over length", self, new gradientObject(cola(c_white)))); - newInput(6, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[6].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(6, nodeValueSeed(self)); newInput(7, nodeValue_Float("Child", self, 0, "Render extra strands between the real strands.")); diff --git a/scripts/node_strand_render_texture/node_strand_render_texture.gml b/scripts/node_strand_render_texture/node_strand_render_texture.gml index 14473dda8..459455745 100644 --- a/scripts/node_strand_render_texture/node_strand_render_texture.gml +++ b/scripts/node_strand_render_texture/node_strand_render_texture.gml @@ -17,8 +17,7 @@ function Node_Strand_Render_Texture(_x, _y, _group = noone) : Node(_x, _y, _grou newInput(4, nodeValue_Surface("Texture", self)); - newInput(5, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(5, nodeValueSeed(self)); newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_stripe/node_stripe.gml b/scripts/node_stripe/node_stripe.gml index 16af2706c..b367e206b 100644 --- a/scripts/node_stripe/node_stripe.gml +++ b/scripts/node_stripe/node_stripe.gml @@ -53,7 +53,7 @@ function Node_Stripe(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co newInput(18, nodeValue_Palette("Colors", self, [ c_black, c_white ] )); - newInput(19, nodeValueSeed(self, VALUE_TYPE.float)); + newInput(19, nodeValueSeed(self)); newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_surface_replace/node_surface_replace.gml b/scripts/node_surface_replace/node_surface_replace.gml index 0fc6cda82..4f918d2e7 100644 --- a/scripts/node_surface_replace/node_surface_replace.gml +++ b/scripts/node_surface_replace/node_surface_replace.gml @@ -21,8 +21,7 @@ function Node_Surface_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _ newInput(7, nodeValue_Enum_Scroll("Array mode", self, 0, { data: [ "Match index", "Randomized" ], update_hover: false })); - newInput(8, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[8].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(8, nodeValueSeed(self)); newInput(9, nodeValue_Bool("Replace Empty", self, false)) diff --git a/scripts/node_text/node_text.gml b/scripts/node_text/node_text.gml index b88149a0b..3efdfedbd 100644 --- a/scripts/node_text/node_text.gml +++ b/scripts/node_text/node_text.gml @@ -63,9 +63,9 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons newInput(27, nodeValue_Int("Max line width", self, 0 )); - input_display_list = [ + input_display_list = [ 0, ["Output", true], 9, 6, 10, - ["Text", false], 0, 13, 14, 7, 8, 27, + ["Alignment", false], 13, 14, 7, 8, 27, ["Font", false], 1, 2, 15, 3, 11, 12, ["Rendering", false], 5, ["Background", true, 16], 17, diff --git a/scripts/node_tiler/node_tiler.gml b/scripts/node_tiler/node_tiler.gml index ebaa36441..40fa17d4d 100644 --- a/scripts/node_tiler/node_tiler.gml +++ b/scripts/node_tiler/node_tiler.gml @@ -11,7 +11,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput( 2, nodeValue_Bool("Animated", self, false)); - newInput( 3, nodeValueSeed(self, VALUE_TYPE.float)); + newInput( 3, nodeValueSeed(self)); input_display_list = [ 3, 1, 0 ]; input_display_list_tileset = ["Tileset", false, noone, noone]; diff --git a/scripts/node_tiler_convert/node_tiler_convert.gml b/scripts/node_tiler_convert/node_tiler_convert.gml index de7b7cd05..426a14953 100644 --- a/scripts/node_tiler_convert/node_tiler_convert.gml +++ b/scripts/node_tiler_convert/node_tiler_convert.gml @@ -17,7 +17,7 @@ function Node_Tile_Convert(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro newInput( 2, nodeValue_Bool("Animated", self, false)); - newInput( 3, nodeValueSeed(self, VALUE_TYPE.float)); + newInput( 3, nodeValueSeed(self)); newOutput(0, nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_tiler_rule/node_tiler_rule.gml b/scripts/node_tiler_rule/node_tiler_rule.gml index 24fdcf056..7821fe0c3 100644 --- a/scripts/node_tiler_rule/node_tiler_rule.gml +++ b/scripts/node_tiler_rule/node_tiler_rule.gml @@ -6,7 +6,7 @@ function Node_Tile_Rule(_x, _y, _group = noone) : Node(_x, _y, _group) construct newInput( 1, nodeValue_Surface("Tilemap", self, noone)); - newInput( 2, nodeValueSeed(self, VALUE_TYPE.float)); + newInput( 2, nodeValueSeed(self)); newOutput(0, nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_tunnel_in/node_tunnel_in.gml b/scripts/node_tunnel_in/node_tunnel_in.gml index 0a0ca4e25..271aa1fe8 100644 --- a/scripts/node_tunnel_in/node_tunnel_in.gml +++ b/scripts/node_tunnel_in/node_tunnel_in.gml @@ -36,7 +36,9 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct _node.inputs[0].setValue(_key); } - static update = function(frame = CURRENT_FRAME) { onValueUpdate(); } + static update = function(frame = CURRENT_FRAME) { + onValueUpdate(); + } static resetMap = function() { var _key = inputs[0].getValue(); @@ -98,18 +100,16 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct if(index == 0) { RENDER_ALL_REORDER } } + static onValueFromUpdate = function(index) { + var _frm = inputs[1].value_from; + + inputs[1].setType( _frm? _frm.type : VALUE_TYPE.any); + inputs[1].setDisplay(_frm? _frm.display_type : VALUE_DISPLAY._default); + + } + static step = function() { - var _key = inputs[0].getValue(); - value_validation[VALIDATION.error] = error_notification != noone; - - if(inputs[1].value_from == noone) { - inputs[1].setType(VALUE_TYPE.any); - inputs[1].display_type = VALUE_DISPLAY._default; - } else { - inputs[1].setType(inputs[1].value_from.type); - inputs[1].display_type = inputs[1].value_from.display_type; - } } static getNextNodes = function() { @@ -261,7 +261,10 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct static onClone = function() { onValueUpdate(0); } - static postConnect = function() { step(); onValueUpdate(0); } + static postConnect = function() { + onValueUpdate(0); + onValueFromUpdate(0); + } static onDestroy = function() { if(error_notification != noone) diff --git a/scripts/node_twirl/node_twirl.gml b/scripts/node_twirl/node_twirl.gml index 5a33c8f04..cd2d5e23c 100644 --- a/scripts/node_twirl/node_twirl.gml +++ b/scripts/node_twirl/node_twirl.gml @@ -71,7 +71,7 @@ function Node_Twirl(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con } static processData = function(_outSurf, _data, _output_index, _array_index) { #region - var sam = struct_try_get(attributes, "oversample"); + var sam = getAttribute("oversample"); surface_set_shader(_outSurf, sh_twirl); shader_set_interpolation(_data[0]); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 4dc7da4af..00e9e8f6b 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -3,10 +3,12 @@ function nodeValueMap(_name, _node, _junc = noone) { return new NodeValue( function nodeValueGradientRange(_name, _node, _junc = noone) { return new NodeValue(_name, _node, CONNECT_TYPE.input, VALUE_TYPE.float, [ 0, 0, 1, 0 ]) .setDisplay(VALUE_DISPLAY.gradient_range).setVisible(false, false).setMapped(_junc); } -function nodeValueSeed(_node, _type, _name = "Seed") { - var _val = new NodeValue(_name, _node, CONNECT_TYPE.input, _type, seed_random(6), ""); - __node_seed_input_value = _val; - _val.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() /*=>*/ { randomize(); __node_seed_input_value.setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); +function nodeValueSeed(_node, _type = VALUE_TYPE.float, _name = "Seed") { + var _val = new NodeValue(_name, _node, CONNECT_TYPE.input, _type, seed_random(6), ""); + var _rFun = function() /*=>*/ { randomize(); setValue(seed_random(6)); }; + _rFun = method(_val, _rFun); + + _val.setDisplay(VALUE_DISPLAY._default, { side_button : button(_rFun).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); return _val; } @@ -991,27 +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.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.struct : - editWidget = new outputStructBox(); - break; - - case VALUE_TYPE.tileset : - editWidget = new tilesetBox(self); - extract_node = "Node_Tile_Tileset"; - break; - - case VALUE_TYPE.particle : - editWidget = noone; - break; - - default : - editWidget = new outputBox(); - break; + default : editWidget = new outputBox(); break; } if(is_struct(display_data) && struct_has(display_data, "side_button") && editWidget.side_button == noone) diff --git a/scripts/node_voronoi_extra/node_voronoi_extra.gml b/scripts/node_voronoi_extra/node_voronoi_extra.gml index a47737ba6..76fff6fee 100644 --- a/scripts/node_voronoi_extra/node_voronoi_extra.gml +++ b/scripts/node_voronoi_extra/node_voronoi_extra.gml @@ -9,8 +9,7 @@ function Node_Voronoi_Extra(_x, _y, _group = noone) : Node_Shader_Generator(_x, newInput(2, nodeValue_Vec2("Scale", self, [ 4, 4 ])); addShaderProp(SHADER_UNIFORM.float, "scale"); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(4, nodeValue_Float("Progress", self, 0)) diff --git a/scripts/node_wavelet_noise/node_wavelet_noise.gml b/scripts/node_wavelet_noise/node_wavelet_noise.gml index 5d638db0f..f82d08cc3 100644 --- a/scripts/node_wavelet_noise/node_wavelet_noise.gml +++ b/scripts/node_wavelet_noise/node_wavelet_noise.gml @@ -10,8 +10,7 @@ function Node_Wavelet_Noise(_x, _y, _group = noone) : Node_Shader_Generator(_x, .setMappable(6); addShaderProp(SHADER_UNIFORM.float, "scale"); - newInput(3, nodeValue_Float("Seed", self, seed_random(6))) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + newInput(3, nodeValueSeed(self)); addShaderProp(SHADER_UNIFORM.float, "seed"); newInput(4, nodeValue_Float("Progress", self, 0)) diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index f89fb68dc..7004eb8b3 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -710,8 +710,10 @@ function Panel_Collection() : PanelContent() constructor { function setPage(i) { page = i; + title = roots[i][0]; root = roots[i][1]; context = root; + onResize(); } diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 5cb7e7b1b..c1a303587 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1088,8 +1088,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { var gr_x = graph_x * graph_s; var gr_y = graph_y * graph_s; var gr_ls = gls * graph_s; - var xx = -gr_ls, xs = safe_mod(gr_x, gr_ls); - var yy = -gr_ls, ys = safe_mod(gr_y, gr_ls); + var xx = -gr_ls - 1, xs = safe_mod(gr_x, gr_ls); + var yy = -gr_ls - 1, ys = safe_mod(gr_y, gr_ls); draw_set_color(project.graphGrid.color); var aa = 0.5; diff --git a/scripts/pathnodeBox/pathnodeBox.yy b/scripts/pathnodeBox/pathnodeBox.yy index 6881dacdd..0e275102a 100644 --- a/scripts/pathnodeBox/pathnodeBox.yy +++ b/scripts/pathnodeBox/pathnodeBox.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"pathnodeBox", "parent":{ - "name":"widgets", - "path":"folders/widgets.yy", + "name":"object", + "path":"folders/widgets/object.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/quarternionBox/quarternionBox.gml b/scripts/quarternionBox/quarternionBox.gml index b3df44f67..12d3e7ca5 100644 --- a/scripts/quarternionBox/quarternionBox.gml +++ b/scripts/quarternionBox/quarternionBox.gml @@ -104,6 +104,7 @@ function quarternionBox(_onModify) : widget() constructor { if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, iactive, ihover, tooltip, THEME.unit_angle, _disp, c_white) == 2) { clickable = false; _display_data.angle_display = (_disp + 1) % 2; + onModify([ 0, 0, 0, 1 ]); } _w -= _bs + ui(8); } diff --git a/scripts/shader_functions/shader_functions.gml b/scripts/shader_functions/shader_functions.gml index 1bd5c04ad..92d1c5dce 100644 --- a/scripts/shader_functions/shader_functions.gml +++ b/scripts/shader_functions/shader_functions.gml @@ -186,9 +186,7 @@ function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount", function shader_preset_interpolation(shader = sh_sample) { INLINE - var intp = getAttribute("interpolate"); - - shader_set_uniform_i(shader_get_uniform(shader, "interpolation"), intp); + shader_set_uniform_i(shader_get_uniform(shader, "interpolation"), getAttribute("interpolate")); shader_set_uniform_i(shader_get_uniform(shader, "sampleMode"), getAttribute("oversample")); } @@ -209,7 +207,7 @@ function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount", var intp = getAttribute("interpolate"); - gpu_set_tex_filter(bool(intp)); + gpu_set_tex_filter(intp > 1); shader_set_i("interpolation", intp); shader_set_f("sampleDimension", _dim == noone? surface_get_dimension(surface) : _dim); shader_set_i("sampleMode", getAttribute("oversample")); diff --git a/scripts/theme_definition/theme_definition.gml b/scripts/theme_definition/theme_definition.gml index 539653abe..8ad2b24bc 100644 --- a/scripts/theme_definition/theme_definition.gml +++ b/scripts/theme_definition/theme_definition.gml @@ -299,6 +299,7 @@ function Theme() constructor { bone_tool_detach = s_bone_tool_detach; bone_tool_IK = s_bone_tool_IK; bone_tool_move = s_bone_tool_move; + bone_tool_pose = s_bone_tool_pose; bone_tool_remove = s_bone_tool_remove; bone_tool_scale = s_bone_tool_scale; canvas_draw_layer = s_canvas_draw_layer; diff --git a/scripts/tilesetBox/tilesetBox.yy b/scripts/tilesetBox/tilesetBox.yy index 3de9b7c03..882e176ed 100644 --- a/scripts/tilesetBox/tilesetBox.yy +++ b/scripts/tilesetBox/tilesetBox.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"tilesetBox", "parent":{ - "name":"widgets", - "path":"folders/widgets.yy", + "name":"object", + "path":"folders/widgets/object.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/transformBox/transformBox.gml b/scripts/transformBox/transformBox.gml index 1512c3af4..d46892763 100644 --- a/scripts/transformBox/transformBox.gml +++ b/scripts/transformBox/transformBox.gml @@ -79,32 +79,35 @@ function transformBox(_onModify) : widget() constructor { var lbw = _lab? string_width(__txt("Position")) + ui(8) : 0; var tbw = (_w - lbw) / 2; var tbh = _h; + var tbx = _x + lbw; if(_lab) draw_text_add(_x, _y + tbh / 2, __txt("Position")); - draw_sprite_stretched_ext(THEME.textbox, 3, _x + lbw, _y, _w - lbw, tbh, boxColor, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, _x + lbw, _y, _w - lbw, tbh, boxColor, 0.5 + 0.5 * interactable); + draw_sprite_stretched_ext(THEME.textbox, 3, tbx, _y, _w - lbw, tbh, boxColor, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, tbx, _y, _w - lbw, tbh, boxColor, 0.5 + 0.5 * interactable); - tb[TRANSFORM.pos_x].draw(_x + lbw, _y, tbw, tbh, _data[TRANSFORM.pos_x], _m); - tb[TRANSFORM.pos_y].draw(_x + lbw + tbw, _y, tbw, tbh, _data[TRANSFORM.pos_y], _m); + tb[TRANSFORM.pos_x].draw(tbx, _y, tbw, tbh, _data[TRANSFORM.pos_x], _m); + tb[TRANSFORM.pos_y].draw(tbx + tbw, _y, tbw, tbh, _data[TRANSFORM.pos_y], _m); _y += tbh + ui(4); - rot.draw(_x, _y, _w, tbh, _data[TRANSFORM.rot], _m); + draw_set_text(font, fa_left, fa_center, CDEF.main_dkgrey); + if(_lab) draw_text_add(_x, _y + tbh / 2, __txt("Rotation")); + rot.draw(tbx, _y, _w - lbw, tbh, _data[TRANSFORM.rot], _m); _y += tbh + ui(4); draw_set_text(font, fa_left, fa_center, CDEF.main_dkgrey); if(_lab) draw_text_add(_x, _y + tbh / 2, __txt("Scale")); - draw_sprite_stretched_ext(THEME.textbox, 3, _x + lbw, _y, _w - lbw, tbh, boxColor, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, _x + lbw, _y, _w - lbw, tbh, boxColor, 0.5 + 0.5 * interactable); + draw_sprite_stretched_ext(THEME.textbox, 3, tbx, _y, _w - lbw, tbh, boxColor, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, tbx, _y, _w - lbw, tbh, boxColor, 0.5 + 0.5 * interactable); tbw = array_length(_data) > 4? (_w - lbw) / 2 : _w - lbw; - tb[TRANSFORM.sca_x].draw(_x + lbw, _y, tbw, tbh, _data[TRANSFORM.sca_x], _m); + tb[TRANSFORM.sca_x].draw(tbx, _y, tbw, tbh, _data[TRANSFORM.sca_x], _m); if(array_length(_data) > 4) - tb[TRANSFORM.sca_y].draw(_x + lbw + tbw, _y, tbw, tbh, _data[TRANSFORM.sca_y], _m); + tb[TRANSFORM.sca_y].draw(tbx + tbw, _y, tbw, tbh, _data[TRANSFORM.sca_y], _m); resetFocus(); diff --git a/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.fsh b/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.fsh index 3c6f00117..f97c9dafb 100644 --- a/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.fsh +++ b/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.fsh @@ -1,21 +1,20 @@ -// -// Simple passthrough fragment shader -// varying vec2 v_vTexcoord; varying vec4 v_vColour; uniform vec2 dimension; +uniform vec4 background; void main() { + bool emp = background.a == 0.; vec4 col = texture2D( gm_BaseTexture, v_vTexcoord ); - if(col.a > 0.) { gl_FragColor = vec4(1.); return; } + if((emp && col.a > 0.) || (!emp && col != background)) { gl_FragColor = vec4(1.); return; } gl_FragColor = vec4(0.); vec2 tx = 1. / dimension; for(float i = 0.; i < dimension.y; i++) { vec4 col = texture2D( gm_BaseTexture, vec2(v_vTexcoord.x, tx.y * i) ); - if(col.a > 0.) { + if((emp && col.a > 0.) || (!emp && col != background)) { gl_FragColor = vec4(1.); break; } diff --git a/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.fsh b/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.fsh index e5f9f4bda..1d96a2038 100644 --- a/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.fsh +++ b/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.fsh @@ -1,21 +1,20 @@ -// -// Simple passthrough fragment shader -// varying vec2 v_vTexcoord; varying vec4 v_vColour; uniform vec2 dimension; +uniform vec4 background; void main() { + bool emp = background.a == 0.; vec4 col = texture2D( gm_BaseTexture, v_vTexcoord ); - if(col.a > 0.) { gl_FragColor = vec4(1.); return; } + if((emp && col.a > 0.) || (!emp && col != background)) { gl_FragColor = vec4(1.); return; } gl_FragColor = vec4(0.); vec2 tx = 1. / dimension; for(float i = 0.; i < dimension.x; i++) { vec4 col = texture2D( gm_BaseTexture, vec2(tx.x * i, v_vTexcoord.y) ); - if(col.a > 0.) { + if((emp && col.a > 0.) || (!emp && col != background)) { gl_FragColor = vec4(1.); break; } diff --git a/shaders/sh_sample/sh_sample.fsh b/shaders/sh_sample/sh_sample.fsh index 474d20eb4..814efb634 100644 --- a/shaders/sh_sample/sh_sample.fsh +++ b/shaders/sh_sample/sh_sample.fsh @@ -93,5 +93,5 @@ varying vec2 v_vTexcoord; varying vec4 v_vColour; void main() { - gl_FragColor = sampleTexture( gm_BaseTexture, v_vTexcoord ); + gl_FragColor = sampleTexture( gm_BaseTexture, v_vTexcoord ) * v_vColour; } \ No newline at end of file diff --git a/sprites/s_bone/0245a8b2-bfba-424b-9b37-77a115f2e3b2.png b/sprites/s_bone/0245a8b2-bfba-424b-9b37-77a115f2e3b2.png deleted file mode 100644 index 2d5bd159f..000000000 Binary files a/sprites/s_bone/0245a8b2-bfba-424b-9b37-77a115f2e3b2.png and /dev/null differ diff --git a/sprites/s_bone/24688870-14dc-40d5-bef8-f143942fec22.png b/sprites/s_bone/24688870-14dc-40d5-bef8-f143942fec22.png new file mode 100644 index 000000000..9ab5bac03 Binary files /dev/null and b/sprites/s_bone/24688870-14dc-40d5-bef8-f143942fec22.png differ diff --git a/sprites/s_bone/2f24ef16-f40a-4406-a890-1feb91fec59a.png b/sprites/s_bone/2f24ef16-f40a-4406-a890-1feb91fec59a.png new file mode 100644 index 000000000..e8cdc26a6 Binary files /dev/null and b/sprites/s_bone/2f24ef16-f40a-4406-a890-1feb91fec59a.png differ diff --git a/sprites/s_bone/7e00cee7-6fcf-483d-a02c-5d827a860d34.png b/sprites/s_bone/7e00cee7-6fcf-483d-a02c-5d827a860d34.png new file mode 100644 index 000000000..d1e253f00 Binary files /dev/null and b/sprites/s_bone/7e00cee7-6fcf-483d-a02c-5d827a860d34.png differ diff --git a/sprites/s_bone/81a25112-1d29-4386-90fe-399a6c01c9eb.png b/sprites/s_bone/81a25112-1d29-4386-90fe-399a6c01c9eb.png deleted file mode 100644 index 050f933ae..000000000 Binary files a/sprites/s_bone/81a25112-1d29-4386-90fe-399a6c01c9eb.png and /dev/null differ diff --git a/sprites/s_bone/838d47a7-f072-4971-81fd-b8fdfc4be594.png b/sprites/s_bone/838d47a7-f072-4971-81fd-b8fdfc4be594.png new file mode 100644 index 000000000..49c2b413e Binary files /dev/null and b/sprites/s_bone/838d47a7-f072-4971-81fd-b8fdfc4be594.png differ diff --git a/sprites/s_bone/c03ea78f-dc7f-49de-a720-6a1f3dcb5303.png b/sprites/s_bone/c03ea78f-dc7f-49de-a720-6a1f3dcb5303.png deleted file mode 100644 index 955bd0e9c..000000000 Binary files a/sprites/s_bone/c03ea78f-dc7f-49de-a720-6a1f3dcb5303.png and /dev/null differ diff --git a/sprites/s_bone/d75c63a0-bae2-47e4-afa0-19121f7b3e49.png b/sprites/s_bone/d75c63a0-bae2-47e4-afa0-19121f7b3e49.png new file mode 100644 index 000000000..f5591f6d2 Binary files /dev/null and b/sprites/s_bone/d75c63a0-bae2-47e4-afa0-19121f7b3e49.png differ diff --git a/sprites/s_bone/f7001179-17d5-4058-9fea-74a6bc4cb1e7.png b/sprites/s_bone/f7001179-17d5-4058-9fea-74a6bc4cb1e7.png deleted file mode 100644 index 0d51de16b..000000000 Binary files a/sprites/s_bone/f7001179-17d5-4058-9fea-74a6bc4cb1e7.png and /dev/null differ diff --git a/sprites/s_bone/layers/0245a8b2-bfba-424b-9b37-77a115f2e3b2/09e61440-7f10-46b6-a80d-b571265b9fa8.png b/sprites/s_bone/layers/0245a8b2-bfba-424b-9b37-77a115f2e3b2/09e61440-7f10-46b6-a80d-b571265b9fa8.png deleted file mode 100644 index 2d5bd159f..000000000 Binary files a/sprites/s_bone/layers/0245a8b2-bfba-424b-9b37-77a115f2e3b2/09e61440-7f10-46b6-a80d-b571265b9fa8.png and /dev/null differ diff --git a/sprites/s_bone/layers/24688870-14dc-40d5-bef8-f143942fec22/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png b/sprites/s_bone/layers/24688870-14dc-40d5-bef8-f143942fec22/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png new file mode 100644 index 000000000..9ab5bac03 Binary files /dev/null and b/sprites/s_bone/layers/24688870-14dc-40d5-bef8-f143942fec22/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png differ diff --git a/sprites/s_bone/layers/2f24ef16-f40a-4406-a890-1feb91fec59a/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png b/sprites/s_bone/layers/2f24ef16-f40a-4406-a890-1feb91fec59a/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png new file mode 100644 index 000000000..e8cdc26a6 Binary files /dev/null and b/sprites/s_bone/layers/2f24ef16-f40a-4406-a890-1feb91fec59a/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png differ diff --git a/sprites/s_bone/layers/7e00cee7-6fcf-483d-a02c-5d827a860d34/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png b/sprites/s_bone/layers/7e00cee7-6fcf-483d-a02c-5d827a860d34/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png new file mode 100644 index 000000000..d1e253f00 Binary files /dev/null and b/sprites/s_bone/layers/7e00cee7-6fcf-483d-a02c-5d827a860d34/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png differ diff --git a/sprites/s_bone/layers/81a25112-1d29-4386-90fe-399a6c01c9eb/09e61440-7f10-46b6-a80d-b571265b9fa8.png b/sprites/s_bone/layers/81a25112-1d29-4386-90fe-399a6c01c9eb/09e61440-7f10-46b6-a80d-b571265b9fa8.png deleted file mode 100644 index 050f933ae..000000000 Binary files a/sprites/s_bone/layers/81a25112-1d29-4386-90fe-399a6c01c9eb/09e61440-7f10-46b6-a80d-b571265b9fa8.png and /dev/null differ diff --git a/sprites/s_bone/layers/838d47a7-f072-4971-81fd-b8fdfc4be594/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png b/sprites/s_bone/layers/838d47a7-f072-4971-81fd-b8fdfc4be594/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png new file mode 100644 index 000000000..49c2b413e Binary files /dev/null and b/sprites/s_bone/layers/838d47a7-f072-4971-81fd-b8fdfc4be594/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png differ diff --git a/sprites/s_bone/layers/c03ea78f-dc7f-49de-a720-6a1f3dcb5303/09e61440-7f10-46b6-a80d-b571265b9fa8.png b/sprites/s_bone/layers/c03ea78f-dc7f-49de-a720-6a1f3dcb5303/09e61440-7f10-46b6-a80d-b571265b9fa8.png deleted file mode 100644 index 955bd0e9c..000000000 Binary files a/sprites/s_bone/layers/c03ea78f-dc7f-49de-a720-6a1f3dcb5303/09e61440-7f10-46b6-a80d-b571265b9fa8.png and /dev/null differ diff --git a/sprites/s_bone/layers/d75c63a0-bae2-47e4-afa0-19121f7b3e49/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png b/sprites/s_bone/layers/d75c63a0-bae2-47e4-afa0-19121f7b3e49/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png new file mode 100644 index 000000000..f5591f6d2 Binary files /dev/null and b/sprites/s_bone/layers/d75c63a0-bae2-47e4-afa0-19121f7b3e49/cdd131d3-6a7a-4215-9655-dca1ef6e761d.png differ diff --git a/sprites/s_bone/layers/f7001179-17d5-4058-9fea-74a6bc4cb1e7/09e61440-7f10-46b6-a80d-b571265b9fa8.png b/sprites/s_bone/layers/f7001179-17d5-4058-9fea-74a6bc4cb1e7/09e61440-7f10-46b6-a80d-b571265b9fa8.png deleted file mode 100644 index 0d51de16b..000000000 Binary files a/sprites/s_bone/layers/f7001179-17d5-4058-9fea-74a6bc4cb1e7/09e61440-7f10-46b6-a80d-b571265b9fa8.png and /dev/null differ diff --git a/sprites/s_bone/s_bone.yy b/sprites/s_bone/s_bone.yy index 2d5b235ed..7d1361f79 100644 --- a/sprites/s_bone/s_bone.yy +++ b/sprites/s_bone/s_bone.yy @@ -3,8 +3,8 @@ "%Name":"s_bone", "bboxMode":0, "bbox_bottom":15, - "bbox_left":0, - "bbox_right":19, + "bbox_left":1, + "bbox_right":15, "bbox_top":1, "collisionKind":1, "collisionTolerance":0, @@ -12,17 +12,18 @@ "edgeFiltering":false, "For3D":false, "frames":[ - {"$GMSpriteFrame":"","%Name":"c03ea78f-dc7f-49de-a720-6a1f3dcb5303","name":"c03ea78f-dc7f-49de-a720-6a1f3dcb5303","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, - {"$GMSpriteFrame":"","%Name":"f7001179-17d5-4058-9fea-74a6bc4cb1e7","name":"f7001179-17d5-4058-9fea-74a6bc4cb1e7","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, - {"$GMSpriteFrame":"","%Name":"0245a8b2-bfba-424b-9b37-77a115f2e3b2","name":"0245a8b2-bfba-424b-9b37-77a115f2e3b2","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, - {"$GMSpriteFrame":"","%Name":"81a25112-1d29-4386-90fe-399a6c01c9eb","name":"81a25112-1d29-4386-90fe-399a6c01c9eb","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"2f24ef16-f40a-4406-a890-1feb91fec59a","name":"2f24ef16-f40a-4406-a890-1feb91fec59a","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"24688870-14dc-40d5-bef8-f143942fec22","name":"24688870-14dc-40d5-bef8-f143942fec22","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"d75c63a0-bae2-47e4-afa0-19121f7b3e49","name":"d75c63a0-bae2-47e4-afa0-19121f7b3e49","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"7e00cee7-6fcf-483d-a02c-5d827a860d34","name":"7e00cee7-6fcf-483d-a02c-5d827a860d34","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"838d47a7-f072-4971-81fd-b8fdfc4be594","name":"838d47a7-f072-4971-81fd-b8fdfc4be594","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, ], "gridX":0, "gridY":0, "height":16, "HTile":false, "layers":[ - {"$GMImageLayer":"","%Name":"09e61440-7f10-46b6-a80d-b571265b9fa8","blendMode":0,"displayName":"default","isLocked":false,"name":"09e61440-7f10-46b6-a80d-b571265b9fa8","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + {"$GMImageLayer":"","%Name":"cdd131d3-6a7a-4215-9655-dca1ef6e761d","blendMode":0,"displayName":"default","isLocked":false,"name":"cdd131d3-6a7a-4215-9655-dca1ef6e761d","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, ], "name":"s_bone", "nineSlice":null, @@ -52,7 +53,7 @@ }, "eventStubScript":null, "eventToFunction":{}, - "length":4.0, + "length":5.0, "lockOrigin":false, "moments":{ "$KeyframeStore":"", @@ -72,22 +73,25 @@ "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"c03ea78f-dc7f-49de-a720-6a1f3dcb5303","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"7134a81b-689f-4b0f-96a2-a10cfc530807","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"2f24ef16-f40a-4406-a890-1feb91fec59a","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"893f9f93-747a-4a3a-91d1-a28e4d1c8550","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"f7001179-17d5-4058-9fea-74a6bc4cb1e7","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"32ab9797-d9f3-44eb-8e78-5ebd9c61ad65","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"24688870-14dc-40d5-bef8-f143942fec22","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"e7435e20-2fa2-4c7e-85ba-338c4ead6905","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"0245a8b2-bfba-424b-9b37-77a115f2e3b2","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"d0b93ac1-1924-4e63-b0bc-3c6e2439feb7","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"d75c63a0-bae2-47e4-afa0-19121f7b3e49","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"e9dbab8f-fc9b-454e-882d-3633f27bf7f5","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"81a25112-1d29-4386-90fe-399a6c01c9eb","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"de0a60db-637e-49dc-b687-e2357aa1434c","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7e00cee7-6fcf-483d-a02c-5d827a860d34","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"d3a82281-4b24-4a24-b8aa-2757ec0ae878","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"838d47a7-f072-4971-81fd-b8fdfc4be594","path":"sprites/s_bone/s_bone.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"c5f82344-1556-4362-9c75-705909c66c1f","IsCreationKey":false,"Key":4.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":10, + "xorigin":8, "yorigin":8, }, "swatchColours":null, @@ -98,5 +102,5 @@ }, "type":0, "VTile":false, - "width":20, + "width":16, } \ No newline at end of file diff --git a/sprites/s_bone_tool_pose/0fec69fc-80b0-443f-840b-fe37e8d4cfea.png b/sprites/s_bone_tool_pose/0fec69fc-80b0-443f-840b-fe37e8d4cfea.png new file mode 100644 index 000000000..632dd26d0 Binary files /dev/null and b/sprites/s_bone_tool_pose/0fec69fc-80b0-443f-840b-fe37e8d4cfea.png differ diff --git a/sprites/s_bone_tool_pose/4dc9dc0d-0298-4da0-8c63-521a4dbb4179.png b/sprites/s_bone_tool_pose/4dc9dc0d-0298-4da0-8c63-521a4dbb4179.png new file mode 100644 index 000000000..5d5a869ff Binary files /dev/null and b/sprites/s_bone_tool_pose/4dc9dc0d-0298-4da0-8c63-521a4dbb4179.png differ diff --git a/sprites/s_bone_tool_pose/layers/0fec69fc-80b0-443f-840b-fe37e8d4cfea/79643523-465c-4dce-8dc2-d36dcf68b2f9.png b/sprites/s_bone_tool_pose/layers/0fec69fc-80b0-443f-840b-fe37e8d4cfea/79643523-465c-4dce-8dc2-d36dcf68b2f9.png new file mode 100644 index 000000000..632dd26d0 Binary files /dev/null and b/sprites/s_bone_tool_pose/layers/0fec69fc-80b0-443f-840b-fe37e8d4cfea/79643523-465c-4dce-8dc2-d36dcf68b2f9.png differ diff --git a/sprites/s_bone_tool_pose/layers/4dc9dc0d-0298-4da0-8c63-521a4dbb4179/79643523-465c-4dce-8dc2-d36dcf68b2f9.png b/sprites/s_bone_tool_pose/layers/4dc9dc0d-0298-4da0-8c63-521a4dbb4179/79643523-465c-4dce-8dc2-d36dcf68b2f9.png new file mode 100644 index 000000000..5d5a869ff Binary files /dev/null and b/sprites/s_bone_tool_pose/layers/4dc9dc0d-0298-4da0-8c63-521a4dbb4179/79643523-465c-4dce-8dc2-d36dcf68b2f9.png differ diff --git a/sprites/s_bone_tool_pose/s_bone_tool_pose.yy b/sprites/s_bone_tool_pose/s_bone_tool_pose.yy new file mode 100644 index 000000000..7967cef24 --- /dev/null +++ b/sprites/s_bone_tool_pose/s_bone_tool_pose.yy @@ -0,0 +1,94 @@ +{ + "$GMSprite":"", + "%Name":"s_bone_tool_pose", + "bboxMode":0, + "bbox_bottom":16, + "bbox_left":1, + "bbox_right":16, + "bbox_top":1, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"4dc9dc0d-0298-4da0-8c63-521a4dbb4179","name":"4dc9dc0d-0298-4da0-8c63-521a4dbb4179","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"0fec69fc-80b0-443f-840b-fe37e8d4cfea","name":"0fec69fc-80b0-443f-840b-fe37e8d4cfea","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":18, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"79643523-465c-4dce-8dc2-d36dcf68b2f9","blendMode":0,"displayName":"default","isLocked":false,"name":"79643523-465c-4dce-8dc2-d36dcf68b2f9","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"s_bone_tool_pose", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"tool", + "path":"folders/theme/tool.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"s_bone_tool_pose", + "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":2.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_bone_tool_pose", + "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":"4dc9dc0d-0298-4da0-8c63-521a4dbb4179","path":"sprites/s_bone_tool_pose/s_bone_tool_pose.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"d057d9ac-8431-4ac9-aa7f-36f554ba3b7f","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"0fec69fc-80b0-443f-840b-fe37e8d4cfea","path":"sprites/s_bone_tool_pose/s_bone_tool_pose.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"b2dbe37b-5f2a-49e2-9b86-cd217c900513","IsCreationKey":false,"Key":1.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":9, + "yorigin":9, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":18, +} \ No newline at end of file diff --git a/sprites/s_hamburger_s/57067085-e631-493b-9ba3-10bf500f0309.png b/sprites/s_hamburger_s/57067085-e631-493b-9ba3-10bf500f0309.png index 395c79680..d11e30bd3 100644 Binary files a/sprites/s_hamburger_s/57067085-e631-493b-9ba3-10bf500f0309.png and b/sprites/s_hamburger_s/57067085-e631-493b-9ba3-10bf500f0309.png differ diff --git a/sprites/s_hamburger_s/layers/57067085-e631-493b-9ba3-10bf500f0309/64c2c8c8-2322-4ad5-ae7b-59c96a6393f4.png b/sprites/s_hamburger_s/layers/57067085-e631-493b-9ba3-10bf500f0309/64c2c8c8-2322-4ad5-ae7b-59c96a6393f4.png index 395c79680..d11e30bd3 100644 Binary files a/sprites/s_hamburger_s/layers/57067085-e631-493b-9ba3-10bf500f0309/64c2c8c8-2322-4ad5-ae7b-59c96a6393f4.png and b/sprites/s_hamburger_s/layers/57067085-e631-493b-9ba3-10bf500f0309/64c2c8c8-2322-4ad5-ae7b-59c96a6393f4.png differ diff --git a/sprites/s_random/18d00238-439b-413a-b57c-e5024b67aa9b.png b/sprites/s_random/18d00238-439b-413a-b57c-e5024b67aa9b.png deleted file mode 100644 index 05ba4c041..000000000 Binary files a/sprites/s_random/18d00238-439b-413a-b57c-e5024b67aa9b.png and /dev/null differ diff --git a/sprites/s_random/d3150bde-ba15-4dc0-8f84-ce9f2ef02f44.png b/sprites/s_random/d3150bde-ba15-4dc0-8f84-ce9f2ef02f44.png new file mode 100644 index 000000000..4d6ac73ac Binary files /dev/null and b/sprites/s_random/d3150bde-ba15-4dc0-8f84-ce9f2ef02f44.png differ diff --git a/sprites/s_random/layers/18d00238-439b-413a-b57c-e5024b67aa9b/3899fab5-1d66-4693-a407-72b0c9cb3a97.png b/sprites/s_random/layers/18d00238-439b-413a-b57c-e5024b67aa9b/3899fab5-1d66-4693-a407-72b0c9cb3a97.png deleted file mode 100644 index 05ba4c041..000000000 Binary files a/sprites/s_random/layers/18d00238-439b-413a-b57c-e5024b67aa9b/3899fab5-1d66-4693-a407-72b0c9cb3a97.png and /dev/null differ diff --git a/sprites/s_random/layers/d3150bde-ba15-4dc0-8f84-ce9f2ef02f44/5f5714a3-1333-4b07-991a-da972895632f.png b/sprites/s_random/layers/d3150bde-ba15-4dc0-8f84-ce9f2ef02f44/5f5714a3-1333-4b07-991a-da972895632f.png new file mode 100644 index 000000000..4d6ac73ac Binary files /dev/null and b/sprites/s_random/layers/d3150bde-ba15-4dc0-8f84-ce9f2ef02f44/5f5714a3-1333-4b07-991a-da972895632f.png differ diff --git a/sprites/s_random/s_random.yy b/sprites/s_random/s_random.yy index d8735aef5..1f206806c 100644 --- a/sprites/s_random/s_random.yy +++ b/sprites/s_random/s_random.yy @@ -2,24 +2,24 @@ "$GMSprite":"", "%Name":"s_random", "bboxMode":0, - "bbox_bottom":21, - "bbox_left":2, - "bbox_right":21, - "bbox_top":2, + "bbox_bottom":20, + "bbox_left":3, + "bbox_right":20, + "bbox_top":3, "collisionKind":1, "collisionTolerance":0, "DynamicTexturePage":false, "edgeFiltering":false, "For3D":false, "frames":[ - {"$GMSpriteFrame":"","%Name":"18d00238-439b-413a-b57c-e5024b67aa9b","name":"18d00238-439b-413a-b57c-e5024b67aa9b","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"d3150bde-ba15-4dc0-8f84-ce9f2ef02f44","name":"d3150bde-ba15-4dc0-8f84-ce9f2ef02f44","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, ], "gridX":0, "gridY":0, "height":24, "HTile":false, "layers":[ - {"$GMImageLayer":"","%Name":"3899fab5-1d66-4693-a407-72b0c9cb3a97","blendMode":0,"displayName":"default","isLocked":false,"name":"3899fab5-1d66-4693-a407-72b0c9cb3a97","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + {"$GMImageLayer":"","%Name":"5f5714a3-1333-4b07-991a-da972895632f","blendMode":0,"displayName":"default","isLocked":false,"name":"5f5714a3-1333-4b07-991a-da972895632f","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, ], "name":"s_random", "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":"18d00238-439b-413a-b57c-e5024b67aa9b","path":"sprites/s_random/s_random.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"3951d9c6-e2d6-4384-89a6-da4643a2ff65","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"d3150bde-ba15-4dc0-8f84-ce9f2ef02f44","path":"sprites/s_random/s_random.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"cf978900-0d0a-4af2-b3d6-fe251b46d293","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,