Author Topic: Showing off your unit animations with an animated GIF.  (Read 2531 times)

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Have you ever painstakingly created an animation for one of your units and wish you could show it off, only to find out that nobody could be bothered to download your model and try it for themselves?  Here I show you how to solve this problem by turning your unit's animation into a GIF so that you can more conveniently show off your work, like these:



For the GIF, I used Blender and GIMP.  Open up your animated model in Blender and do the following (Sorry it's kinda grainy.  That's MS Paint for you. :P):



On the Buttons window, select the scene button or press F10.  Change the directory into wherever you want to put the resulting images, preferably an empty folder.  To record all of the frames of the animation, leave Step set at 1.  To skip frames, set it to 2 to record half of the frames, 3 to record 1/3, and so on.  Adjust the start and end frames to the beginning and end of your animation.  If your last frame is the same as your first, you can leave the last frame off.  You can change the image size if you want, but we'll be cropping it in GIMP, so don't worry about it too much.  You can use either a JPEG or a PNG and either RGB (red, green, and blue) or RGBA (red, green, blue, and alpha), depending on whether or not you need alpha support.  Then press the big ANIM button, which will render each frame of the animation (or not all of them, depending on the step) and save it as a picture file in the directory you specified.

Then open up the directory where you saved the files, and open the first picture (by default it's called 0001.png) in GIMP.  Then in GIMP, go to File > Open As Layers.  All of the images that Blender put there should be titled 000X.png, where X is the frame number.  Select them and click Open.  Then crop your image.  If you don't know how to do this, just go to Image > Autocrop Image to get rid of all the extra space (this is optional, but saves room).  Next, File > Save As and name it with a *.gif extension.  On the dialog window that appears, select the Save As Animation radio button and click export.  At the next dialog window, you can change the delay between frames to whatever you want.  By default it's 100ms, or .1 second, which will make your GIF play very fast, so you might want to increase the delay.  Then Save and you should have yourself an animated GIF. :)

Note: Sometimes the result can be a little weird when you use alpha and the unit's silhouette changes, so if you don't get the desired results, try using RGB instead of RGBA, or just use JPEGs instead of PNGs.
« Last Edit: 14 July 2009, 01:12:34 by John.d.h »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Showing off your unit animations with an animated GIF.
« Reply #1 on: 14 July 2009, 04:49:23 »
While animated GIF's are nice, there is somethings you never mentioned.

Firstly, GIF's are limited to 8 bits, so they can only have 256 colors, thus the grainyness of the images. They can hold alpha, but only 1 channel. This results in poor image quality.

Next, because this is in blender, the model may not be exactly as shown. The best example is how teamcolor is still alpha (transparency) in blender.

Also, you never set the model to 'smooth' so that you wouldn't see this blockness with the light reflecting. Glest models are automatically smoothed.

Finally, why not try an alternative by making a video of your animation playing, then break that video up into separate GIFs so to have people see it EXACTLY as G3D viewer will show it. Little more work, noticable quality.

Of course, I still support what you did. It is nice to see animations without the need to download. I usually would check others models, but when I'm on dial up, I don't unless they show the filesize and I decide its suitable. If they don't show the filesize, I won't give it a second look. Seriously, how hard is it to write something like 1.2MB or 7532 KB, etc?

Still, remember to smooth, and consider replacing the texture with a non alpha one just for that preview. Of course, do remember not everyone wants to see the unit, and will wwait until you release the mod...

EDIT// Oops, almost forgot the most important part! DO NOT MAKE GIFS OF LARGE IMAGES. While fine for still images, large animations can cause lag, and take a while to load. Thus, I would recommend a 400px2 max size. Smaller is better. If you have a really large thing, just show it as a youtube video (very easy, loads fast (though not on dialup), and can display it in the G3D viewer, as is with team color and stuff how it was, no degrading!).
« Last Edit: 14 July 2009, 04:57:27 by omega »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything