This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [Research] .anim files : How do they work ?  (Read 2488 times)

spik96

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 275
    • View Profile
[Research] .anim files : How do they work ?
« on: July 02, 2015, 11:35:05 pm »
Hi Modcraft !

My question sounds simple: how do .anim files work ?
Their purpose is to store animations that are not often used.
By the wiki I understand they are only parsed when the flags of the animation & 0x30 == 0.
The timestamps & values are then extracted using the offset like they would have been in the m2, but just in the .anim file. That's where I wonder : which one ?

.anim file example : taunkamale0069-02.anim

What does 0069-02 stands for ?
I guess 0069 is some kind of ID, but is it the AnimID ? It is likely (as 69 is EmoteDance, that would make sense) but if someone is sure about that..

Then 02. There is also for this model 0069-00 and 0069-01 so that must be the # of a particular animation (physical animation, not playable animation). But how should I be able to identify it ?
« Last Edit: July 04, 2015, 04:41:14 pm by Admin »
Github ]https://github.com/Koward[/url]    Skype : koward723 =)

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spik96

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 275
    • View Profile
Re: [SOLVED] .anim files : How do they work ?
« Reply #2 on: July 03, 2015, 12:44:25 am »
Well... Thanks. You could not answer it better.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Github ]https://github.com/Koward[/url]    Skype : koward723 =)

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [SOLVED] .anim files : How do they work ?
« Reply #3 on: July 03, 2015, 12:47:13 am »
Not sure if that was sarcasm.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spik96

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 275
    • View Profile
Re: [SOLVED] .anim files : How do they work ?
« Reply #4 on: July 03, 2015, 01:13:09 am »
That was not sarcasm.
Are you sure about the flags ? Sometimes I have anims with &30 ==0 but it seems there is no .anim file attached to it. So I don't know where this information is stored. But after all, the WoW Model Viewer guys managed to do it and their program is open source so I should just look there.
EDIT : I found the part of their code l.1000 in model.cpp which handles .anim files so I will try to understand it.
EDIT2 : I'm locked as I can't find at all their "init" method they use on animation blocks... I'm stupid.
I found informations here about flags tho : http://www.wowdev.wiki/index.php ... animations , I will try to follow them.

EDIT3 : There is a conflict with these informations.
On the main wiki, .anim files are loaded when flags & 0x30 == 0.
On the anim talk, .anim files are loaded when (flags & 0x20 == 0) && (flags & 0x40 == 0).
I think I can safely say it is equal to flags & 0x60.
This is different :
1st check) bits 4&5 have to be 0.
2nd check) bits 5&6 have to be 0.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Github ]https://github.com/Koward[/url]    Skype : koward723 =)

spik96

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 275
    • View Profile
Re: [Questions] .anim files : How do they work ?
« Reply #5 on: July 03, 2015, 06:36:40 pm »
I have a model, SiberianTiger.m2. It's animation 50 has an AnimID of 63 and a SubAnimID of 0.
Flags = 64 (decimal) = 1000000 (binary).
With the first check it will look into SiberianTiger0063-00.anim. With the second one in SiberianTiger.m2.
Who's right, who's wrong..? It's crucial. Without knowing that one can't manipulate any WoW Model with .anim files, which is a great problem in my opinion.
EDIT: I think &0x30 is the good one

EDIT2: I check a couple models and this particular combination, Flag 64 and AnimID 63 (EmoteUseStanding) is buggy, and WoW Model Viewer haven't solved it. Try to view any character and look at this particular animation and you'll see what I'm talking about. I'm trying to find what I could do about it and what other combinations there could be...
It's like if 0063-00.anim was missing from every model.
So where are these data ? With WMV BC you can see perfectly the animation, but with WMV LK up to the last WoD beta version, you just can't. It seems to really be a .anim issue..
Fortunately there is an another anim with the same sequence, UseStandingLoop..


Bugged anims I found so far : EmoteUseStanding(63), EmoteUseStandingNoSheathe(138), EmoteSaluteNoSheathe(210),
EmoteEatNoSheathe(199), EmoteWorkNoSheathe(136)

That's interesting. There must be something that ties all these animations together. Tho, the fact that even the Model Viewer guys haven't found it yet is a bit scary.
« Last Edit: July 03, 2015, 10:22:36 pm by Admin »
Github ]https://github.com/Koward[/url]    Skype : koward723 =)

Makpptfox

  • Contributors
  • Loreweaver
  • *****
  • Posts: 103
    • View Profile
Re: [Questions] .anim files : How do they work ?
« Reply #6 on: July 03, 2015, 10:01:03 pm »
Quote from: "spik96"
Bugged anims I found so far : EmoteUseStanding(63), EmoteUseStandingNoSheathe(138), EmoteSaluteNoSheathe(210),
EmoteEatNoSheathe, EmoteWorkNoSheathe(136)

Was already looking for the reason behind these bugs. And didn't found anything using these animations in the game even in WoD. (Spells nor Emotes.)

Possibly just some test animations.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
For support, send your Discord's ID by PM.

spik96

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 275
    • View Profile
Re: [NOT solved at all] .anim files : How do they work ?
« Reply #7 on: July 03, 2015, 11:28:45 pm »
I think I found a way to identify the buggy animations. Their flag is always exactly 64.
I haven't found any counter example to this so far. If it's true, then even models WITH anim files giving data for the animations I mentioned before could be parsed if their flag is != 64.
Maybe 64 means "No data ready yet so don't look for them" or something like that.
On SiberianTiger I found there were data I couldn't find, and for a "normal" anim (EmoteWork), and I was confused. I checked the flag and saw 64, that's how I got the idea to check all of them.

I really hope I'm right. If I am I think it is worth to mention it on the wiki.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Github ]https://github.com/Koward[/url]    Skype : koward723 =)

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Possibly nearly solved] .anim files : How do they work
« Reply #8 on: July 04, 2015, 11:44:04 am »
animations with flag 0x40 are aliases. follow aliasNext to find the correct sequence, until flags no longer has 0x40.

apparently, there is a flag 0x100, which if set says the animation data is in model.

flag 0x10 appears to be set during runtime, if an .anim file is loaded

can you check some models for 0x100?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spik96

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 275
    • View Profile
Re: [Possibly nearly solved] .anim files : How do they work
« Reply #9 on: July 04, 2015, 03:20:14 pm »
Quote from: "schlumpf"
animations with flag 0x40 are aliases. follow aliasNext to find the correct sequence, until flags no longer has 0x40.

apparently, there is a flag 0x100, which if set says the animation data is in model.

flag 0x10 appears to be set during runtime, if an .anim file is loaded

can you check some models for 0x100?

It seems that you're right about 0x100. I haven't got any problem reading .anim files when checking for 0x130

My models look funny in MDLVis now as I don't read data the animations with &0x40 and just put n&ofs to 0, but the Animation Lookup will probably hide them to the client. A dozen animations fall under this check, it seems a lot to me but that's plausible.
It really makes me wonder, why do animations need alias when the animation lookup links animIDs with "physical" place ? Strange, strange, strange.

I have an another question. I think HD Character models sometimes use .anim file from the old, non HD, model. I guess there must also be a flag previously unused for that.
It's not just a "try to open model_hd0042-00.anim and if null try to open model0042-00.anim" because sometimes both files exist. I encountered this problem for :
TaurenFemale_HD.m2 (Anim #108, Flags 129)
OrcFemale_HD.m2 (Anim #39, Flags 129)
« Last Edit: July 04, 2015, 05:41:50 pm by Admin »
Github ]https://github.com/Koward[/url]    Skype : koward723 =)

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Research] .anim files : How do they work ?
« Reply #10 on: July 04, 2015, 05:30:28 pm »
if 0x100 is right, I claim that you don't have to check for anything but that. 0x20 will never be set due to preconditions in m2 export, and 0x10 will never ever be set.

I don't know why, but it is that way. Just iterate aliasNext until !(flags & 0x40).

No, that is not exactly possible due to having different number of bones and such. Also, I have not seen any code for that logic. The M2 loader does not know about the HD variant.

I would love to be proven wrong.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spik96

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 275
    • View Profile
Re: [Research] .anim files : How do they work ?
« Reply #11 on: July 04, 2015, 05:49:14 pm »
Thanks ! You cleaned up a lot of mess.
Quote from: "schlumpf"
if 0x100 is right, I claim that you don't have to check for anything but that. 0x20 will never be set due to preconditions in m2 export, and 0x10 will never ever be set.

I don't know why, but it is that way. Just iterate aliasNext until !(flags & 0x40).

No, that is not exactly possible due to having different number of bones and such. Also, I have not seen any code for that logic. The M2 loader does not know about the HD variant.

I would love to be proven wrong.
Things are easier then, perfect ! I guess the files I have must be wrong.
You should update the line "The client loads .anim files if (flags & 0x130 ) == 0" in the wiki.

About 0x40, so it parses the data in the animation, but from n&ofs found by following the aliasNext ? What a waste of space, loading twice the same values...

EDIT : I have an error in GnomeFemale_HD.m2 when I check 0x100 and not 0x130.
Anim#0, Flags 160 = 1010 0000. Due to the change, it consider it as external and tries to open a .anim file which doesn't exist.
Same with Setesh.m2, Flags 32 = 10 0000.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Github ]https://github.com/Koward[/url]    Skype : koward723 =)

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Research] .anim files : How do they work ?
« Reply #12 on: July 04, 2015, 06:17:00 pm »
While I'm pretty sure, I have not looked at any models to confirm my theories, so I didn't want to change it at this point.

I can only say for those with .anim files, I think. There, when tasked to load a sequence, it will skip all aliases and load the first one without 0x40. It does make sense: Animations have multiple sequences. It might share only one sequence but do other sequences the aliased-to-sequence's animation does not do (e.g. standing might randomly snort, which would be the same as an emote, still standing and that emote are not equivalent).

Hm, so maybe 0x20 is a relevant part. ._.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spik96

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 275
    • View Profile
Re: [Research] .anim files : How do they work ?
« Reply #13 on: July 04, 2015, 07:05:15 pm »
Quote from: "schlumpf"
While I'm pretty sure, I have not looked at any models to confirm my theories, so I didn't want to change it at this point.

I can only say for those with .anim files, I think. There, when tasked to load a sequence, it will skip all aliases and load the first one without 0x40. It does make sense: Animations have multiple sequences. It might share only one sequence but do other sequences the aliased-to-sequence's animation does not do (e.g. standing might randomly snort, which would be the same as an emote, still standing and that emote are not equivalent).

Why is 160 (0xA0) considered as external? why is 32 (0x20)?

Thanks, I couldn't understand what was the point of all this overhead.
160:
External if (flags & 0x100) == 0
(0 1010 0000 & 1 0000 0000) == 0
0 0000 0000 == 0

Same for 0x20.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Github ]https://github.com/Koward[/url]    Skype : koward723 =)

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Research] .anim files : How do they work ?
« Reply #14 on: July 04, 2015, 07:10:19 pm »
Just as you did, I edited that away. ;) See that new line. ;D
« Last Edit: January 01, 1970, 01:00:00 am by Admin »