Gifs are a really cool thing to have in your story, but I warn you - it’s gonna be tricky! But it’s so worth it!
Step 1: Split the gif
Split your gif into single frames. Make sure it’s in png format. If you can’t do this by yourself, I recommend this page: https://ezgif.com/ - it covers many useful functions. It also lets you turn a video into a gif, if you didn’t find the right one.
The more frames, the better the outcome Note that gifs are repeated animations, so you probably won’t need all frames - just the ones that create the full ‘cycle’. (Hope this makes sense.)
Note down the frame time, you’ll gonna need this later.
Frame time is the time in which a single frame is shown for. For example if a gif lasts 3 seconds and it is split into 12 frames, then the frame time would be 3/12 = 0.25s. If you use the page provided above, it tells you the frame time.
Step 2: Upload
Upload the frames as overlays - yes, every single one Make sure not to change it’s default position when uploading - unless it’s a full screen image. Otherwise you’ll have some trouble placing them later.
Name the overlays properly (with numbers), so that you know in which order to code them.
Step 3: Coding
It’s not as complicated as you probably imagine
Place all overlays at the same position - either by stage view or by commands.
Stage view: INT. BACKGROUND - DAY with FRAME1 with FRAME2 with FRAME3 etc.
Command: &overlay FRAME1 create
If using stage view - set the opacity to 0 except for the first frame.
If using commands - set the first frame’s opacity to 1.
You don’t have to specify the layers, God bless.
The idea of the following code is to show each frame for its frame time, show the next, fade the previous and so on - all on loop. As you may or may not know, the looping command doesn’t allow pauses, so how are we gonna let the frame show for a specific amount of time, you ask? We’re going to trick the script into making a pause.
The first frame is already showing, so we have to make the fake pause. Then we fade the next frame in and right after that fade the previous one out, then again the pause etc.
‘Deafult’ code template:
&overlay FRAME1 opacity 1 for [frame time] THEN FRAME2 opacity 1 in 0 THEN FRAME1 opacity 0 in 0 ...
This code is for one frame, so you just copy and paste it for as many frames as you have, changing their numbers of course.
(It is gonna be a long ass command but it eez what it eez.)
Practical example: 6 frames, 0.02 frame time
&overlay FRAME1 opacity 1 for 0.02 THEN overlay FRAME2 opacity 1 in 0 THEN overlay FRAME1 opacity 0 in 0 THEN overlay FRAME2 opacity 1 for 0.02 THEN overlay FRAME3 opacity 1 in 0 THEN overlay FRAME2 opacity 0 in 0 THEN overlay FRAME3 opacity 1 for 0.02 THEN overlay FRAME4 opacity 1 in 0 THEN overlay FRAME3 opacity 0 in 0 THEN overlay FRAME4 opacity 1 for 0.02 THEN overlay FRAME5 opacity 1 in 0 THEN overlay FRAME4 opacity 0 in 0 THEN overlay FRAME5 opacity 1 for 0.02 THEN overlay FRAME6 opacity 1 in 0 THEN overlay FRAME5 opacity 0 in 0 THEN overlay FRAME6 opacity 1 for 0.02 THEN overlay FRAME1 opacity 1 in 0 THEN overlay FRAME6 opacity 0 in 0 loop INFINITE times
Note how it goes back to frame 1 at the end.
Disclaimer: This method may not look as smooth with transparent images.
I hope this thread helped some of you
Happy coding, but first happy uploading your frames !