Fix blend point setter can't restore the name in deprecated=no

This commit is contained in:
Silc Lizard (Tokage) Renew
2026-03-17 21:09:59 +09:00
parent 1eb0374e5f
commit 119c497c96
2 changed files with 10 additions and 28 deletions
+5 -14
View File
@@ -321,21 +321,12 @@ bool AnimationNodeBlendSpace1D::_set(const StringName &p_name, const Variant &p_
if (prop.begins_with("blend_point_")) {
int idx = prop.get_slicec('_', 2).to_int();
String what = prop.get_slicec('/', 1);
if (idx == blend_points_used && what == "node") {
add_blend_point(p_value, 0, -1, StringName(itos(idx)));
return true;
}
if (what == "node") {
Ref<AnimationRootNode> node = p_value;
#ifndef DISABLE_DEPRECATED
if (idx == blend_points_used) {
add_blend_point(node, 0, -1, blend_points[idx].name.is_empty() ? StringName(itos(idx)) : blend_points[idx].name);
} else {
set_blend_point_node(idx, node);
}
#else
if (idx == blend_points_used) {
add_blend_point(node, 0, -1, blend_points[idx].name);
} else {
set_blend_point_node(idx, node);
}
#endif // DISABLE_DEPRECATED
set_blend_point_node(idx, p_value);
} else if (what == "pos") {
set_blend_point_position(idx, p_value);
} else if (what == "name") {
+5 -14
View File
@@ -393,21 +393,12 @@ bool AnimationNodeBlendSpace2D::_set(const StringName &p_name, const Variant &p_
if (prop.begins_with("blend_point_")) {
int idx = prop.get_slicec('_', 2).to_int();
String what = prop.get_slicec('/', 1);
if (idx == blend_points_used && what == "node") {
add_blend_point(p_value, Vector2(), -1, StringName(itos(idx)));
return true;
}
if (what == "node") {
Ref<AnimationRootNode> node = p_value;
#ifndef DISABLE_DEPRECATED
if (idx == blend_points_used) {
add_blend_point(node, Vector2(), -1, blend_points[idx].name.is_empty() ? StringName(itos(idx)) : blend_points[idx].name);
} else {
set_blend_point_node(idx, node);
}
#else
if (idx == blend_points_used) {
add_blend_point(node, Vector2(), -1, blend_points[idx].name);
} else {
set_blend_point_node(idx, node);
}
#endif // DISABLE_DEPRECATED
set_blend_point_node(idx, p_value);
} else if (what == "pos") {
set_blend_point_position(idx, p_value);
} else if (what == "name") {