Page 8 of 9
Re: Resident Evil animations
Posted: Fri Feb 24, 2017 7:27 pm
by Meguido
daemon1 wrote:Checked RE6 files. Unfortunately they are too much changed. They are not simple anymore, like it was in RE5.
So probably I will not be able to convert anything in near future.
Oh, that's a shame

But you still did a great job with RE5 so thank you very much.
Ps. I guess RE4's are even more different than 6's
Re: Resident Evil animations
Posted: Sat Feb 25, 2017 2:12 am
by Bastien
Hey daemon1, where do you get the locations from? I could get the rotations right thanks to PredatorCZ template and your tip about dividing by 4096.
Also, this data is not associated with a bind pose, right? I don't know how animations work in video games, but if you animate in a 3d software all rotations will be relative to the bind pose so mostly only rotations are needed.
My final goal is to be able to export animations back to the game, so I need to understand the format pretty well. Probably I have to start reading a lot about how game engines work.
Re: Resident Evil animations
Posted: Sat Feb 25, 2017 7:35 am
by daemon1
Meguido wrote:Ps. I guess RE4's are even more different than 6's
They are not "more" different, but probably simpler. Anyway, RE6 is still quite possible, but to do that I need to do more research and install the game myself. So maybe later. In addition to split body parts they have many compression types and arm IK-chains too (which I could expect).
Bastien wrote:Hey daemon1, where do you get the locations from? I could get the rotations right thanks to PredatorCZ template and your tip about dividing by 4096.
Also, this data is not associated with a bind pose, right? I don't know how animations work in video games, but if you animate in a 3d software all rotations will be relative to the bind pose so mostly only rotations are needed.
My final goal is to be able to export animations back to the game, so I need to understand the format pretty well. Probably I have to start reading a lot about how game engines work.
Locations are plain floats. There are only a few locations: root, origin, and toe locations (because they are IK drivers). I don't know how animations work in 3d software, but I don't think you need "reading a lot", because in games its all very simple. I'm not sure what do you mean by "associated with a bind pose", but if you give me some example, I can try explaining it.
Re: Resident Evil animations
Posted: Sat Feb 25, 2017 4:16 pm
by Bastien
daemon1 wrote:
RE6 is still quite possible, but to do that I need to do more research and install the game myself.
There's a
free benchmark/demo.
daemon1 wrote:
Locations are plain floats. There are only a few locations: root, origin, and toe locations (because they are IK drivers).
I was looking at id/figdata/fig01/fig01.lmt from fig01.arc. It's a static pose, and time 0 has all locations and no rotations. I can't seem to find where to get that info while parsing.
I know from PredatorCZ template that some keyframes are of type 'location', and those are the ones that change in time 1.
Code: Select all
<snip>
end
skeleton
time 0
0 0.000000 0.000000 0.000000 0 0 0
1 0.000000 114.000000 0.000000 0 0 0
2 0.000000 1.000004 -0.001327 0 0 0
3 0.000000 17.000000 -1.338673 0 0 0
4 -0.000002 24.000020 -2.100001 0 0 0
5 -0.000002 8.999998 1.100000 0 0 0
6 -2.839997 7.362676 9.415515 0 0 0
7 2.840005 7.362280 9.415408 0 0 0
<snip>
I think once I can reproduce the SMD output you get I can explain the 'bind pose' problem better.
Re: Resident Evil animations
Posted: Sat Feb 25, 2017 5:09 pm
by daemon1
Bastien wrote:I know from PredatorCZ template that some keyframes are of type 'location'
I'm not using templates, but there are no such thing as separate location keyframes. There are location tracks, each track may have many keyframes, and they all will be location keyframes.
The fig01.lmt file contains 3 location tracks: for root and 2 toes. And a lot of rotation tracks for all bones, including root and toes. Time 0 is the frame I'm using for initial pose which is taken completely from the model. It has all rotations as zero, because models in RE5 are all made that way.
Now at time 1 I'm combining first frames all of animation tracks that are present, leaving the missing bones in default position/rotation.
Re: Resident Evil animations
Posted: Sun Feb 26, 2017 2:48 am
by Bastien
daemon1 wrote:Time 0 is the frame I'm using for initial pose which is taken completely from the model.
Got it, thanks. I was able to reproduce your SMD output.
Now, the problem I'm trying to figure out is this:
The left is imported from SMD, the right is imported directly from the .mod + applying the pose.
* Same bone hierarchy, same rotations in all bones, however the pose is clearly wrong
* The skeleton from SMD has no 'bind pose', e.g. going to edit mode in the skeleton shows the bone all in the origin.
* The skeleton on the right has a bind pose, so the locations are not part of the pose
I have a feeling why this happens (different spaces in bones), but that's the part where I have to investigate a little more before posting conclusions. Any help is appreciated.
Re: Resident Evil animations
Posted: Sun Feb 26, 2017 5:05 pm
by daemon1
Bastien wrote:The skeleton from SMD has no 'bind pose'
Sorry, I don't understand what it means... Can't help.
Re: Resident Evil animations
Posted: Sun Feb 26, 2017 5:39 pm
by volfin
It's customary in a lot of animation formats that the first frame of the animation is the default pose the skeleton is in when not animated.
For example in the SMD spec it mentions (
https://developer.valvesoftware.com/wik ... a#Skeleton ) :
Position data for each bone in each animation frame. In a reference SMD there is only one frame, which contains the model's default posture.
This is called the rest pose by some, and seems 'bind pose' is a Maya term. Maya's description of "bind pose':
The bind pose is the pose that the skeleton is in when you bind skin. When you pose a character's skeleton after skinning, the skeleton's actions cause deformations to the skin. The only pose that does not cause deformations to the skin is the bind pose.
So basically the animation conversions may not have this initial rest/bind pose frame, but a lot of tools and formats expect it.
Re: Resident Evil animations
Posted: Sun Feb 26, 2017 6:33 pm
by daemon1
He's talking about something different. Because that SMD skeleton surely has bind pose in these terms.
Re: Resident Evil animations
Posted: Sun Feb 26, 2017 7:17 pm
by Meguido
daemon1 wrote:He's talking about something different. Because that SMD skeleton surely has bind pose in these terms.
Indeed every SMD skeleton imported from RE5 has a bind pose of one frame for every animation (inside the same SMD file). So yeah he's probably talking about something different.
Re: Resident Evil animations
Posted: Sun Feb 26, 2017 7:46 pm
by Bastien
Yes, SMD has a first frame defining the rest/bind pose. However, that's not how you'd animate in Blender, so there are some transformation to be applied if I want to be able to export animations back to the game.
I just realized I should read the code for exporting SMD. I'll post back when I have more info/a solution. Sorry for the noise.
A simpler question for daemon1 is: did you figure out all uknowns in the structure? That also will be necessary to export back animations.
Code: Select all
typedef struct
{
uint offset;
uint bonecount;
uint framecount;
uint unk;
float ufl;
float ufl;
float ufl;
uint unk;
uint unk;
uint unk;
uint unk;
float ufl;
uint unk;
uint unk;
// There's more here before seeking to the offset
}AniBlockHeader
Re: Resident Evil animations
Posted: Sun Feb 26, 2017 8:21 pm
by daemon1
There are 8 floats, for additional rotation and position for whole animation.
After that, 2 sets of notifications or "events". For sounds probably. Or something else too.
Each set is offset for notification track, count, and 32 event IDs. 32 because events are triggered by bits in 32-bit words, allowing up to 32 different events in every set. Events timing is usual, same as for animation tracks.
Re: Resident Evil animations
Posted: Sun Feb 26, 2017 9:11 pm
by volfin
Ok I get what he's talking about then. It's described here:
http://peyman-mass.blogspot.com/2013/09 ... acter.html
I'm not positive but I think you should just be able to use the correct skeleton and transfer the animation to it. That's what Blender's pose library is for.
Re: Resident Evil animations
Posted: Mon Mar 06, 2017 3:21 pm
by Meguido
Sorry to ask but,
Any progress on the research for RE6 @daemon1?
Re: Resident Evil animations
Posted: Mon Mar 06, 2017 5:26 pm
by daemon1
I'm not working on this anymore. Maybe i will return to it someday, but as I said, it will not be in near future.