diff options
-rw-r--r-- | scene/animation/animation_node_state_machine.cpp | 3 | ||||
-rw-r--r-- | scene/resources/animation.cpp | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 60f8806b25..a2411743d4 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -599,6 +599,9 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) { { Ref<AnimationNode> node = states[p_name].node; + + ERR_FAIL_COND(node.is_null()); + node->disconnect("tree_changed", this, "_tree_changed"); } diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index e4da659b0d..1ca643cd7a 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1425,7 +1425,9 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p TransformTrack *tt = static_cast<TransformTrack *>(t); ERR_FAIL_INDEX(p_key_idx, tt->transforms.size()); + Dictionary d = p_value; + if (d.has("location")) tt->transforms.write[p_key_idx].value.loc = d["location"]; if (d.has("rotation")) @@ -1438,6 +1440,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p ValueTrack *vt = static_cast<ValueTrack *>(t); ERR_FAIL_INDEX(p_key_idx, vt->values.size()); + vt->values.write[p_key_idx].value = p_value; } break; @@ -1445,11 +1448,14 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p MethodTrack *mt = static_cast<MethodTrack *>(t); ERR_FAIL_INDEX(p_key_idx, mt->methods.size()); + Dictionary d = p_value; + if (d.has("method")) mt->methods.write[p_key_idx].method = d["method"]; if (d.has("args")) mt->methods.write[p_key_idx].params = d["args"]; + } break; case TYPE_BEZIER: { @@ -1469,6 +1475,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p case TYPE_AUDIO: { AudioTrack *at = static_cast<AudioTrack *>(t); + ERR_FAIL_INDEX(p_key_idx, at->values.size()); Dictionary k = p_value; ERR_FAIL_COND(!k.has("start_offset")); @@ -1483,6 +1490,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p case TYPE_ANIMATION: { AnimationTrack *at = static_cast<AnimationTrack *>(t); + ERR_FAIL_INDEX(p_key_idx, at->values.size()); at->values.write[p_key_idx].value = p_value; |