Just took the totally awesome new Animation Modifiers system in UE4.16 for a spin.
It took me about 30 mins to create an automatic foot sync marker tool with support for forward, backward and strafing movement all in blueprints, no C++.
Very cool. I had trouble finding this myself too but you just make a new blueprint and search for modifier in the classes and it’s there. Then just add the events and the new animation library nodes.
Is there a way to calculate the current bone location inside the animation modfiier blueprint? My animations are only using bone rotation, and thus have no position information.
I didn’t see any documentation on it either but it is a very useful feature that I’ve used in other animation engines and that made me want to explore it right away. Two things to get you going:
Create a new Blueprint class, find the Animation Modifier type in classes.
Use the Event On Apply that has an output Animation Sequence to feed into the ‘Animation Blueprint Library’ operations.
Do a ‘Does Curve Exist’ and a branch to remove the curve and then add it.
A gotcha that I didn’t realize was needed, when you get the pose transform of a bone it will be local space, you will need to do a manual transformation of that to component space. I did that by using the Find Path to Root which generates a list of bones, you can send that to the GetBonePosesForFrame which gives you an array of poses that you can use in a ForEachLoop and then do a ComposeTransforms with a temporary transform (initialized as identity) as the A input and Output. Would help if there was a GetComponentSpaceBonePoseForFrame instead, that would save time.
You also need to do a little bit of management between frame and time because setting a key uses time.
Hey EightyGee how did you calculate the lowest point for the feet? I am having some probems with it. Would be grade if you would give me an answer. I already know how to use the AnimationModifier but the math is giving me some problems.
My Idea would be to compare the Z location of the feet with the previous and next frame location, but I haven`t tested it yet.
I actually don’t use the lowest point for the foot, but rather the frame at which the foot goes from being in front of the root to behind the root (in the direction of travel) which is the point at which most of the character’s weight should be over that foot, and thus, the most planted.
My apologies, for the huge delay in releasing the blueprints - I’ve been crazy busy with a number of UE4 projects. Good news is that I’ve made quite a few improvements to the Foot Sync Automator, including simplifying the workflow (you no longer have to indicate the axis of travel) as well as support for arcing motion (like lean circles). I promise I will make the blueprints available for download very soon!
Hi guys! Thanks for the info in this post.
I’ve just written an article on my blog and created a sample project on github with an animation modifier script similar to the one shown in this thread. I hope you find it useful.