HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help ! anim transfer

05-19-2004, 09:55 AM#1
Armel
I might be a noob, but I'm trying to improve. I had asked Iceknight for a geoset merge of the captain with Arthas' cape, and he did it for me (thanx again Ice). Yet the added geoset was of course not animated, so I tried to give the cape the animations of Arthas' cape. Yet now the model's cape has still no animations.
Here is what I did :
1. I copied all the cape's bones from Arthas in a new file.
2. I made a list of all the animations of Arthas and the captain, like this :

Arthas
Stand-1_______________3333=>6667_______3334
Stand first_____________10000=>16667_____6667
...

Same for each animation. Same for the captain's model :

captain
Stand-1_______________167=>1667________1500
Stand-2_______________1833=>4333_______2500
...

The first number is where the animation starts, the second one where it ends, the third is the difference between the two first.
3. I then chose for each animation of the captain which animation of Arthas' cape should be played. Here is the list :

captain__________Arthas
stand-1__________stand-1,
stand-2__________stand first,
stand victory______stand victory,
stand-4__________stand victory,
attack-1_________attack-2
attack-2_________attack-1
walk_____________walk
stand defend______stand ready
walk defend_______stand victory
death____________death
decay flesh_______NONE
attack defend_____attack-1
decay bone_______NONE

4. I then rewrote each bone in its entirety using the following method :
For each animation of the captain, in the right order, I copied the data in the corresponding bone in Artha's model that belonged to the corresponding animation. So if I wanted to create a bone's animation for the attack defend animation, I'd copy the part that corresponds to attack-1 in Arthas' corresponding bone.
I then rewrote each key using the following formula :
if the captain's animation I'm working on begins with A and ends with B, and Arthas' corresponding animation with C and D, and if the key I'm editing is E ( E belongs to {C,D} ), then I'll replace E with :
((E-C)/(D-C))*(B-A)+A
What I'm doing here is an homothety from {A,B} to {C,D}.

I did it for rotations and translations. Once this was done, since the numbers of rotations and translations had changed, I fixed them.

5. After this, I pasted the bones in the captain_with_cape model, made sure to edit the objectIds and parents, and I copied the pivotpoints to the right place. I also made sure to edit the bones I had pasted. They were in the beginning referring to the geosetId 0 in Arthas (the one with the cape), so I changed the geosetId to 5 (the cape geoset in my edited model). I saved the model, converted to mdx, but there is absolutely no change, the cape is still not moving.



It was the hugest mdl edit I ever tried, took me hours, all that for nothing. I knew what the risks where, I knew it was foolish to try without further information, but I wanted so much to understand all this (just for the mere pleasure of solving a problem), and each time I asked I got answers like : "we found all alone how it works, find it alone too to prove you are worth being told". I must not be worth it, but I tried at least to understand alone, and if someone could tell me what's wrong I'd be glad.
(I think the problem might be that there is a problem of scale between the two models, Arthas and the captain, so if IceKnight had to make the pasted geoset smaller the bones and pivotpoints would not match it anymore. Only a guess, since I don't really know how this works, I only half-understand.)
05-19-2004, 07:11 PM#2
Oinkerwinkle
What exactly didn't work about it? Did the MDL not convert to MDX or did the cape not move correctly?

I've never tried something that ambitous myself, but it looks like you have a very good idea of what you're doing. I don't see anything wrong with your process, but there are some things that you didn't mention: Did you actually make the cape follow the bones? That would cause the bones to be moving just fine, but the cape would be unaffected. If you didn't do that, say so and I'll explain how to get that part working.
05-20-2004, 01:47 AM#3
Armel
What didn't work is that the mdl converted normally to mdx but the cape was still moving as if it was in "one block", without bones, in fact as if I had done nothing.
Thanks :D , you must be right, I don't know how to make the cape follow the bones, in fact I wondered why there was not some more visible connection between bones and the corresponding geoset. If you could explain me how to do this it'd be fine.
05-20-2004, 03:43 AM#4
Armel
OK, I think I see what you mean. I forgot to add the matrices under groups in the geoset info (I also at the same time solved minor bugs I had not found previously). Still there is a problem : I copied all the matrices that were referencing to at least one of the cape's bones in Arthas model (where the cape is only a part of the main geoset, whereas in the model Ice knight created it is a new geoset), pasted them in my model, fixed the objectId's, number of matrices and bones, and almost nothing happened. The cape is just moving a little differently, but that's not really obvious. Should I copy other matrices too ?
N.B.: some matrices were refering to bones of the cape and to other bones, I also copied them and fixed the Id's. But there might be a problem here : the bones refered to here were bone_chest and the upper arm bones, which are not bones but helpers in the captain. Does it make any difference ? (what is the difference between helpers and bones actually ?)

Other bug : I added a geosetanim to the cape geoset so as to solve a bug that makes the cape stand right over the bones in the decay bones anim, but this geoset anim seems to have no effect : when I tell the geoset to be invisible, it stays perfectly visible.

Other problem, perhaps the most serious one : the mdx works in War3Viewer, but it crashes the editor (both versions, the one with matrices added and the one without). In fact, even IceKnight's geoset merge is crashing the editor (why didn't I check this before ?), so it seems the problem is not related with what I did !

Thanx for help and sorry if there are too many questions at a time.

(Here is the MDL, just in case...)
05-20-2004, 08:57 AM#5
Oinkerwinkle
The original geoset merge not working in-game is not something I know how to fix. However, I can redo the merge, or parts of it, when I have more time (which should be in about 8 hours). Anyway, good job on the matrices section. Matrices set up the groups of bones that affect vertices. When you see { 41, 25, 44 }, it means that it will be affected by cape bone one, the chest, and one of the left shoulder. That's not all you need to do, though. You also have to link individual vertices to those groups. That is does in the TVertices section of the geoset. The number simply cooresponds with the group. As far as I can tell, the cape is divided into the levels in the attached picture. I didn't use all the matrices you set up; I just used #0, 1, 2, 6, 7, 10, and 12. 0, 1, and 2 are for the top (I just checked the cooresponding vertex's z). 6, 7, 10, and 12 have their own levels.

To clarify (hopefully), I started by copying the vertices to a new section and identifying the levels. Then I marked each vertex with the matrix number.

Vertices 32 {
{ -8.17947, -0.126204, 82.6378 }, //top
{ -10.4189, -13.4442, 69.1122 },
{ -9.02974, -9.9385, 80.1702 }, //top
{ -11.1458, -0.429726, 65.437 }, //6
{ -10.6551, 13.8753, 63.6344 }, //6
{ -9.53947, 10.2982, 80.8352 }, //top
{ -10.1473, 15.6474, 47.6589 },
{ -11.5043, -0.209858, 49.4615 },
{ -11.1458, -0.429726, 65.437 }, //6
{ -9.63753, -16.1043, 54.9755 },
{ -10.4189, -13.4442, 69.1122 }, //6
{ -10.6551, 13.8753, 63.6344 }, //6
{ -9.74301, -18.4648, 36.5091 }, //10
{ -11.5043, -0.209858, 49.4615 },
{ -13.345, -0.226195, 33.1543 },//10
{ -9.63753, -16.1043, 54.9755 },
{ -13.345, -0.226195, 33.1543 }, //10
{ -13.9521, -0.356779, 6.17756 }, //12
{ -9.74301, -18.4648, 36.5091 },//10
{ -8.79478, -21.2569, 6.32321 },//12
{ -9.74301, -18.4648, 36.5091 }, //10
{ -13.9521, -0.356779, 6.17756 },//12
{ -10.2527, 18.9245, 23.8163 },//10
{ -13.345, -0.226195, 33.1543 }, //10
{ -11.5043, -0.209858, 49.4615 },
{ -10.1473, 15.6474, 47.6589 },
{ -10.2527, 18.9245, 23.8163 }, //10
{ -13.9521, -0.356779, 6.17756 }, //12
{ -13.345, -0.226195, 33.1543 }, //10
{ -13.9521, -0.356779, 6.17756 }, //12
{ -10.2527, 18.9245, 23.8163 }, //10
{ -9.30443, 21.8473, 3.60392 }, //12
}

Blanks are 7s; I just didn't want to do extra marking.
Finally, I changed the TVertices and got the following.
05-20-2004, 09:19 AM#6
Armel
Thanks a lot Oinker, I just checked in War3Viewer and ... it works. However, the model is still crashing WorlEdit, so if you could redo the merging it would be more than perfect. I would redo all the mdl modifications myself, now I think I should be able to do it on my own.
My debt to you is already great : not only have you helped me here, but already in the past, and you have explained me a lot of things about the inner structure of an mdl file. For all this, I thank you (I won't however sacrifice a victim to you like what a guy did somewhere else on the forums, cause my faith doesn't allow me to do so, sorry).
05-20-2004, 06:50 PM#7
Oinkerwinkle
I think I got everything this time around.

First, I fixed it not working in-game. I was able to actually find the mistake so there's no need to start over.

Code:
    Material {
        Layer {
            FilterMode None,
            Unshaded,
            [u]TwoSided,[/u]
            static TextureID [u]4[/u],
        }
        Layer {
            FilterMode Blend,
            [u]TwoSided,[/u]
            static TextureID 3,
            }
    }
Whoever merged this messed up in the textures. They pointed to TextureID 4 (which would be the fifth texture), but only had four textures. This is the team color layer, and I just added it and it worked. He also didn't make the material TwoSided, so it could have only been seen from one direction.

Next, I worked on the GeosetAnims. Did you put a new one there? I changed it to the following. You might want to compare that to what you had/there was. Basically, I put 1 at all the start frames for the animations it should show during and 0 at all the start frames for those that I didn't want it to show during.
Code:
GeosetAnim {
    Alpha 14 {
        DontInterp,
        167: 1,
        1833: 1,
        4500: 1,
        7000: 1,
        12500: 1,
        13667: 1,
        17667: 1,
        18833: 1,
        20000: 1,
        21333: 1,
        25000: 1,
        92200: 1,
        159967: 0,
        219967: 0,
    }
    GeosetId 5,
}

Next, I fixed the matrices. You were pointing to helpers instead of bones. I didn't actually remember that that was a problem until now, sorry. Anyway, to fix it, I just searched for "Parent (theHelperNumber)" until I found a bone. I checked to make sure it was the right thing by checking in existing matrices sections for its presense.

Finally, I changed the GeosetAnimId of all the cape bones to 5 from none.

There wa probably something else that I did, but I can't remember it at the moment. Say if you have any more problems and I'll see if I can help.