Animations, how I do it - a workflow

Ask a question or request a feature related to the website or forum...

Moderator: scott

Post Reply
User avatar
ME
Addict
Addict
Posts: 3512
Joined: Wed Jun 08, 2005 6:37 pm
Location: Netherlands

Animations, how I do it - a workflow

Post by ME »

To answer Fletcher's request [link], I'm showing (off) a workflow for creating animations.
I actually used an ancient paint-program, but this one saves a few clicks.

Showcasing ScreenToGif-portable (short: S2G) as a way to create an animation of a (WM2D-) simulation in Snapshot mode.
https://www.screentogif.com
or
https://github.com/NickeManarin/ScreenToGif/releases


As old-school as I am I first do some calculus in the attempt to reduce the file size as much as I can. (Reduces the planetary impact a bit).

Let's say that one wheel with eight mechanisms does one rotation in around 15096 simulation steps.
Because the actions repeats per 45°, I only need 1887 simulation steps.
1887 frames will surely give me a multi-megabyte file, and for that I usually use about 40 frames per simulation.
I try to find a factor that's close to this amount, like 40*47=1880. Because this amount gives me a hiccup of 7 frames.
Being off by 1 frame is usually not a visual issue.
With some spreadsheet magic we can find that 37*51 is the closest match (exact in this case)
So I can decide to pick 37 frames while skipping 51 frames (this 45°/37 = 1.2 degrees per animated frame), ..
or I can decide to pick 51 frames while skipping 37 frames (this 45°/51 = 0.88 degrees per animated frame).

S2G | Startup: >Editor
S2G | Menu: >Extra >options

S2G | Options: >About: ScreenToGif Version 2.18
S2G | Options: >Language: English

Put the screenrecorder into "snapshot"-mode
(Watch: don't forget this option when you want movies at another time)
S2G | Options: >Application: [x] Enable snapshot mode
Check & change the default shortcuts when they interfere with other stuff:
S2G | Options: >Shortcuts: [F7] Start/Pause
S2G | Options: >Shortcuts: [F8] Stop
S2G | Options: <Ok>


WM2D | Maneuver the simulation to the initial frame.
WM2D | Menu: >Script >Editor:

Code: Select all

Sub Main&#40;&#41;
	WM.ActiveDocument.Run 51
End Sub
Change "51" for another amount of skip-frames.

S2G | Menu: >File >New >Recording
There should be a new window. Overlap the window until it encloses the capture area.

Record the whole sequence with this simple procedure:
  • WM2D | Press <Play> in the WM2D editor
    Press F7 to capture,
    Repeat until the animation is complete (37 times in this case)
S2G | Press the blue square [F8] to return to the S2G editor

Set the animation timing (I haven't found the default setting yet, but 100mS is usually good enough... For 25Hz use 40 ms (1000/25)
Select all images: Ctrl+A
S2G | Menu: >Edit >Delay >Override: 100 ms


When this sequence is not continuous, I suggest to Override the timing of first frame with 1000 ms, and the last frame with 2000 ms.
Check with playback:
S2G | Menu: >Playback >Play

Now save the recording via:
S2G | Menu: >File >Save As:

Of course we can fiddle with the default GIF-options to see what it does:
At time of writing, default: * Encoder=1.0, Quality 9, All marks checked.
While testing this I liked; Encoder=2.0, #Colors=16, All marks checked.


Recreation of Calloway's idea now gave me a file size of 196kb instead of 186kb. The Encoder 2.0 resulted in 216kb.
With 10% it's within the same range.

I tried a movie (snapshot:off).
With my reaction time and timed animation, I had to find and remove the first 50 static frames at the start, and 25 frames at the end.
My result was 315 kb (only 55 frames)

Bigger, but not megabytes. That gives us options.
Marchello E.
-- May the force lift you up. In case it doesn't, try something else.---
User avatar
Fletcher
Addict
Addict
Posts: 8472
Joined: Wed Nov 05, 2003 9:03 am
Location: NZ

re: Animations, how I do it - a workflow

Post by Fletcher »

Thanks a bunch ME .. I'll work my way thru a test example and post it here when I'm happy with it.

Currently I can create an avi file of a sim using the 'export' function in WM. If I run the sim at low accuracy and adjust the frame capture rate when saving the avi it doesn't suck too many kbs. I guess this is why Scott doesn't support avi files coz guys like me would be dumping them in here willy nilly hogging his bandwidth :7( Coz it would be too easy.

But it is good if you want to send to someone by email who doesn't have WM. Clarity is a bit of an issue I've found tho, a bit fudgey.

It makes me wonder if the avi could be loaded into the animator software and save a few steps ? Won't know till I work thru your instructions to create one. You might have an opinion ?

Cheers
mickegg
Aficionado
Aficionado
Posts: 389
Joined: Sun Sep 03, 2006 3:06 pm
Location: Berkshire,England

Post by mickegg »

Hi Fletcher

After reading your post I typed "avi to gif" in Google's search box.

An extraordinary amount of online converters offered....

Might be worth having a look?

Regards

Mick
User avatar
Fletcher
Addict
Addict
Posts: 8472
Joined: Wed Nov 05, 2003 9:03 am
Location: NZ

re: Animations, how I do it - a workflow

Post by Fletcher »

Thanks mickegg .. that looks pretty good and I'm definitely going to experiment with your suggested conversion of WM avi to animated gif.

Have to clear a bit of deck space before I can spend the time on trying it out.

I also want to learn the 'old fashioned' way that ME proposed. Just coz I'm like that ;7) And I also want to try and keep the file size down and keep the rendition clarity if I can, as he said. His method will do that for sure. I'm bound to remember it if I have to struggle a little first time round.

Besides, why do something the easy way when I can do it the hard way lol.

Cheers to you both.
User avatar
ME
Addict
Addict
Posts: 3512
Joined: Wed Jun 08, 2005 6:37 pm
Location: Netherlands

re: Animations, how I do it - a workflow

Post by ME »

The trade-off of doing stuff...

When you can save it in a uncompressed AVI-container and have Windows MediaPlayer installed (seems required for that application I mentioned), then you can try to import that video file.
Trying to Gif-ify a compressed AVI and miss out on the benefits of compressing low-color image stacks. It's then perhaps better to store it as MP4.
Marchello E.
-- May the force lift you up. In case it doesn't, try something else.---
Post Reply