Difference between revisions of "Basic Animation Tutorial"

Jump to navigation Jump to search
11,436 bytes added ,  03:47, 18 April 2007
revert
imported>CtiKfa
m
imported>Entim
(revert)
Line 68: Line 68:
*[[#Creating a Texture Transform Controller animation|Texture Transform Controller]]
*[[#Creating a Texture Transform Controller animation|Texture Transform Controller]]
|}
|}
<blockquote>'''Note''': Attaching is done via selecting ''Spells'' -> ''Animation'' -> ''Attach .KF'' in [[NifSkope]] - you'll need at least version [http://sourceforge.net/project/showfiles.php?group_id=149157
<blockquote>'''Note''': Attaching is done via selecting ''Spells'' -> ''Animation'' -> ''Attach .KF'' in [[NifSkope]] - you'll need at least version [http://sourceforge.net/project/showfiles.php?group_id=149157&package_id=170735 0.9.5] or it will spawn an error message about the .kf file containing too many root nodes.</blockquote><br>
 
----
 
 
===Creating a Transform Controller animation===
 
<ol start="4">
<li>Attach '''''anim_scale.kf''''' and you're done - the 2 animation sequences in it target the '''''Branch''''' ''NiNode'' and will make it shrink from 1.0 to 0.0 and vice versa in 1.5 seconds (see '''''example_scale.nif''''' inside the sample package for an example object using this technique)</ol><br>If you don't want your targeted object to (solely) behave like that see [[#Tweaking an animation|Tweaking an animation]].<br><br>
[[Image:AnimGuide_Fig_4_Assigning_Target.gif|thumb|right|'''Fig. 4''': Assigning a target in NifSkope.]]
===Creating a Visibility Controller animation===
 
<ol start="4">
<li>Attach '''''anim_visibility.kf''''' - the 2 animation sequences in it target the '''''Branch''''' ''NiNode'' and will make it disappear almost instantly (see '''''example_visibility.nif''''' inside the sample package for an example object using this technique)</ol>
<blockquote>'''Note''': [[NifSkope]] will spawn an error message when trying to save the file after attaching the .kf file.<br>
This is due to a missing target link in the ''NiVisController'' that is contained in the .kf file. You can fix this via assigning a target - simply enter the node number of the '''''Branch''''' ''NiNode'' into the ''Target Block Details'' entry of the ''NiVisController'' (see [[#Creating a Visibility Controller animation|Fig. 4]]).<br>
''The animation will work without applying these fixes though''.</blockquote><br>If you don't want your targeted object to behave like that see [[#Tweaking an animation|Tweaking an animation]].<br><br>
 
===Creating an Alpha Controller animation===
 
<ol start="4">
<li>Attach '''''anim_alpha.kf''''' - the 2 animation sequences in it target the ''NiMaterialProperty'' of the '''''Target''''' mesh node and will make it fade in/out in 1.5 seconds (see '''''example_alpha.nif''''' inside the sample package for an example object using this technique)</ol>
<blockquote>'''Note''': A ''NiVisController'' was added to circumvent the alpha values getting overridden by the game's Object/Item Fade feature.<br>
Furthermore [[NifSkope]] will spawn an error message when trying to save the file after attaching the .kf file.<br>
This is due to a missing target link in both the ''NiAlphaController'' and the ''NiVisController'' that are contained in the .kf file. You can fix this via assigning a target, simply enter the node numbers of the ''NiMaterialProperty'' of the '''''Target''''' mesh node and of the '''''Branch''' NiNode'' into the ''Target Block Details'' entry of the ''NiAlphaController'' respectively ''NiVisController'' (similar to [[#Creating a Visibility Controller animation|Fig. 4]]).<br>
Also the ''NiMultiTargetTransformController'', which will be created automatically, is targeting the '''''Target''''' mesh node (which will cause an error message, too); simply remove the ''NiMultiTargetController'' block as it is not needed there anyway.<br>
''The animation will work without applying any of these fixes though''.</blockquote><br>If you don't want your targeted object to behave like that see [[#Tweaking an animation|Tweaking an animation]].<br><br>
 
===Creating a Texture Transform Controller animation===
 
<ol start="4">
<li>Attach '''''anim_textransf.kf''''' - the 2 animation sequences in it target the ''NiTexturingProperty'' of the '''''Target''''' mesh node and will make its texture scroll to the right/left in 1.5 seconds (see '''''example_textransf.nif''''' inside the sample package for an example object using this technique)</ol>
<blockquote>'''Note''': [[NifSkope]] will spawn an error message when trying to save the file after attaching the .kf file.<br>
This is due to a missing target link in the ''NiTextureTransformController'' that is contained in the .kf file. You can fix this via assigning a target - simply enter the node number of the ''NiTexturingProperty'' of the '''''Target''''' mesh node into the ''Target Block Details'' entry of the ''NiTextureTransformController'' (similar to [[#Creating a Visibility Controller animation|Fig. 4]]).<br>
Also the ''NiMultiTargetController'', which will be created automatically, is targeting the '''''Target''''' mesh node (which will cause an error message, too); simply remove the ''NiMultiTargetController'' block as it is not needed there anyway.
''The animation will work without applying any of these fixes though''.</blockquote><br>If you don't want your targeted object to behave like that see [[#Tweaking an animation|Tweaking an animation]].<br><br>
 
 
----
 
[[Image:AnimGuide_Fig_5_Changing_Animation_Time_Frame.gif|thumb|right|'''Fig. 5''': Updating the animation's global time frame after adjusting keyframe values.]]
===Tweaking an animation===
 
The provided .kf files contain animations of the most basic kind.<br>The following list contains information how to tweak the aforementioned attached animations.
<blockquote>'''Note''': If you are to change the keyframes' time values to exceed the default 1.5 seconds you'll have to edit the Stop Time value inside the NiControllerSequence accordingly or else the game will ignore any of these keyframes.</blockquote>
 
====Tweaking a Transform Controller animation====
 
*'''Altering the Scaling''':
**Locate and select the ''NiTransformData'' block inside a ''NiControllerSequence'' (see [[#Fig6|Fig. 6]] if you have trouble finding it).
**Inside the ''Block Details'' list expand the ''Scales'' entry.
**Increase the number of scale keys if desired and update their array.
**Edit the ''Time'' and ''Value'' settings of your animation keys to your liking.
**<div id="Fig6">Repeat for other ''NiControllerSequences'' if desired.</div>
[[Image:AnimGuide_Fig_6_Locating_Data_Block.gif|thumb|right|'''Fig. 6''': Relative position of a Ni[..]Data block.]]
<blockquote>'''Note''': Change ''Num Keys'' to 0 to get rid of scaling for good.</blockquote>
*'''Adding Translations''':
**Locate and select the ''NiTransformData'' block inside a ''NiControllerSequence''(see [[#Fig6|Fig. 6]] if you have trouble finding it).
**Inside the ''Block Details'' list expand the ''Translations'' entry.
**Change the ''Num Keys'' entry's value to at least 2 and update the ''Keys'' array.
**Change the ''Interpolation'' value to 1 or 2 (''LINEAR'' respectively ''QUADRATIC'').
**Edit the ''Time'' and ''Value'' settings of your animation keys to your liking.
**Repeat for other ''NiControllerSequences'' if desired.
*'''Adding Rotations''':
**Locate and select the ''NiTransformData'' block inside a ''NiControllerSequence'' (see [[#Fig6|Fig. 6]] if you have trouble finding it).
**Inside the ''Block Details'' list change the ''Num Rotation Keys'' entry's value to at least 2.
**Change the ''Rotation Type'' value to 1,2 or 3 if you want to use ''Quaternion Keys'' or to 4 if you want to use ''XYZ Rotations'' and update the respective array
**''Quaternion keys work'' exactly like rotation values inside other node types (e.g. ''NiTriStrips'', ''NiNode'', etc.).
**For ''XYZ Rotations'' you'll be facing another 3 arrays of key data, one for each axis (see figure E).<br><blockquote>'''Note''': Angles inside ''XYZ Rotations'' are measured in radians<br>(as in Pi = 3.1416 = 180°)</blockquote>
**Change the ''Interpolation'' value to 1 or 2 (''LINEAR'' respectively ''QUADRATIC'').
**Edit the ''Time'' and ''Value'' settings of your animation keys to your liking.
**Repeat for other ''NiControllerSequences'' if desired.
<br>
====Tweaking a Visibility Controller animation====
 
*Locate and select the ''NiBoolData'' block inside the ''NiBoolInterpolator'' in turn inside a ''NiControllerSequence'' (similar to [[#Fig6|Fig. 6]] in case you have trouble finding it).
<blockquote>'''Note''': ''NiVisController'' keyframe data must use the ''UNKNOWN_KEY'' interpolation type.</blockquote>
*Increase the ''Num Keys'' value and update the ''Keys'' array if desired.
*Edit the ''Time'' and ''Value'' settings of your animation keys to your liking.
<blockquote>'''Note''': Only 1 (=visible) and 0 (=invisible) are valid input for the Value entry.</blockquote>
*Repeat for other ''NiControllerSequences'' if desired.
<br>
====Tweaking an Alpha Controller animation====
 
*Locate and select the ''NiFloatData'' block inside the ''NiFloatInterpolator'' in turn inside a ''NiControllerSequence'' (similar to [[#Fig6|Fig. 6]] in case you have trouble finding it).
*Increase the Num Keys value and update the ''Keys'' array if desired.
*Edit the ''Time'' and ''Value'' settings of your animation keys to your liking.
*Repeat for other NiControllerSequences if desired.
<blockquote>'''Note''': Changing settings in the ''NiAlphaProperty'' of the mesh node can create interesting results when seen in motion, feel free to experiment.</blockquote>
<br>
[[Image:AnimGuide_Fig_7_Desired_Interpolator.gif|thumb|right|'''Fig. 7''': Example showing how to find the Interpolator block which is in charge of translating a texture along the V axis.]]
====Tweaking a Texture Transform Controller animation====
 
There's about 5 operations you can do via ''Texture Transform Controllers'':
*move textures along U axis (left/right)
*move textures along V axis (up/down)
*rotate textures
*scale textures along U axis
*scale textures along V axis
<br>
In the '''''sample anim_textransf.kf''''' file each of these operations is included, but only one of them has keyframe data that has an actual impact on the visual outcome.
Each operation has its own ''NiFloatInterpolator'' complete with a ''NiFloatData'' block. To find the right one you'll have to:
*Select the ''NiControllerSequence'' block.
*Expand the ''Controlled Blocks'' entry and its sub-entries in the ''Block Details'' list.
*Search the ''Blocks'' for entries labeled ''Variable Offset 1'', there you will find String values determining the operation that the ''NiFloatInterpolator'''s assigned to<br>(see [[#Tweaking a Texture Transform Controller animation|Fig. 7]]).
*If you found the right ''Block'' containing info for the operation you would like to modify check the ''Interpolator'' link inside that very same Block - it'll lead you to the ''NiFloatData'' block you'll have to edit then, which is similar to most other kinds of data blocks:
**Increase the ''Num Keys'' value and update the ''Keys'' array if desired.
**Edit the ''Time'' and ''Value'' settings of your animation keys to your liking.<br><blockquote>'''Note''': UV coordinates are usually values between 0 and 1, so translating by a value of 2 along an axis will make the texture completely scroll over the mesh twice.<br>Changing values for scaling will work quite the other way round though, the higher the value the smaller the texture will become - it'll be repeating itself along the edges in that case.</blockquote>
**Repeat for other ''NiFloatData'' blocks and/or ''NiControllerSequences'' if desired.
<br>
==Final Words==
Further iterations of this guide may include instructions about how to merge multiple controllers into a single controller sequence and maybe provide example files for this.<br>
Currently, there's also an .esp file included in the package which places all example files on a table in the TestingHall cell (type 'coc testinghall' in the in-game console to get there).
 
[[Category:Tutorials]]
[[Category:Modeling_and_Texturing_Tutorials]]
Anonymous user

Navigation menu