Is it at all possible to play an animation using ONLY c++. To take a mesh, pass it an animation and have it play? I also will need it to blend. That is to say I need it to transition cleanly from one animation to the next. I have been able to forego the use of an animation blueprint and just play an animation like this:
m_poMeshComponent->PlayAnimation(m_poCurrAnim, bLooping);
But this does not have an concept for transition to another animation. So if I want a clean sequence:
Idle → walk → Idle → Attack → Idle (no popping/snapping)
How would I go about this without the use of an Animation Blueprint? I have tried using the following functions and they seem to not animate without a blueprint:
m_poMeshComponent->GetAnimInstance()->PlaySlotAnimation(m_poSequenceBase, SlotNodeName, BlendInTime, BlendOutTime, InPlayRate, LoopCount);
And:
m_poMeshComponent->GetAnimInstance()->Montage_Play(m_poMontage, InPlayRate);
Just a little back story: Our game has hundreds of different Meshes. Originally when I was begining to setup the animation system for this, I put a bunch of State Logic in a state machine in the animation blueprint with the idea that I would just swap the mesh under the hood later and reuse the same state/transition logic. As I delved into this, I found that that is not part of the functionality. I see that I could replicate an AnimBP for each mesh…but that would give me hundreds of AnimBPs. If an artist wanted to tweak/add/remove a node or functionality in one of the AnimBPs, they’d have to do it for hundreds. So I decided it was best to forego the use of the Animation Blueprint system and just solve it in code. But there does not seem to be a clean or easy way that I can find to just take a mesh, play an animation on it (idle) and then when I want to play another animation (move) have it cleanly/smoothly transition between them. Montages and ‘Slot Anims’ have a concept of blend in/out, but they also take speicific slot information that says what slot they are to play on (“DefaultSlot”) and this all seems to be data setup in an Animation Blueprint that I am trying to avoid using.