Fix blend point setter can't restore the name in deprecated=no
This commit is contained in:
@@ -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") {
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user