summaryrefslogtreecommitdiffstats
path: root/scene/animation/animation_blend_tree.cpp
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-02-11 14:18:45 -0300
committerreduz <reduzio@gmail.com>2021-02-11 15:44:28 -0300
commitf8d03b98e7eeeb726af4f653f1fde8b063cbad14 (patch)
tree69b180a08d668e49aceca16ff9067c70da00f0ea /scene/animation/animation_blend_tree.cpp
parente5bb89cdd5e92fa6fdeff78aad08bf0cbfbcc692 (diff)
downloadredot-engine-f8d03b98e7eeeb726af4f653f1fde8b063cbad14.tar.gz
Improve resource load cache
-Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
Diffstat (limited to 'scene/animation/animation_blend_tree.cpp')
-rw-r--r--scene/animation/animation_blend_tree.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp
index fb16f95379..79a1dc1ac0 100644
--- a/scene/animation/animation_blend_tree.cpp
+++ b/scene/animation/animation_blend_tree.cpp
@@ -1121,6 +1121,13 @@ void AnimationNodeBlendTree::_get_property_list(List<PropertyInfo> *p_list) cons
p_list->push_back(PropertyInfo(Variant::ARRAY, "node_connections", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
}
+void AnimationNodeBlendTree::reset_state() {
+ graph_offset = Vector2();
+ nodes.clear();
+ emit_changed();
+ emit_signal("tree_changed");
+}
+
void AnimationNodeBlendTree::_tree_changed() {
emit_signal("tree_changed");
}