Add saving flag hack to Skeleton and revert reset timing of animation

This commit is contained in:
Silc Lizard (Tokage) Renew
2025-01-26 00:57:37 +09:00
parent 1b7b009674
commit cb7085340e
10 changed files with 51 additions and 25 deletions

View File

@ -327,8 +327,10 @@ void Skeleton3D::_notification(int p_what) {
} break;
#ifdef TOOLS_ENABLED
case NOTIFICATION_EDITOR_PRE_SAVE: {
force_update_all_dirty_bones();
emit_signal(SceneStringName(skeleton_updated));
saving = true;
} break;
case NOTIFICATION_EDITOR_POST_SAVE: {
saving = false;
} break;
#endif // TOOLS_ENABLED
case NOTIFICATION_UPDATE_SKELETON: {
@ -940,6 +942,13 @@ void Skeleton3D::_make_dirty() {
void Skeleton3D::_update_deferred(UpdateFlag p_update_flag) {
if (is_inside_tree()) {
#ifdef TOOLS_ENABLED
if (saving) {
update_flags |= p_update_flag;
_notification(NOTIFICATION_UPDATE_SKELETON);
return;
}
#endif //TOOLS_ENABLED
if (update_flags == UPDATE_FLAG_NONE && !updating) {
notify_deferred_thread_group(NOTIFICATION_UPDATE_SKELETON); // It must never be called more than once in a single frame.
}
@ -1165,6 +1174,11 @@ void Skeleton3D::_process_modifiers() {
if (!mod) {
continue;
}
#ifdef TOOLS_ENABLED
if (saving && !mod->is_processed_on_saving()) {
continue;
}
#endif //TOOLS_ENABLED
real_t influence = mod->get_influence();
if (influence < 1.0) {
LocalVector<Transform3D> old_poses;