Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/ActorPropertiesWindow.cpp
void ActorPropertiesWindow::OnFindBestMatchingNode()
    {
        // check if the actor is invalid
        if (m_actor == nullptr)
        {
            return;
        }

        // find the best motion extraction node
        EMotionFX::Node* bestMatchingNode = m_actor->FindBestMotionExtractionNode();
        if (bestMatchingNode == nullptr)
        {
            return;
        }

        // create the command group
        MCore::CommandGroup commandGroup("Adjust motion extraction node");

        // adjust the actor
        const AZStd::string command = AZStd::string::format("AdjustActor -actorID %i -motionExtractionNodeName \"%s\"", m_actor->GetID(), bestMatchingNode->GetName());
        commandGroup.AddCommandString(command);

        // execute the command group
        AZStd::string result;
        if (!EMStudio::GetCommandManager()->ExecuteCommandGroup(commandGroup, result))
        {
            AZ_Error("EMotionFX", false, result.c_str());
        }
    }
// automatically find the best matching motion extraction node and set it
automatically find the best matching motion extraction node and set it
automatically find the best matching motion extraction node and set it
void ActorPropertiesWindow::OnFindBestMatchingNode()
    {
        if (m_actor == nullptr)
        {
            return;
        }
        EMotionFX::Node* bestMatchingNode = m_actor->FindBestMotionExtractionNode();
        if (bestMatchingNode == nullptr)
        {
            return;
        }
        MCore::CommandGroup commandGroup("Adjust motion extraction node");
        const AZStd::string command = AZStd::string::format("AdjustActor -actorID %i -motionExtractionNodeName \"%s\"", m_actor->GetID(), bestMatchingNode->GetName());
        commandGroup.AddCommandString(command);
        AZStd::string result;
        if (!EMStudio::GetCommandManager()->ExecuteCommandGroup(commandGroup, result))
        {
            AZ_Error("EMotionFX", false, result.c_str());
        }
    }
void ActorPropertiesWindow :: OnFindBestMatchingNode ( ) { if ( m_actor == nullptr ) { return ; } EMotionFX :: Node * bestMatchingNode = m_actor -> FindBestMotionExtractionNode ( ) ; if ( bestMatchingNode == nullptr ) { return ; } MCore :: CommandGroup commandGroup ( " " ) ; const AZStd :: string command = AZStd :: string :: format ( " \" \" " , m_actor -> GetID ( ) , bestMatchingNode -> GetName ( ) ) ; commandGroup . AddCommandString ( command ) ; AZStd :: string result ; if ( ! EMStudio :: GetCommandManager ( ) -> ExecuteCommandGroup ( commandGroup , result ) ) { AZ_Error ( " " , false , result . c_str ( ) ) ; } }
automatically find the best matching motion extraction node and set it
automatically find the best matching motion extraction node and set it
// check if the actor is invalid // find the best motion extraction node // create the command group // adjust the actor // execute the command group