Gems/EMotionFX/Code/EMotionFX/Source/BlendTree.cpp
void BlendTree::Output(AnimGraphInstance* animGraphInstance)
    {
        AZ_PROFILE_SCOPE(Animation, "BlendTree::Output");

        AZ_Assert(m_finalNode, "There should always be a final node. Something seems to be wrong with the blend tree creation.");

        // get the output pose
        AnimGraphPose* outputPose;

        // if this node is disabled, output the bind pose
        if (m_disabled)
        {
            RequestPoses(animGraphInstance);
            outputPose = GetOutputPose(animGraphInstance, OUTPUTPORT_POSE)->GetValue();
            outputPose->InitFromBindPose(animGraphInstance->GetActorInstance());
            return;
        }

        // output final node
        AnimGraphNode* finalNode = GetRealFinalNode();
        if (finalNode)
        {
            OutputIncomingNode(animGraphInstance, finalNode);

            RequestPoses(animGraphInstance);
            outputPose = GetOutputPose(animGraphInstance, OUTPUTPORT_POSE)->GetValue();
            *outputPose = *finalNode->GetMainOutputPose(animGraphInstance);

            finalNode->DecreaseRef(animGraphInstance);
        }
        else
        {
            RequestPoses(animGraphInstance);
            outputPose = GetOutputPose(animGraphInstance, OUTPUTPORT_POSE)->GetValue();
            outputPose->InitFromBindPose(animGraphInstance->GetActorInstance());
        }

        // visualize it
        if (GetEMotionFX().GetIsInEditorMode() && GetCanVisualize(animGraphInstance))
        {
            animGraphInstance->GetActorInstance()->DrawSkeleton(outputPose->GetPose(), m_visualizeColor);
        }
    }
// process the blend tree and calculate its output
process the blend tree and calculate its output
process the blend tree and calculate its output
void BlendTree::Output(AnimGraphInstance* animGraphInstance)
    {
        AZ_PROFILE_SCOPE(Animation, "BlendTree::Output");
        AZ_Assert(m_finalNode, "There should always be a final node. Something seems to be wrong with the blend tree creation.");
        AnimGraphPose* outputPose;
        if (m_disabled)
        {
            RequestPoses(animGraphInstance);
            outputPose = GetOutputPose(animGraphInstance, OUTPUTPORT_POSE)->GetValue();
            outputPose->InitFromBindPose(animGraphInstance->GetActorInstance());
            return;
        }
        AnimGraphNode* finalNode = GetRealFinalNode();
        if (finalNode)
        {
            OutputIncomingNode(animGraphInstance, finalNode);
            RequestPoses(animGraphInstance);
            outputPose = GetOutputPose(animGraphInstance, OUTPUTPORT_POSE)->GetValue();
            *outputPose = *finalNode->GetMainOutputPose(animGraphInstance);
            finalNode->DecreaseRef(animGraphInstance);
        }
        else
        {
            RequestPoses(animGraphInstance);
            outputPose = GetOutputPose(animGraphInstance, OUTPUTPORT_POSE)->GetValue();
            outputPose->InitFromBindPose(animGraphInstance->GetActorInstance());
        }
        if (GetEMotionFX().GetIsInEditorMode() && GetCanVisualize(animGraphInstance))
        {
            animGraphInstance->GetActorInstance()->DrawSkeleton(outputPose->GetPose(), m_visualizeColor);
        }
    }
void BlendTree :: Output ( AnimGraphInstance * animGraphInstance ) { AZ_PROFILE_SCOPE ( Animation , " " ) ; AZ_Assert ( m_finalNode , " " ) ; AnimGraphPose * outputPose ; if ( m_disabled ) { RequestPoses ( animGraphInstance ) ; outputPose = GetOutputPose ( animGraphInstance , OUTPUTPORT_POSE ) -> GetValue ( ) ; outputPose -> InitFromBindPose ( animGraphInstance -> GetActorInstance ( ) ) ; return ; } AnimGraphNode * finalNode = GetRealFinalNode ( ) ; if ( finalNode ) { OutputIncomingNode ( animGraphInstance , finalNode ) ; RequestPoses ( animGraphInstance ) ; outputPose = GetOutputPose ( animGraphInstance , OUTPUTPORT_POSE ) -> GetValue ( ) ; * outputPose = * finalNode -> GetMainOutputPose ( animGraphInstance ) ; finalNode -> DecreaseRef ( animGraphInstance ) ; } else { RequestPoses ( animGraphInstance ) ; outputPose = GetOutputPose ( animGraphInstance , OUTPUTPORT_POSE ) -> GetValue ( ) ; outputPose -> InitFromBindPose ( animGraphInstance -> GetActorInstance ( ) ) ; } if ( GetEMotionFX ( ) . GetIsInEditorMode ( ) && GetCanVisualize ( animGraphInstance ) ) { animGraphInstance -> GetActorInstance ( ) -> DrawSkeleton ( outputPose -> GetPose ( ) , m_visualizeColor ) ; } }
process the blend tree and calculate its output
process the blend tree and calculate its output
// get the output pose // if this node is disabled, output the bind pose // output final node // visualize it