• Welcome to Freedom Reborn Archive.
 

copying animations using nifscope

Started by seraglio, March 06, 2007, 05:15:34 PM

Previous topic - Next topic

seraglio

Hi all. I've read all the articles on copying animations using nifscope, my question is a little different.

I've been using a hex editor to copy animations for a long time. The method is use does the following:

QuoteCopy from the first NiKeyframeDat{a} in the animation to {N}iSequenceStreamHelper of the next animation sequence and past it instead of the same block in the animation you wish, to replace the whole animation.

I notice with the nifscope method the instructions say to copy the whole branch, rather than just nikeyframedata. I'm wondering if anyone knows whether theres an advantage in terms of compatibility?

I've been dissapointed sometimes because the hexxing method doesn't always work. In fact, it works for me only about 1/3 of the time. Even when both the donor and recipient keyframe sets perfectly animate the mesh, you can see sometimes in the hex code the pattern of text is just different; some blocks begin and end with @ symbols, the other anim with $ and sure enough when the cut and paste is completed the new keyframes dont work. But if the nikeyframedata 'looks' the same, it always works.

has anyone ever used nifscope to copy otherwise compatible anims and it DIDNT work? If so I'm curious what the advantage over the old fashioned method (which incidentilly wont take 12 hours=) )is. I'll post the method I use below for those who dont know. I cant recall who posted it originally but thanks to that person::


Swapping Keyrames
You can swap between most compatible KFs. More parts in mesh= more NiKeyframeData's (ex. in venom hexed mesh there are 34 NiKeyframeData's per animation, NiKeyframeData11 and sometimes NiKeyframeData1 as well are the rope NiKeyframeData's). Each NiKeyframeData is a joint in the body or a body part. Its possible to change animation by importing NiKeyframeData of the same joint from different animation in compatible keyframes. This is the mapped male_basic kf with 31 NiKeyframeData's:

1. ???

Right side:
2. Foot
3. Foot/Calf
4. Calf/Thigh
5. Leg/Body

Left side:
6. Foot
7. Foot/Calf
8. Calf/Thigh
9. Leg/Body

Right side:
10. Low Fingers/High Fingers
11. Fingers/Hand
12. Low Thumb/High Thumb
13. Thumb/Hand
14. Hand/Forearm
15. Forearm/Upper Arm
16. Arm/Shoulder
17. Shoulder/Body

Left side:
18. Low Fingers/High Fingers
19. Fingers/Hand
20. Low Thumb/High Thumb
21. Thumb/Hand
22. Hand/Forearm
23. Forearm/Upper Arm
24. Arm/Shoulder
25. Shoulder/Body

26. Neck
27. Shoulders+Neck/Body
28. Upper Body/Lower Body
29. Spine/Body
30. Body angle in space
31. Body/Space




Copy from the first NiKeyframeDat{a} in the animation to {N}iSequenceStreamHelper of the next animation sequence and past it instead of the same block in the animation you wish, to replace the whole animation.
Dont forget to remove this block in the animation you are pasting to.

Every animation (ex. idle) is built like so:

NiSequenceStreamHelper
NiTextKeyExtraData
NiStringExtraData (n number; dont change position)
...
NiKeyframeController (n number; dont change position; Bombadil found a way to make repeat animations - by exchanging xx in 5th column after each NKC to 5th column's xx of other repeat animation)
...
NiKeyframeData (animation itself; n=31 in male_basic; thats what you should be copy/pasting)
...
NiSequenceStreamHelper (next animation sequence)



The number after NiKeyframeData is the number of movements. The number of movements in NiKeyframeData of the body (the last in the sequence) is the most important as it limits the number of movements overall. So if you want long animation make sure that number of movements in the NiKeyframeData of the body(31) is high. In fact the last NiKeyframeData determines the actual time of the animation sequence (dont make it to long in combat animation though). Although the NKD28 or 29 may have bigger number of maximum moves than 31 in which case 28 or 29 determine the time and the maximum limit instead of 31 (this one is a speculation but i have seen examples- idle male_basic).

There are two segments in every NiKeyframeData:

First segment- 5 parts per movement:

0n000000[number of moves] 01000000
1) 00000000 xxxx xxxx xxxx xxxx
...
n) xxxx xxxx xxxx xxxx xxxx

Second segment- 4 parts per move:

0n000000[number of moves] 01000000
1) 00000000 xxxx[left or right of position for the body, 35=position 0 for NKD31? 40+=left C0+=right] xxxx[back or forward of position for the body, 35=normal for NKD31? 40+=back C0+=forward] xxxx[altitude for the body, elongation for other parts for ex. if Forearm points forward the Hand will elongate forward or backward, 41=normal for NKD31 ! 40=low 42=high]
...
n) xxxx xxxx xxxx xxxx

Parts seem to change functions depending on the body part. For example: I created Mr. Fantastic's dodge by changing middle 6 of the 8 left/right moves in NKD 28 from 40 to 41. The effect looks good, but instead of left/right movement the upper body moves up. So most of the time to locate elongation for the part you should look for parts that end with 40s-42s in the second segment of the NKD. If adjustments done in joints/body parts other than the whole body NKD it creates various distortions. x=two hex digits (ex. FF), each part=4 x's.