editor retarget animation: reset pose before retarget to avoid mistake of retargeting while in a different pose

This commit is contained in:
Turánszki János
2025-07-17 09:12:26 +02:00
parent ab79802f30
commit 6b6d8abdfd
+3 -1
View File
@@ -984,7 +984,9 @@ void AnimationWindow::Create(EditorComponent* _editor)
retargetCombo.SetSelectedWithoutCallback(-1);
wi::scene::Scene& scene = editor->GetCurrentScene();
Entity retarget_entity = scene.RetargetAnimation((Entity)args.userdata, entity, true);
Entity dst_entity = (Entity)args.userdata;
scene.ResetPose(dst_entity); // reset pose to be able to retarget anim to character while it's already in an animated pose
Entity retarget_entity = scene.RetargetAnimation(dst_entity, entity, true);
if (retarget_entity != INVALID_ENTITY)
{
NameComponent name;