mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Merge pull request #101451 from TokageItLab/reset-retarget-in-the-child
Force update RetargetModifier3D's child skeletons on save
This commit is contained in:
@@ -213,6 +213,19 @@ void RetargetModifier3D::_reset_child_skeletons() {
|
|||||||
child_skeletons.clear();
|
child_skeletons.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
|
void RetargetModifier3D::_force_update_child_skeletons() {
|
||||||
|
for (const RetargetInfo &E : child_skeletons) {
|
||||||
|
Skeleton3D *c = Object::cast_to<Skeleton3D>(ObjectDB::get_instance(E.skeleton_id));
|
||||||
|
if (!c) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
c->force_update_all_dirty_bones();
|
||||||
|
c->emit_signal(SceneStringName(skeleton_updated));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // TOOLS_ENABLED
|
||||||
|
|
||||||
/// General functions
|
/// General functions
|
||||||
|
|
||||||
void RetargetModifier3D::add_child_notify(Node *p_child) {
|
void RetargetModifier3D::add_child_notify(Node *p_child) {
|
||||||
@@ -455,6 +468,7 @@ void RetargetModifier3D::_notification(int p_what) {
|
|||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
case NOTIFICATION_EDITOR_PRE_SAVE: {
|
case NOTIFICATION_EDITOR_PRE_SAVE: {
|
||||||
_reset_child_skeleton_poses();
|
_reset_child_skeleton_poses();
|
||||||
|
_force_update_child_skeletons();
|
||||||
} break;
|
} break;
|
||||||
#endif // TOOLS_ENABLED
|
#endif // TOOLS_ENABLED
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ private:
|
|||||||
void _reset_child_skeleton_poses();
|
void _reset_child_skeleton_poses();
|
||||||
void _reset_child_skeletons();
|
void _reset_child_skeletons();
|
||||||
|
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
|
void _force_update_child_skeletons();
|
||||||
|
#endif // TOOLS_ENABLED
|
||||||
|
|
||||||
void cache_rests_with_reset();
|
void cache_rests_with_reset();
|
||||||
void cache_rests();
|
void cache_rests();
|
||||||
Vector<RetargetBoneInfo> cache_bone_global_rests(Skeleton3D *p_skeleton);
|
Vector<RetargetBoneInfo> cache_bone_global_rests(Skeleton3D *p_skeleton);
|
||||||
|
|||||||
Reference in New Issue
Block a user