diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/animation/animation_player.cpp | 11 | ||||
-rw-r--r-- | scene/animation/animation_player.h | 3 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 10 | ||||
-rw-r--r-- | scene/main/scene_tree.h | 3 |
4 files changed, 21 insertions, 6 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index ea445b1573..206f3ccca2 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -33,6 +33,17 @@ #include "message_queue.h" #include "scene/scene_string_names.h" +#ifdef TOOLS_ENABLED +void AnimatedValuesBackup::update_skeletons() { + + for (int i = 0; i < entries.size(); i++) { + if (entries[i].bone_idx != -1) { + Object::cast_to<Skeleton>(entries[i].object)->notification(Skeleton::NOTIFICATION_UPDATE_SKELETON); + } + } +} +#endif + bool AnimationPlayer::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 4a347f49ea..e39afcf199 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -50,6 +50,9 @@ class AnimatedValuesBackup { Vector<Entry> entries; friend class AnimationPlayer; + +public: + void update_skeletons(); }; #endif diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index d4be683a2b..b8dba96551 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -127,7 +127,7 @@ void SceneTree::remove_from_group(const StringName &p_group, Node *p_node) { group_map.erase(E); } -void SceneTree::_flush_transform_notifications() { +void SceneTree::flush_transform_notifications() { SelfList<Node> *n = xform_change_list.first(); while (n) { @@ -448,7 +448,7 @@ bool SceneTree::iteration(float p_time) { current_frame++; - _flush_transform_notifications(); + flush_transform_notifications(); MainLoop::iteration(p_time); physics_process_time = p_time; @@ -459,7 +459,7 @@ bool SceneTree::iteration(float p_time) { _notify_group_pause("physics_process", Node::NOTIFICATION_PHYSICS_PROCESS); _flush_ugc(); MessageQueue::get_singleton()->flush(); //small little hack - _flush_transform_notifications(); + flush_transform_notifications(); call_group_flags(GROUP_CALL_REALTIME, "_viewports", "update_worlds"); root_lock--; @@ -487,7 +487,7 @@ bool SceneTree::idle(float p_time) { MessageQueue::get_singleton()->flush(); //small little hack - _flush_transform_notifications(); + flush_transform_notifications(); _notify_group_pause("idle_process_internal", Node::NOTIFICATION_INTERNAL_PROCESS); _notify_group_pause("idle_process", Node::NOTIFICATION_PROCESS); @@ -503,7 +503,7 @@ bool SceneTree::idle(float p_time) { _flush_ugc(); MessageQueue::get_singleton()->flush(); //small little hack - _flush_transform_notifications(); //transforms after world update, to avoid unnecessary enter/exit notifications + flush_transform_notifications(); //transforms after world update, to avoid unnecessary enter/exit notifications call_group_flags(GROUP_CALL_REALTIME, "_viewports", "update_worlds"); root_lock--; diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index bc3efdc42f..7898dc065a 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -157,7 +157,6 @@ private: Map<UGCall, Vector<Variant> > unique_group_calls; bool ugc_locked; void _flush_ugc(); - void _flush_transform_notifications(); _FORCE_INLINE_ void _update_group_order(Group &g); void _update_listener(); @@ -344,6 +343,8 @@ public: void notify_group(const StringName &p_group, int p_notification); void set_group(const StringName &p_group, const String &p_name, const Variant &p_value); + void flush_transform_notifications(); + virtual void input_text(const String &p_text); virtual void input_event(const Ref<InputEvent> &p_event); virtual void init(); |