Avoiding Blender animation pitfalls

From Nexus Mods Wiki
Revision as of 23:44, 18 January 2011 by Fore (talk | contribs) (Added pic for NifSkope Copy/Paste)
Jump to: navigation, search

Overview

Have you ever wondered why there are thousands of great looking outfit mods in Oblivion, but only a handful of good user made animation packages? Try to make one with Blender, and feel the frustration of running into one problem after the other. It's even more frustrating, when you don't find any reasonable documentation covering even the most nagging problems. That's why I started to collect my experience from 6 months of animation modification. Better than nothing, i hope.

This is NOT a step by step introduction. It is expected that you have base knowledge of Blender and NifSkope.

Required tools

First Aid for frequent problems

This FAQ briefly covers possible problems. For a more detailed description please refer to the denoted section.

I don't know where to start with animations

(6a) My animation does not show up in game

  • Is your kf file in the correct directory?
  • Is the "AnimGroup" set correct?

(4a, 7d) The animation I have imported into Blender looks weird / is incomplete

  • Check if the original kf uses splines or other unsupported features. You can use CopyPaste.

(7b) My character is turned sideways

  • Fix the 90° Problem "easy"

(7c) I have used the "90° Fix", but my character is still turned sideways

  • Fix the 90° Problem "the hard way"

(5a) Why do I have to do the 90° Fix "the hard way"?

  • Most likely you played around with BIP01 and BIP01NonAccum z Rotation

(7a) My animation only runs once and stops

  • You probably forgot to set CYCLE_LOOP

(5c) I get CTD or game freeze when my animation runs

  • Check all keyframes for completeness

(5d) All bones are badly twisted after my animation has finished

  • Set the "End Text Key" correctly

(5b) My imported anim moves the wrong direction in Blender. Can I change it?

  • You could, but you should keep it that way (it will be fine after export again)

(5e) I see "spikes to infinity" coming out of the forearm in Blender

  • This can be fixed by changing the infected bone's transform properties

(5g) My anim works, but some of the bones are not acting as defined

  • Check bone priorities

(5f) Can I change the animation speed by changing "frames/sec"

  • This is not working for 3rd person view. But there is a work-around.

Pre-import check with NifSkope

If you want to make anims, you HAVE to know how to work with Working With Nifs 101 : An Introduction. If you don't, you can't make any anims.


(4a) - Open your original kf file with NifSkope and look for the following data:

  • Type of Anim in '0 NiControllerSequence' (needed for export)
  • Cycle Type in '0 NiControllerSequence' → Block Details (needed for tweaking)
  • 'BIP01 NonAccum' Rotation (Euler R - needed for tweaking)


(4b) - Check if the Block List contains record types other than (only these recordtypes are fully supported by Blender):

  • NiControllerSequence
  • NiTransformInterpolator
  • NiTransformData
  • NiStringPalette
  • NiKeyTextExtraData

If you you find

  • NiBSplineCompTransformInterpolator

Blender will convert them into NiTransformInterpolators, but will make all rotations about twice as large as they are in-game, which can look VERY weird.

Some other record types are simply ignored ((without warning!): e.g.

  • NiFloatInterpolator, and NiFloatData

Work-around: Change the (partial) animation, but later copy your changes into an original file (see 7d - Copy/Paste your Bone Movement Data)

Tips for Modifying Animations in Blender

(5a) - Keep BIP01 and Bip01 NonAccum z Rotation: don't ever change Rot-z on BIP01and BIP01NonAccum, if not absolutely necessary. Every change can drastically increase the work necessary for tweaking afterwards


(5b) - Don't change „wrong“ direction for Imported Moving Animations (e.g. walk): Moving animation (like forward.kf) ALL go to the wrong side in Blender (forward -> right, right -> back, back -> left, left -> forward. See How Fix Your Animation FAQ for details. But unlike described there: NEVER change the movement direction in Blender before you export!

If you want to view the result of your work in Blender without being distracted by this strange sideway move, then

  • save the .blend file
  • change BIP01 z-Rot by 90
  • rotate the Blender view by 90°
  • BUT NEVER SAVE THIS as .blend (only under a temporary file)
  • view the animation in Blender
  • re-load the (un-rotated) .blend file to continue work

If you save the z-Rot change (and even if you revert the rotation again), it can be that you need to do the Fix the 90° Problem "the hard way".


(5c) – Define all necessary keyframes: make sure that each animated bone has the following keys defined

  • keyframe for first frame (frame 1)
  • keyframe for last frame, if the bone has more than 1 keyframe defined
  • NO keyframe is defined after the last frame (I have seen anims breaking this rule, but I strongly believe that this may cause instabilities)

If you forget first/last keyframe you will get CTDs, freezes and other bad reactions.


(5d) – Define correct start/end text keys: make sure you have the following text keys defined in the Blender Text Editor

  • 1/start (for frame 1)
  • <n>/end (for the last frame <n>)
  • Don't try to change the corresponding NiTextKeyExtraData in the kf file with NifScope. There is a good chance to make mistakes. And every mistake will result your anim causing TWISTED BONES.

There is only one exception: changing animation speed according to (5f) – Don't change Frames/sec.
See Animation Text Keys for more information about these text keys (like sound, anim synchronisation and more)


(5e) – Remove „spikes to infinity“ (in Blender and in-game): some kf files cause „spikes to infinity“ in Blender, and later in-game, if you try to re-export them. This is NOT the „breast to infinity“ effect BBB (Better Bouncing Breasts) user might experience. Mostly these spikes come from the ForeArmTwist bones and are caused by „strange“ constants <float_min> or <float_max> in the bone's LocRot. These values are defined with 3DS Max, and are badly imported into Blender.
Go to the affected bones Transformation Properties and set these values to 0


(5f) – Don't change "Frames/sec" (if you don't understand the background): if, for example, you change fps on walks in 3rd person view, you will see no effect for this animation in-game, but all of the sudden the speed is different in 1st person view. I HAVE NO IDEA HOW THIS WORKS TOGETHER. The only working way to change animation speed is a NifSkope tweak described in Sephs Hand to Hand Animation Replacer „Battle Constructor“ Read me.doc


(5g) – Set Bone Priorities wisely: set bone priorities according to the relevance of specific bones for your animation. But do it wisely, and DON'T CHANGE BONE PRIORITIES IN STANDARD ANIMATIONS (unless you know what you're doing, of course). In many game situations usually two or more anims are „overlayed“, and the bones with highest priority win.
As an example: if you define breast bone priorities for BBB, and the breast priorities are high in the (standard) idle and low in the horseback riding, you will see the idle movement (if any), and not the moves defined in the riding anim (that actually happened to me)

Export Animation

<PICTURE>
(6a) – Set the correct AnimGroup/SpecialIdle in the „Anim Seq Name“ field: the name can be one of the following

  • SpecialIdle_<xxx>
    This anim goes into the _male\idleanims directory, and is activated by a CS Idle Animation
  • <AnimGroup>
    This anim goes into _male (for ALL humans) or _male\ specialanims (for specific humans, activated in CS)
    <AnimGroup> is one out of 43 hardcoded names, see CS Wiki AnimGroups
  • <AnimGroup>_<alt>
    Alternative animations (like recoil_01, recoil_02). The game engine will randomly use one of these anims


(6b) – Don't press "Ignore Blender AnimProps" (and don't allow the system to use default priority 26): you wanted to set bone priorities wisely, didn't you?

Post-Export tweaking with NifSkope

<PICTURE>
(7a) – Set Cycle_Type: Blender will alway set the Cyle Type (in NiControllerSequence → Block Details) to "Cycle_Clamp" (what a strange word for a one-time animation). For ALL looping animations (like idle, forward, backward, jumploop, …) you HAVE to change it here to CYCLE_LOOP.


(7b) - Fix the 90° Problem "easy": In-game your character will (almost) always turn to the side, in most cases 90° to its right. This can't be fixed with Blender, but with NifSkope. In most cases its enough to

  • change BIP01 Rotation (Euler R) to 0
  • change BIP01 NonAccum Rotation
    • to 90, if BIP01 NonAccum Rotation is 0 in the original file
    • to <value>, if BIP01 NonAccum Rotation has a <value> unequal to 0 in the original file

The same procedure with a little more detail:

  • open .kf with nifskope
  • in Block List press '0 NiControllerSequence'
  • in Block Details open 'Controlled Blocks'
  • find entry for BIP01 and open
  • find 'Interpolator' value
  • in Block List find record with this (Interpolator value) number and press
  • in Block Details go to line 'Rotation Quaternion' and click the 'Y' area and then the 'Axis' button, until you see the 'EULER' button.
  • change R to 0 (if it is different (90))
  • DO THE SAME WITH 'BIP01 NonAccum' and change to 90
  • Save As


(7c) - Fix the 90° Problem "the hard way": Sometimes the "easy" way doesn't work. This seems to be the case, when the anim is made from scratch, or when the imported anim was rotated on the BIP01 (and that's why I NEVER do this). There is still a solution to fix this problem. I succeded twice, and another Nexus user has confirmed it's usefulness:

  • change BIP01 Rotation (Euler R) to 0
  • in the BIP01 NonAccum NiTransfomData (subrecord to NiTransformInterpolator) change the "Quaternion Keys Value" Rotation for EVERY quaternion key to 90, or to it's original value.

It's a pain in the neck, but will teach you not to touch BIP01 Rotation next time ;-)


(7d) - Copy/Paste your Bone Movement Data: If you cannot import/export the complete .kf (because of over-twisted splines, or other unsupported Nif records), you can still modify the (incomplete) import, export it, and copy/paste the added/modified bone data (for breast, arms, or whatever) with NifSkope into the original .kf:

  • Find and 'Copy Branch' the added/modified NiTransformInterpolator from the new .kf
  • 'Paste Branch' the copied NiTransformInterpolator into the original .kf
  • Add the appropriate number of new entries in the NiControllerSequence → Controlled blocks (or use the existing entries, if you have modified existing bones)
  • Enter 'Interpolator' (=number of the copied record), 'Priority', 'String Palette' (=2 or 3), and 'Controller Type Offset' (=NiTransformController) for each entry.


The same procedure with a little more detail (if this is not detailed enough, read Working With Nifs 101 : Copy and Paste):

  • Open 2 NifSkope instances: one for the new (modified) .kf, one for (a copy of) the original .kf
  • Goto new .kf, click on '0 NiControllerSequence'
  • goto the Block Details, and open Controlled Blocks
  • For each added/modified bone:
    • Find the record number for this bone (the record number is the number in the 'Interpolator Ref<NiInterpolator>' line for this bone)
    • Find this record in the Block List, click, RMB, Block → Copy Branch
    • Goto original .kf, Click into Block List, RMB, Block → Paste Branch
    • Click on (original) '0 NiControllerSequence', goto the Block Details
    • Increase 'Num Controlled Blocks' by one (only, if you added a bone)
    • Press the 2 arrows in the 'Controlled Blocks' line (to create the new entry you have just defined)
    • Open the 'Controlled Blocks', and go to the last entry which is <empty> (or go to the entry for that bone, if you only modify an existing bone)
    • Open this 'Controlled Blocks' entry and edit the following parameters:
      • 'Controller': record number of the NiTransformInterpolator you just pasted into the Block List
      • 'Priority': Appropriate value, see Bone Priorities
      • 'String Palette': record number of the .kfs 'NiStringPalette' in the Block List (usually 2 or 3)
      • 'Node Name Offset': Press 'Txt'. This opens a selection and inputbox. Enter the EXACT nameof the bone (only, if you added a bone)
      • 'Controller Type Offset': Press 'Txt'. Select 'NiTransformController' (only, if you added a bone)
  • Do this for all added/modified bones. Once you are familiar with the procedure it's easies and faster to group these actions. But this way it's easier to understand
  • Save your new animation file

NifSkope CopyPaste1.jpg

References