Difference between revisions of "Importing Animations from Blender"

no edit summary
imported>Breeze582000
imported>Breeze582000
Line 39: Line 39:
If you press the play button in the window containing test.nif, you will see the model being animated.
If you press the play button in the window containing test.nif, you will see the model being animated.


== Conclusions ==
'''Note:''' for this example, keep the time range to 1.3 seconds as this is the duration of the cast self animation.
 
=== Blender .nif File ===
Examining test.nif will show that the animations are bound to the individual bones using NiKeyframeController blocks. So if you animated the left upper arm, navigating down the tree to test->Scene Root->Bip01->Bip01 NonAccum->Bip01 Pelvis->Bip01 Spine->Bip01 Spine1->Bip01 Spine2->Bip01 Neck->Bip01 L Clavicle->Bip01 L UpperArm you will see a NiKeyframeController block that contains the animation information for the left upper arm.
 
'''Very important''' is the NiKeyframeData block beneath the NiKeyframeController block. This block contains the animation keys and is the block that will be extracted.
 
Select the NiKeyframeData block for the left upper arm and copy it. Paste it in the castself.kf file. It will be added to the end of the list of blocks and is not yet connected to the animation.
 
=== Existing .kf File ===
The castself.kf file has a NiControllerSequence block that contains controller sequences. A number of NiTransformInterpolator blocks attached to NiTransformData blocks are in this file (one per animated bone). The NiTransformData block contains the actual animation keys (and the exact same structure as NiKeyframeData blocks. We need to replace the existing Data block with the one containing the new animation.
 
To do this:
* click on the root NiControllerSequence block
* in this block, scroll down to the field called '''Controlled Blocks'''
* open this field and scroll down to the controlled block called "Bip01 L UpperArm"
* open it and scroll down to the field called "Interpolator"
* right click on the value and choose "follow link". This will take you to the correct interpolator for the left upper arm (there are LOTS, so it's easy to make a mistake in selection)
* in the selected interpolator, change the value in the data field to the number of the NiKeyframeData block you pasted earlier. This should unlink the old data block and link the new one.
* double click on the name of the NiKeyframeData and rename it to NiTransformData
* select the old NiTransformData block and delete it
 
You now have a correctly set up .kf file. Save it. Ignore the "error message" about "unassigned parent link", it doesn't matter. You can use the attach .kf spell to see that the animation does work.
 
Start up Oblivion, cast a self self and the animation should have been changed so that, in addition to the normal cast self animation, the player lifts his/her left upper arm as well.
 
'''Note:''' if the animation duration is longer than the one in the .kf file, simply select the NiControllerSequence block and change the value of the "Stop Time" field.
 
== Conclusion ==
Well, now we can change animations using Blender. Creating entirely new creatures and animations using Blender should not be too far off... It certainly appears doable.
 
Hope some people found this useful.
- Breeze582000


[[Category:Tutorials]]
[[Category:Tutorials]]
Anonymous user