From 952c307f8a9da1c12eaa56bfc938c12326d8fd81 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 11 Apr 2024 22:23:47 +0200 Subject: [PATCH] Use internal process for updating a dirty skeleton instead of the MessageQueue. This fixes BoneAttachments being a frame late. --- modules/skeleton_3d/nodes/skeleton.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/skeleton_3d/nodes/skeleton.cpp b/modules/skeleton_3d/nodes/skeleton.cpp index dbc0f5579..9d7eb04a8 100644 --- a/modules/skeleton_3d/nodes/skeleton.cpp +++ b/modules/skeleton_3d/nodes/skeleton.cpp @@ -364,6 +364,10 @@ void Skeleton::_notification(int p_what) { if (modification_stack.is_valid()) { execute_modifications(get_process_delta_time(), SkeletonModificationStack3D::EXECUTION_MODE::execution_mode_process); } + + if (dirty) { + _notification(NOTIFICATION_UPDATE_SKELETON); + } } break; #endif // _3D_DISABLED @@ -812,7 +816,7 @@ void Skeleton::_make_dirty() { return; } - MessageQueue::get_singleton()->push_notification(this, NOTIFICATION_UPDATE_SKELETON); + //MessageQueue::get_singleton()->push_notification(this, NOTIFICATION_UPDATE_SKELETON); dirty = true; }