Topic: Animating Textures in Maratis

- This is an early rewrite of the tutorial as the previous one was quite ... well. not good smile
This is still unfinished, will update it over time

Method overview :

1) Pack a serie of image in a spritesheet
2) Import and set-up animation in blender
3) Use it in maratis

You will need :

Imagemagick to :
- Make the spritesheet
- Split spritesheet you could find on the web and adapt it
- Whatever. this app is a must have anyway wink

Optional :
I also recommand using Imagemagick along with Batchrun, so you can set up your working directory and edit your scripts very easily


Ok let's get started, first, get this :

- An Image Sequence, this is a CC0 fireball animation from OGA
- Blender Template - With keyframes already set, so you just have to load the texture in it


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Next step


Now let's pack the individual images into a spritesheet.

To do this, we'll use a simple imagemagick script /!\ (to use with Montage.exe) /!\ :

*.png -tile 8x8 -geometry 128x128+0+0 -background black PNG32:Spritesheet.png

This will generate a 1024x1024 picture, with all the images aligned as 128x128 size in it.

When done, we have the spritesheet. Now let's set up the animations in blender.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Next step


Open Blender, set the spritesheet in the material texture slot.

As keyframe are already set, you can export the mesh right away.

In case you don't noticed, i have scaled up the keyframes 10 times.

That way, in maratis we can control the playing speed with setAnimationSpeed(), without having to re-open / tweak / re-export the mesh everytime in blender.

Note : With this method, the texture will play very, very slowly once imported. "Good" animation speed should be about 6 or 7

/!\ Make sure to uncheck Material animation and Armature Animation before exporting /!\


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Next step


From here you can test the texture animation in a new project,
but it will play very slowly if you dont make use of setAnimationSpeed()

I will provide a test project later on

--------------To come
- Precise animation control
- A project to test your textures
- Spritesheets of different sizes
- Pack and use multiple animations in a single texture

Last edited by Vegas (2014-06-16 22:28:34)

Re: Animating Textures in Maratis

A nice one, as well! Although my first thought was: whatfor does he need this animation as a gif in a game?
But, now I can imagine some use for this, f.i. animated parts in the user interface of the game.
Thanks! wink