- [Transform] Fix error when animating position.

This commit is contained in:
Tanasart 2024-08-24 08:25:27 +07:00
parent 5625b70ba2
commit 766f6bd39d
3 changed files with 32 additions and 31 deletions

View file

@ -36,10 +36,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
globalvar HOTKEYS, HOTKEY_CONTEXT;
LATEST_VERSION = 1_16_00_0;
LATEST_VERSION = 1_16_00;
VERSION = 1_17_11_0;
SAVE_VERSION = 1_17_10_0;
VERSION_STRING = "1.17.11.002";
VERSION_STRING = "1.17.11.003";
BUILD_NUMBER = 1_17_11_0;
HOTKEYS = ds_map_create();

View file

@ -1034,7 +1034,7 @@ function __initNodes() {
ds_list_add(node, "Groups");
addNodeObject(node, "Group", s_node_group, "Node_Group", [1, Node_Group]);
addNodeObject(node, "Feedback", s_node_feedback, "Node_Feedback", [1, Node_Feedback],, "Create a group that reuse output from last frame to the current one.");
addNodeObject(node, "Feedback", s_node_feedback, "Node_Feedback", [1, Node_Feedback],, "Create a group that reuse output from last frame to the current one.").isDeprecated();
addNodeObject(node, "Loop", s_node_loop, "Node_Iterate", [1, Node_Iterate], ["iterate", "for"], "Create group that reuse output as input repeatedly in one frame.").isDeprecated();
addNodeObject(node, "Loop Array", s_node_loop_array, "Node_Iterate_Each_Inline", [1, Node_Iterate_Each_Inline], ["iterate each", "for each", "array loop"], "Create group that iterate to each member in an array.");
addNodeObject(node, "Filter Array", s_node_filter_array, "Node_Iterate_Filter_Inline", [1, Node_Iterate_Filter_Inline],, "Filter array using condition.").setVersion(1140);

View file

@ -587,40 +587,41 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
overlay_drag_sy = _pos[1];
}
}
#region path
if(inputs[2].is_anim && inputs[2].value_from == noone && !inputs[2].sep_axis) {
var posInp = inputs[2];
var allPos = posInp.animator.values;
var ox, oy, nx, ny;
if(inputs[2].is_anim && inputs[2].value_from == noone && !inputs[2].sep_axis) { // draw path
var posInp = inputs[2];
var allPos = posInp.animator.values;
var ox, oy, nx, ny;
var _val, _px, _py;
draw_set_color(COLORS._main_accent);
draw_set_color(COLORS._main_accent);
for( var i = 0; i < ds_list_size(allPos); i++ ) {
var pos = allPos[| i].value;
var _pos = [ pos[0], pos[1] ];
if(posInp.unit.mode == VALUE_UNIT.reference) {
_pos[0] *= ow;
_pos[1] *= oh;
}
for( var i = 0, n = array_length(allPos); i < n; i++ ) {
_val = allPos[i].value;
_px = _val[0];
_py = _val[1];
nx = _x + _pos[0] * _s;
ny = _y + _pos[1] * _s;
draw_set_alpha(1);
draw_circle_prec(nx, ny, 4, false);
if(i) {
draw_set_alpha(0.5);
draw_line_dashed(ox, oy, nx, ny);
}
ox = nx;
oy = ny;
if(posInp.unit.mode == VALUE_UNIT.reference) {
_px *= ow;
_py *= oh;
}
nx = _x + _px * _s;
ny = _y + _py * _s;
draw_set_alpha(1);
draw_circle_prec(nx, ny, 4, false);
if(i) {
draw_set_alpha(0.5);
draw_line_dashed(ox, oy, nx, ny);
}
ox = nx;
oy = ny;
}
#endregion
draw_set_alpha(1);
}
}
}