Q: How much can you load onto the “Event Tick” event before it starts bogging down performance?
I’m making a rendered, animated short (not a game) and I wanted to use several (15+) corrective morph targets on each of my characters. These are driven by bone rotation and translation for mesh volume preservation and finessing facial expression and joint deformation.
In my prototyping, I currently have the “Event Tick” event driving these checks every frame. I might eventually have two dozen bone checks on each tick firing off per character. So my questions are:
A. Is this bad practice to load up so many bone rotation/translation checks onto the “Tick” event?
B. Does it even matter if I’m going to be rendering frames for video, not making a game?
C. Is there some way to fire off an event only when a bone changes its rotation/translation?
I’ve considered a custom event that only fires when a change in bone position takes place… but I don’t know how to do that without simply checking it at every frame (i.e. – an Event Tick).
I’m new to this, and would greatly appreciate the wisdom of more seasoned script-writers.
Your intuition on this is excellent, and here is the solution you were looking for (because I went through this exact thought process):
Timelines are your savior here. They can be set to a specific amount of time, and can be finite or looped. You can create graphs within them that output values over its length, as well as set specific times for custom events to fire off from it. They can be started, stopped, reversed, etc.
Fire once into it and it does its thing for as long as you need.
It’s perfect for triggering perpetual events in Blueprints without cluttering up Tick.
Also, we had developed quite a bit of our gameplay and relied heavily on Tick. By replacing all instances of Tick with event-based Timelines, we saw a noticeable performance increase. But even if performance is not a worry, the amount of control and cleanliness in your Blueprints will be greatly increased by switching to this method.
Essentially, there is no reason to use Tick if you are programming with Blueprints. Timelines function as highly-controllable and situationally-based Tick events and are, IMO, highly preferable.
Check out the documentation:
That sounds like a great direction to go, thanks! I’ve heard the tutorial guys swoon over Timelines, but haven’t yet had opportunity to study it. I’ll be doing that immediately. I’m sure it’ll be a more elegant solution than I currently have in place.
Hey just checking in! Everything going okay with this?
Thanks! So far, I’ve been doing some testing to see if corrective morph targets are keyframing already in my animation sequences, and would automatically carry over successfully to the engine. Turns out they do! (In Blender anyway.) I’m hoping this might be all that’s needed, and a blueprint approach won’t even be necessary for this specific issue.
However, I’ve followed your advice and studied more about timelines, and it’s pretty clear that I could definitely use them for programmatically driven animation and material effects in my cinematics. So thanks for the advice! I know it’ll come in handy with my project.
Being a noob at this, I assumed I’d have to wire up some elaborate Blueprint to drive corrective morph targets programmatically within the engine. Turns out you don’t AFAI can tell. This is for Blender, so I don’t know if it’ll work in another package as well.
Say you have a character. You have an animation where they crouch down. The calf and thigh are interpenetrating and knee volume is collapsing. Looks really bad.
In Blender, you pose the knee into position. You sculpt a new blend shape to correct the mesh in that area. You place a driver on the strength value of that blend shape. (Sorry, I’m unable to make a lengthy description of the driver creation process here.)
The driving bone attribute could be anything. But for a knee, you’d likely use the calf bone’s local rotation (use local space) to drive the strength of the blend shape.
Then, when I keyframe that rotating bone during an animation, it appears to also place some animation data on the strength of the blend shape. I then exported the animation over to UE4. The blend shape, called a “morph target” in UE4, is on the imported mesh. When I play the animation sequence, the morph target automatically fires as it should with the bending “knee” area.
There’s no way that driver could have carried over into Unreal. It only lives in Blender. So it has to be there is some keyframe data generated by Blender on the blend shape. And Unreal can see it, and plays it, in the imported anim sequence.
Which is JUST flipping BRILLIANT!!! (Did a little happy dance when I saw that it just worked.)
Anyway, I hope I’m not leading anyone wrong. This worked for me. Someone please correct me if I’m flat out wrong. I’m a humble noob.