From 2560d6b41e1f4ae85d2ae773ed70d56badeae1a7 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Thu, 3 Feb 2022 12:08:15 -0800 Subject: [PATCH] Load workspace should activate the graph by default. (#7389) Signed-off-by: rhhong --- .../Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp index c8ee9be995..6196c86205 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp @@ -344,8 +344,9 @@ namespace EMStudio if (itActivationIndices->second.m_animGraphCommandIndex != -1 && itActivationIndices->second.m_motionSetCommandIndex != -1) { - commandString = AZStd::string::format("ActivateAnimGraph -actorInstanceID %%LASTRESULT%d%% -animGraphID %%LASTRESULT%d%% -motionSetID %%LASTRESULT%d%% -visualizeScale %f\n", - (commandIndex - itActivationIndices->second.m_actorInstanceCommandIndex), + // Since the actor instance will be created by the component, we pass in -1 as the actor instance id so the activate anim graph command + // will pick up the first available actor instance. + commandString = AZStd::string::format("ActivateAnimGraph -actorInstanceID -1 -animGraphID %%LASTRESULT%d%% -motionSetID %%LASTRESULT%d%% -visualizeScale %f\n", (commandIndex - itActivationIndices->second.m_animGraphCommandIndex), (commandIndex - itActivationIndices->second.m_motionSetCommandIndex), animGraphInstance->GetVisualizeScale());