How to Access AnimBlueprint nodes in c++?

Supposing I have a slot node or a blend node in my anim blueprint , how do I access this slot/node through c++ in a way that is similar to looking up nodes in the animtree during postinitanimtree ?

Thanks for the help!

Rama

Hi Rama,

You typically do not directly access node instances from C++. If you want to get data from C++ to the Anim BP generically, you can either ‘pull’ data from a pawn/character in the blueprint (most of the example anim BPs in the samples demonstrate this path), or ‘push’ data in C++ by creating a subclass of UAnimInstance and implementing NativeUpdateAnimation and/or casting and setting variables on the instance from other classes.

Regarding playing a specific animation. As mentioned on the forum thread, there are some new methods that will be in Beta 5 which make playing an animation on a slot much easier (PlaySlotAnimation, StopSlotAnimation, IsPlayingSlotAnimation), but for right now, you can create a animation montage asset wrapping the sequence you want to play, and then you can trigger that by using Montage_Play on the UAnimInstance.

Cheers,
Michael Noland

I am trying to control footplacement skeletal controllers through the AnimInstance class.

I took one look at this and decided to simply ask you all to provide more implementation of animation nodes like you did in UE3, especially for foot placement, such an awesome visual feature!

But I could spend days trying to sort through what this means below

//AnimInstance.h

 /** 
    	 * Blends Component Space transforms to MeshPose in Local Space. 
    	 * Used by SkelControls to apply their transforms.
    	 *
    	 * The tricky bit is that SkelControls deliver their transforms in Component Space,
    	 * But the blending is done in Local Space. Also we need to refresh any Children they have
    	 * that has been previously converted to Component Space.
    	 */
    	void LocalBlendCSBoneTransforms
    	(
    		const FBoneContainer & RequiredBones,
    		const TArray& BoneTransforms,
    		float Alpha
    	);

In the last build you could extend UVimInstance and then do whatever you want. I think as of the Sep build you extend AnimBlueprint.

The UVimInstance I had doesn’t work anymore, so I’m not 100% on my answer. I was previously passing data from code to the Blueprint, I’m pretty sure going the other way is not a problem.

I might have this mixed up.

Hi Michael,

UVimInstance was renamed to UAnimInstance in Beta4, but otherwise there shouldn’t be any breaking changes. Please feel free to start another thread if you’re having issues updating from Beta3 to Beta4.

Cheers,
Michael Noland