Render out Construction Script animations

Hey guys,

I’ve got a question that I’ve been trying to answer for a couple of days now (and I’ve been trawling the internet long and wide).

How can you render out animations that are based on a Construction Script rig, driven by an exposed variable?

In my tests I’ve got a perfectly good Blueprint Actor set up with everything created inside Construction Script and an “Offset” variable exposed in Sequencer that lets me drive individual components of that Blueprint Actor with keyframes. This works like a charm in the editor:

BUT, for some reason - that I don’t understand and that nobody seems to be mentioning anywhere online - you cannot export these animations as a movie file / image sequence. The moment I hit render, I get this:

Yes ladies and gentlemen, it’s a video, but the animation is essentially gone. And I don’t know why, or how to fix it.

From what I could gather so far, Construction Script runs only once at the start of runtime. Great, so it can’t be used for animations inside gameplay - makes total sense. That’s what Event Graphs are for.

However, I’m not after gameplay - I want to do my animation work in Sequencer and render out a good old video.

There are three boxes you’ve got to tick in order to get Construction Script animations to show up correctly in the Editor/Sequencer:

  • Run Construction Script in Sequencer (inside the Blueprint Actor’s Class Settings)
  • Expose to Cinematics (on the variable you want to animate in Sequencer)
  • Rerun Construction Scripts (in Sequencer’s Playback Options)

So there are three commands that are aimed at making Construction Script animations run in the Sequencer and the Editor. Ergo, Construction Script animations aren’t a coding accident, they are intentional. So why would they not render out to a video file?

As I said, I couldn’t make it work after days of trying every possible combination and eventually turned to Event-Graph-driven animations, which come with their own issues. But coming from classical DCCs such as C4D/Houdini, animating a public variable linked to the Construction Script of a Blueprint Actor is definitely the more natural and ‘logical’ way. Just plain keyframes and no need to activate runtime in order to see what’s going on.

So why does it seem like UE isn’t supporting this, or am I really missing a super-obvious trick here? Maybe a console command that makes it all happen?

I’m really eager to find out :upside_down_face:

2 Likes

And just to add, I know there is a ticket going on UE Engine Issues here:
https://issues.unrealengine.com/issue/UE-66524

What does the green ‘By Design’ mean in this context? That this behaviour is on purpose?

I’m coming across the same issue concerning Construction Script animations that won’t render out with MRQ. I’m using UE 4.27.2
Found another report: UE-147746
https://issues.unrealengine.com/issue/UE-147746

Hi there, yes that’s my bug report :smile: Hope you voted for it :wink: Let’s hope they fix this soon (it’s an issue in every version from 4.26 - 5.0), as - for me - this is biggest issue separating UE from being a fully fledged jack of all trades for anything animation (including mograph) or ‘just’ a convoluted game engine that you’ll grudgingly use whenever you need to speed up render times.

Ha! Yeah, I voted for it.

I got a reply about this from Epic via UDN:
" The Rerun Construction Scripts setting can have a heavy impact on performance, so it only applies to the timeline UI, and isn’t meant to work in games/simulations, which is the case for MRQ.

In most cases behaviors like this can be moved to the actor’s tick or another function. Migrating these bits of functionality into one or more functions should allow for it to be called from both the construction script and tick, so the construction script can still set-up the actor, and the behavior can be mirrored on a per frame basis. Setters are another option for behavior to happen in response to sequence evaluation. "

Thanks a lot :slightly_smiling_face: That’s very useful information. Funnily enough I got the same reply asking this question on Youtube:

Still have to try setting this up though. The suggestion in regars to ‘Setters’ seems also very useful.

To slightly disagree with the folks from Epic, the Construction Script animation does show up and works normally in gameplay / simulation mode, as can be seen here:

So one just wonders, why UE is killing this functionality the moment you hit render. Or why it has to go into game/simulation mode to render out via MRQ anyway. But I’m also under no illusions that this is on top of their list.

Just in case this could be useful to you, I found a vaguely elegant workaround using timeline nodes and Event Tracks that wouldn’t work at first, but an amazing forum member helped me fix it.
https://forums.unrealengine.com/t/how-to-avoid-timeline-nodes-having-to-finish-when-using-blueprint-actor-event-tracks-in-sequencer/511864/58

UE is an amazing tool, but coming from ‘standard’ DCCs, it sometimes feels a bit like using it against its intent.

There’s still so much to learn! :smiley:

1 Like

BTW, I tried my setup now with ‘Event Tick’ and it works :partying_face: Thanks a lot again for sharing.

In order to make this more usable, I added a switch (i.e. a Boole variable) that chops off the animation part of the Construction Script whenever I intend to render and instead moves it over to the Event Graph.

Would be great if there was a way to automate this, i.e. if there was a function that detects whether the game is running in Construction Script and based on that switches off the animation part of the graph, but I couldn’t find anything so far.

Either way, the workaround above works so much better and makes running animations in and exporting them from UE so much more efficient.

I’m a lot happier now :upside_down_face:

3 Likes

OK, last little issue here :smile:

Everything works fine with this setup when in editor and in runtime view. HOWEVER, when I forward this to the Movie Render Queue, my animation won’t stop, i.e. the bits that I’m animation fly out into space.

Any Idea how I could fix that?

you could try one value into a set local offset, rather than an add local offset, and just key that in seq,
with what you have now, every frame it’s adding to local offset, so unless the value piping into it is = 0, its just going to keep moving

Thanks YuuJin. Can you explain why this doesn’t happen when I run the animation in game mode inside the editor, but only when I render out via the MRQ?

Also, whenever I’ve used the “set” node in regards to my script, it moves the entire Blueprint upwards, instead of offsetting the individual items from the centre, as is my intention.

Is the bug fixed?

Dude. This is my exact problem and it took me all day to figure out the right language to google this problem just to find you had the same issue. Same background, C4D etc. Finally realized myself that if I’m gonna animate stuff, construction script just won’t do the trick, at least for rendering, even though I SEE IT in my sequencer! How silly of me to assume it would work. So I’m trying to glean what I can off your Event Graph, but you’re more advanced than I am with blueprints, and what I’m dealing with is a huge number of instanced meshes that I am simply trying to rotate (individually, not as a whole unit).

So I guess i run into an issue in trying to steal your code where I don’t (think?) need an array or anything, but just want to make the instanced meshes rotate. So instead of “get actors of class” I just need a less fancy way to call up the instanced mesh. Of course I’ll try to poke around to find that answer, but hoping by karma somehow you might have some kind of solution. Thanks anyway for posting this!

2 Likes

Hey sorry, I haven’t been on here in a while. Have you managed to fix your problem (like almost 3 months later :sweat_smile:)?

This still occurs in UE5.1

Some poor soul like me will discover this thread after tearing their hair out too.
Put your function in Construction scripts, and make sure Run Construction Scripts in Sequencer is turned on. This effectively turns each frame of Sequencer, while scrubbing, into a “tick.”

In my case, I had to have a character follow a spline path. With Event Tick, you can pull delta seconds and multiply it by a speed to get distance travelled, easily plug that into a Get Transform at Distance Along Spline and you have yourself a nice actor following a spline, over time. Well, without tick, your delta will always be 0. So in Sequencer I exposed a float and called it “delta cinematic” and just animated the beginning and end of that variable, effectively creating my own tick’s Delta Seconds by hand. Be sure to set it to Linear interpolation too.

Sequencer will re-evaluate every frame (your ‘tick’) because of rerunning Construction Scripts, and with the animated float you will effectively get the timing/Delta Seconds you need. Then at Render time, since construction scripts only run once, your actual Tick will take over and you should be fine either way.

Whew!

1 Like

Thinking about this overnight.

Would it be possible to get the Sequence’s current frame?

It would be interesting if you could get the current sequence and somehow pass it to your actors. With them knowing what the current frame is, they could evaluate your function without having to use Tick or Construction scripts. But how to pass that data over every frame seems tricky.