본문 바로가기

유물/MDX/MDL

Armel - Animation transfers in mdl

원문: http://wc3campaigns.net/showthread.php?t=69135
함부로 긁어왔습니다.

Animation transfers in mdl


근데, 지금까지 난 이곳에서 실제 에니메이션 이동 튜토리얼을 찾지 못했다, 그리고, 이 기술이 직므은 꽤 퍼졌지만, 많은 사람이 아직까지 그것을 어떻게 하는지 모른다. 난 배우길 원하지만 아직 모르는 사람들을 위해 이것을 쓰니, 이제 mdl의 모든 신들이여 나를 용서하길.
그러나, 몇몇은 말할 것이다, 자동적으로 해주는 툴이 있지 않냐고. 맞다, 하지만 그것들은 약간의 문제가 있고 모든 모델에 작동하지 않는다. 그리고 어떻게 에니메이션 이동이 되는지 알고있다면 진보된 mdl 에디팅에 꽤 유용할 것이다.

필요한 것:
- Yogbul's file converter to convert mdx models to mdl and then back to mdx
- War3viewer (optionnal, but makes model testing way faster; yet it doesn't always view models the same as wc3, world edit is the ultimate model testing program)
- notepad
- Oinkerwinkle's key redistributer program

이 튜토리얼에서, 우리는 풋맨의 walk 에니메이션을 휴먼 peasant 에 추가할 것이다. 우선, Yogbul's file converter 를 이용해, 두 모델을 mdl 로 변환한다. 풋맨의 mdl을 열고 "sequences"(모델의 에니메이션의 리스트)로 간다. walk 에니메이션 부분을 복사한다.

그리고 peasant의 에니메이션 리스트 끝에 그것을 더한다:

(보통, 모델에서 이벤트가 발생할 때, 말하기 위해 사용하는  숫자를 나는 "key"(하지만 다른 말로 "frame"이라고새악한다)라고 부른다. 에니메이션들은 창작된 특정 에니메이션의 서브 에니메이션으로 생각될 수 있다, 그것들은 이 큰 에니메이션에서 그들이 발생하는 순서대로 리스트되어 있다, 그들이 리스트된 sequences구역에 각 에니메이션의 interval 은 두개의 "keys"로 이뤄졌고 각 에니메이션이 시작되고 끝나는 순간과 대응한다. 우리는 나중에 이 "keys"들이 boen, geosetanim, particle emitter 글고 eventobject 매개변수에서 사용되는 것을 볼수 있을 것이다)

Once this is done, modify the added animation's keys so that they are set after the peasant's former last animation (here we'll replace { 200000, 201100 } with { 20000, 21100 } for instance, ie we'll add 180000).

Now for the boring part: open Oinkerwinkle's Key Redistributer tool. Set the beginning and end keys of the input to 20000 and 21100 and the beginning and end keys of the output to 200000 and 201100. Go to the second bone (the first one is the corpse's bone, it is not animated) of the peasant and find the corresponding bone in the footman's mdl (the one that has almost the same name). You'll see a list of animation parameters called translations or rotations (bones usually have rotations, sometimes they have translations, and rarely they can have scalings; some bones have no animation parameters at all). Each of these parameters is placed after a number, which is the key at which this parameter will be used, so all the parameters of an animation use keys that belong to the interval of the animation that will use them.
Copy the translations between 20000 and 21100, paste them in the input and click "Redistribute". Then paste them after the last translation of the corresponding bone in the peasant's model. Do the same for rotations and scalings for each bone.
Make sure not to add a rotation to a translation list, it will cause a bug. Rotations must go with rotations and translations with translations.


NB:
- Some bones have no equivalent between two models, they are usually useless. However, you might have sometimes to reanimate them (eg: when transfering an animation from a unit without a cape to a unit with a cape) using the same method except that you'll take the animation parameters from another animation of the model (so if I add a walk defend anim from a capeless model to a model with a cape, I can reanimate the cape for this anim using the animation parameters of the walk anim of the model that has a cape).
- Many blizzard models use dummy bones associated with helpers (it's the case of the footman but not the peasant). So in fact when I speak of bones here it can be either bones or helpers. When you see that an important bone (root, head, foot, leg, pelvis, chest, arm, hand) has no animation parameters, look for its parent, it will probably be an animated helper. The best way to do anim transfer for models can be to look for all the important bones one by one and do the anim transfer for each of these, then look at the model and see if some bones don't need to be reanimated.
- Sometimes a model's bones have names that don't mean anything. In that case, you'll have to guess which bone is what using Oinkerwinkle's vertex modify program, but it's already a quite complicated tutorial so I won't explain this here.
- Depending on the way each bone uses its animation parameters (hermite, bezier or linear), there might be some graphical issues (luckily almost all bones use hermite). I don't know how to solve them, except that if you want to transfer from a bone using either hermite or bezier to one using linear parameters (no InTan or OutTan parameters) you can do the transfer then delete the InTan and OutTan for each of the transfered parameters of this bone, it should work.
- Before the Sequences list and, for each bone, before the translation, rotation or scaling sections, there is a number counting respectively the number of animations of the model and the number of translation, rotation or scaling parameters of the bone. Once you transfer anims these numbers will need to be fixed. Yet, not fixing them will not create a bug, at least not for War3viewer and WarcraftIII, so fixing them is useless. I don't know however if 3dsMax requires them to be fixed.
- When editing an mdl, be very careful to the syntax, it's really easy to make mistakes.
- You might want to fix the geosetanims, particle emitters and eventobjects to determine when they are visible (especially for total animation transfers, when all of a unit's anims are replaced by another one's anims), or they will appear at the wrong times (for instance you could hear the death sound while the unit is just walking peacefully). These sections usually have a list named "visibility" listing the keys to which they will be visible, 1 meaning visible and 0 invisible.
Use Key Redistributer to fix these visibility parameters.
- Animation transfer may look weird for models that have a very different scale of shape (like a Druid of the Claw and a priest).

I hope I didn't make it too detailed or confusing. Special thanks to Oinkerwinkle who helped me understand how animations work when I was trying to find out all alone.

Last edited by Armel : 12-12-2004 at 06:34 AM.