Menu

Welcome, Guest. Please login or register.
December 16, 2018, 12:45:58 am

Login with username, password and session length

Author Topic: Creating texture animations  (Read 411 times)

inico

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 243
    • View Profile
    • http://www.youtube.com/inicocustom
Creating texture animations
« on: November 07, 2017, 07:29:09 pm »
TEXTURE ANIMATION: THE TUTORIAL

Hello everyone.
In this tutorial I will explain how texture animations work. It's based in WotLK but it's exactly the same for Cata and beyond.
We will add a basic texture animation to this test model:

(you can download it in the Tools section)

This method is quite useful to simulate waterfalls, energy beams, fire and much more.
If you want to add an advanced opacity mask, check my other tutorial.

TOOLS
-PyModelEditor.
-My test model.

Take in mind that it can be done in 010editor as well, but it's a little more complex. Once you know how texture animations work with PyModelEditor, feel free to explore it a little further creating multiple animation layers with different renderflags or adding them with 010editor.

THE TUTORIAL
Run PyModelEditor and open the test model (TexAnimPlaneTest.m2).
1- Go to GlobalSequences.
2- Write "1500" (without the quotation marks) and click on "OK". This is the ammount of time our animation will take. 1500 milliseconds is 1,5 seconds. The more milliseconds, the slower the animation will be.
3- Go to Edit UV Animations.
4- Click on "Add" to create a new texture animation.
5- Once the new texture animation is created, go to "Edit Translation".
6- A new window will open. Go to "Add AnimSub".
7- Change the Interpolation to "Linear".
8- Apply the global sequence you just created.
9- Paste this line:
Code: [Select]
0:{ 0.0 , 0.0 , 0.0 }
1500:{ 0.0 , 1.0 , 0.0 }

Now, click on Ok on all the windows you have open to apply the changes.

10- Go to Edit Materials.
11- Select the material of the mesh you want to add the texture animation (in this case, the test model only has one) and assign the texture animation you just created.



You can now save your model. If you test the model in-game, you will notice that the texture animation works fine, but there is some kind of dragging bug and it doesn't loop correctly:


This happens when the texture is not tiled. To tile the texture, open the model with PyModelEditor, go to Edit Textures and check both "X-Wrap" and "Y-Wrap":


This should fix the problem! (you can also do it in 010editor by changing the TextureFlag to "3").

TL;DR VIDEO


UNDERSTANDING THE ANIMATION SEQUENCE
Now that you managed to make your own texture animation, you may be wondering how to reverse the animation, or move it sidewards instead of upwards.
The key is in the animation line we added in PyModelEditor:


As you can see, each line has 4 segments: time frame, horizontal movement, vertical movement and an unused stack of data that we will never touch.
In frame 0, your texture stays on its default pose (0, 0, 0), but in frame 1500 it moves vertically (0, 1, 0) and goes back to where it started (it loops).
"1.0" is the ammount of times the texture loops. If you change it to "0.5", the texture will start moving but will return to its defult state when it has traveled half the texture. If you replace "1.0" with "-1.0", the texture will go downwards instead of upwards.
So, basically, "1500:{ 0.0 , 1.0 , 0.0 }" means that in 1.5 seconds your texture will loop vertically once. Another example: "3000:{ 0.0 , -1.0 , 0.0 }" means that in 3 seconds the texture will loop vertically once (but downwards).



If you put "1.0" in the horizontal segment instead of the vertical segment, you'll see something like this:


And if you want it to move to the corners, you simply need to put "1.0" (or -1.0 if you want it to go to the opposite direction) in both the horizontal and the vertical segment:


CONCLUSION
Texture animation is quite easy once you know how the numbers work. You just need some practice and experimentation to master it.
If your model has many .skin files, PyModelEditor won't manage the texture animations so well. The best tool for those cases is 010editor. I recommend you to start with small models first.
This tutorial was requested many times. Hope you find it useful.
« Last Edit: November 07, 2017, 07:38:40 pm by inico »

Mjollna

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 252
    • View Profile
Re: Creating texture animations
« Reply #1 on: November 08, 2017, 05:30:08 pm »
Wow, thanks a lot for this tutorial, it's very useful to enhance m2 with more features.