summaryrefslogtreecommitdiff
path: root/scene/animation/animation_player.cpp
diff options
context:
space:
mode:
authorKostadin Damyanov <maxmight@gmail.com>2015-06-18 22:48:29 +0300
committerKostadin Damyanov <maxmight@gmail.com>2015-06-18 22:48:29 +0300
commit0038e27fc39a422601bc220d8359ff9d98fd604d (patch)
tree75e24e1959184e3dae79d73947bc615090b8b0af /scene/animation/animation_player.cpp
parentf10eb8ffa1a7f6bee9b5228ea1204fd93844e4cc (diff)
parent37af8b413674936518a2ebe180f9e7bfcd5795bb (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'scene/animation/animation_player.cpp')
-rw-r--r--scene/animation/animation_player.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 4949b33c47..74ae2c0d55 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -223,7 +223,7 @@ void AnimationPlayer::_notification(int p_what) {
} break;
case NOTIFICATION_EXIT_TREE: {
- stop_all();
+ //stop_all();
clear_caches();
} break;
}
@@ -967,14 +967,16 @@ String AnimationPlayer::get_current_animation() const {
}
-void AnimationPlayer::stop() {
+void AnimationPlayer::stop(bool p_reset) {
Playback &c=playback;
c.blend.clear();
- c.current.from=NULL;
+ if (p_reset) {
+ c.current.from=NULL;
+ }
_set_process(false);
queued.clear();
- playing = false;
+ playing = false;
}
void AnimationPlayer::stop_all() {
@@ -1211,7 +1213,7 @@ void AnimationPlayer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_default_blend_time"),&AnimationPlayer::get_default_blend_time);
ObjectTypeDB::bind_method(_MD("play","name","custom_blend","custom_speed","from_end"),&AnimationPlayer::play,DEFVAL(""),DEFVAL(-1),DEFVAL(1.0),DEFVAL(false));
- ObjectTypeDB::bind_method(_MD("stop"),&AnimationPlayer::stop);
+ ObjectTypeDB::bind_method(_MD("stop","reset"),&AnimationPlayer::stop,DEFVAL(true));
ObjectTypeDB::bind_method(_MD("stop_all"),&AnimationPlayer::stop_all);
ObjectTypeDB::bind_method(_MD("is_playing"),&AnimationPlayer::is_playing);
ObjectTypeDB::bind_method(_MD("set_current_animation","anim"),&AnimationPlayer::set_current_animation);