- [Armature Pose] Fix node not updating.

This commit is contained in:
Tanasart 2023-11-04 18:10:58 +07:00
parent 09eeea9a03
commit 3dade4c58f
7 changed files with 74 additions and 28 deletions

Binary file not shown.

View file

@ -369,5 +369,25 @@
"pref_use_alt": "Use ALT for", "pref_use_alt": "Use ALT for",
"meta_old_version": "Created on an older version", "meta_old_version": "Created on an older version",
"open_in_safe_mode": "Open in safe mode",
"group_properties": "Group Properties",
"panel_inspector_axis_combine": "Combine axis",
"panel_inspector_disable_expression": "Disable expression",
"new_folder": "New folder",
"panel_graph_enter_group_new_tab": "Open group in new tab",
"set_as_group_tool": "Set as group tool",
"panel_graph_align_nodes": "Align nodes",
"panel_graph_copy_prop": "Copy all properties",
"panel_graph_paste_prop": "Paste all properties",
"node_color": "Node Color",
"connection_color": "Connection Color",
"pref_pages_interface": "Interface",
"pref_directory_temp": "Temp path (restart required)",
"pref_inspector_focus_on_double_click": "Focus on double click",
"notification": "Notification",
"pref_pan_key": "Panning key",
"reload_theme": "Reload theme",
"reset_layout": "Reset layout",
"" : "" "" : ""
} }

View file

@ -306,5 +306,29 @@
"widget": "Widget", "widget": "Widget",
"workshop": "Workshop", "workshop": "Workshop",
"rename": "Rename",
"inputs": "Inputs",
"save/load": "Save/Load",
"crash": "Crash",
"splash": "Splash",
"quality": "Quality",
"display": "Display",
"data": "Data",
"layers": "Layers",
"brush": "Brush",
"sprite": "Sprite",
"spawn": "Spawn",
"movement": "Movement",
"physics": "Physics",
"ground": "Ground",
"wiggles": "Wiggles",
"sdf": "SDF",
"level": "Level",
"channel": "Channel",
"solid": "Solid",
"noise": "Noise",
"pattern": "Pattern",
"related": "Related",
"" : "" "" : ""
} }

View file

@ -26,7 +26,7 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER; globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
VERSION = 11560; VERSION = 11560;
SAVE_VERSION = 11550; SAVE_VERSION = 11560;
VERSION_STRING = "1.15.6"; VERSION_STRING = "1.15.6";
BUILD_NUMBER = 11560; BUILD_NUMBER = 11560;

View file

@ -37,21 +37,19 @@
function __txtx(key, def = "") { function __txtx(key, def = "") {
gml_pragma("forceinline"); gml_pragma("forceinline");
if(LOCALE_USE_DEFAULT) return def; if(key == "") return "";
if(TEST_LOCALE) { if(TEST_LOCALE) {
if(!struct_has(LOCALE.word, key) && !struct_has(LOCALE.ui, key)) { if(!struct_has(LOCALE.word, key) && !struct_has(LOCALE.ui, key)) {
show_debug_message($"LOCALE: \"{key}\": \"{def}\","); show_debug_message($"LOCALE: \"{key}\": \"{def}\",");
//return def; return def;
} }
return ""; return "";
} }
if(struct_has(LOCALE.word, key)) if(LOCALE_USE_DEFAULT) return def;
return LOCALE.word[$ key];
if(struct_has(LOCALE.ui, key)) if(struct_has(LOCALE.word, key)) return LOCALE.word[$ key];
return LOCALE.ui[$ key]; if(struct_has(LOCALE.ui, key)) return LOCALE.ui[$ key];
return def; return def;
} }
@ -59,11 +57,18 @@
function __txt(txt, prefix = "") { function __txt(txt, prefix = "") {
gml_pragma("forceinline"); gml_pragma("forceinline");
if(LOCALE_USE_DEFAULT) return txt; if(txt == "") return "";
var key = string_lower(txt); var key = string_lower(txt);
key = string_replace_all(key, " ", "_"); key = string_replace_all(key, " ", "_");
if(TEST_LOCALE) {
if(!struct_has(LOCALE.word, key) && !struct_has(LOCALE.ui, key)) {
show_debug_message($"LOCALE: \"{key}\": \"{txt}\",");
return txt;
}
return "";
}
if(LOCALE_USE_DEFAULT) return txt;
return __txtx(prefix + key, txt); return __txtx(prefix + key, txt);
} }

View file

@ -22,14 +22,12 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
attributes.display_bone = 0; attributes.display_bone = 0;
array_push(attributeEditors, "Display"); array_push(attributeEditors, "Display");
array_push(attributeEditors, ["Display name", function() { return attributes.display_name; }, array_push(attributeEditors, ["Display name", function() { return attributes.display_name; },
new checkBox(function() { new checkBox(function() { attributes.display_name = !attributes.display_name; })]);
attributes.display_name = !attributes.display_name;
})]);
array_push(attributeEditors, ["Display bone", function() { return attributes.display_bone; }, array_push(attributeEditors, ["Display bone", function() { return attributes.display_bone; },
new scrollBox(["Octahedral", "Stick"], function(ind) { new scrollBox(["Octahedral", "Stick"], function(ind) { attributes.display_bone = ind; })]);
attributes.display_bone = ind;
})]);
static createNewInput = function(bone = noone) { #region static createNewInput = function(bone = noone) { #region
var index = ds_list_size(inputs); var index = ds_list_size(inputs);
@ -38,8 +36,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
.setDisplay(VALUE_DISPLAY.transform); .setDisplay(VALUE_DISPLAY.transform);
inputs[| index].display_data.bone_id = bone != noone? bone.ID : noone; inputs[| index].display_data.bone_id = bone != noone? bone.ID : noone;
if(bone != noone) if(bone != noone) boneMap[? bone.ID] = inputs[| index];
boneMap[? bone.ID] = inputs[| index];
array_push(input_display_list, index); array_push(input_display_list, index);
@ -99,9 +96,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
//print(_input_display_list); //print(_input_display_list);
} #endregion } #endregion
tools = [ tools = [];
];
anchor_selecting = noone; anchor_selecting = noone;
posing_bone = noone; posing_bone = noone;
@ -132,9 +127,10 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
var bx = posing_sx + pp[0]; var bx = posing_sx + pp[0];
var by = posing_sy + pp[1]; var by = posing_sy + pp[1];
var val = posing_input.getValue(); var val = array_clone(posing_input.getValue());
val[TRANSFORM.pos_x] = bx; val[TRANSFORM.pos_x] = bx;
val[TRANSFORM.pos_y] = by; val[TRANSFORM.pos_y] = by;
if(posing_input.setValue(val)) if(posing_input.setValue(val))
UNDO_HOLDING = true; UNDO_HOLDING = true;
@ -144,9 +140,10 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
var ang = point_direction(ori.x, ori.y, smx, smy); var ang = point_direction(ori.x, ori.y, smx, smy);
var rot = ang - posing_sy; var rot = ang - posing_sy;
var val = posing_input.getValue(); var val = array_clone(posing_input.getValue());
val[TRANSFORM.sca_x] = ss; val[TRANSFORM.sca_x] = ss;
val[TRANSFORM.rot] = rot; val[TRANSFORM.rot] = rot;
if(posing_input.setValue(val)) if(posing_input.setValue(val))
UNDO_HOLDING = true; UNDO_HOLDING = true;
@ -157,7 +154,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
posing_sy = ang; posing_sy = ang;
posing_sx += rot; posing_sx += rot;
var val = posing_input.getValue(); var val = array_clone(posing_input.getValue());
val[TRANSFORM.rot] = posing_sx; val[TRANSFORM.rot] = posing_sx;
if(posing_input.setValue(val)) if(posing_input.setValue(val))

View file

@ -733,7 +733,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
//addNodeCatagory("VCT", vct); //addNodeCatagory("VCT", vct);
// addNodeObject(vct, "Biterator", s_node_print, "Node_Biterator", [1, Node_Biterator]); // addNodeObject(vct, "Biterator", s_node_print, "Node_Biterator", [1, Node_Biterator]);
//////////////////////////////////////////////////////////////// PIXEL BUILDER //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// PIXEL BUILDER ////////////////////////////////////////////////////////////
var pb_group = ds_list_create(); #region var pb_group = ds_list_create(); #region
addNodePBCatagory("Group", pb_group); addNodePBCatagory("Group", pb_group);
@ -805,7 +805,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
addNodeObject(pb_arr, "Array Remove", s_node_array_remove, "Node_Array_Remove", [1, Node_Array_Remove], ["remove array", "delete array", "array delete"]).hideRecent().setVersion(1120); addNodeObject(pb_arr, "Array Remove", s_node_array_remove, "Node_Array_Remove", [1, Node_Array_Remove], ["remove array", "delete array", "array delete"]).hideRecent().setVersion(1120);
#endregion #endregion
//////////////////////////////////////////////////////////////// PCX NODES //////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// PCX NODE ///////////////////////////////////////////////////////////////
var pcx_var = ds_list_create(); #region var pcx_var = ds_list_create(); #region
addNodePCXCatagory("Variable", pcx_var); addNodePCXCatagory("Variable", pcx_var);
@ -835,7 +835,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
addNodeObject(pcx_flow, "Condition", s_node_array, "Node_PCX_Condition", [1, Node_PCX_Condition]).hideRecent(); addNodeObject(pcx_flow, "Condition", s_node_array, "Node_PCX_Condition", [1, Node_PCX_Condition]).hideRecent();
#endregion #endregion
//////////////////////////////////////////////////////////////// HIDDENS //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// HIDDEN ////////////////////////////////////////////////////////////////
var hid = ds_list_create(); #region var hid = ds_list_create(); #region
addNodeCatagory("Hidden", hid, ["Hidden"]); addNodeCatagory("Hidden", hid, ["Hidden"]);