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()
WM.ActiveDocument.Run 51
End Sub
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)
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.