XML:OBAN: Difference between revisions

3,956 bytes added ,  20 April 2012
m
no edit summary
m (Reverted edits by Ozyguxij (Talk) to last revision by Paradox-01)
mNo edit summary
Line 1: Line 1:
objects use:
__TOC__
:env_setanim ''objectId oban_name''
 
:obans are level specific
{{Template:XMLModdingHints}}
:exception: obans of [[OBD:TRIG|laser triggers]] are located in level0_Final
{| border=0 cellspacing=20 cellpadding=0 align=center
:trivia: even the [http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/dream_obj_images_spawned.jpg dream lab images] are obans
| The xml code on this page is compatible with onisplit '''v0.9.61.0'''
characters use:
|}
:chr_animate ''ai_name oban_name''
 
cams use:
 
:cm_interpolate ''oban_name frame_number''
==[[OBD:OBAN|OBAN]]: Object Animation==
:[[AE:Authoring_custom_camera_animations|>> cam tutorial]]
 
===general information===
* OBAN files are level specific
* exception: OBANs of [[OBD:TRIG|laser triggers]] are located in level0_Final
* trivia: also the [http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/dream_obj_images_spawned.jpg dream lab images] use OBANs
* tutorial: making [[AE:Authoring_custom_camera_animations|camera interpolations]]
 
 
===BSL support===
{| class="wikitable" width=100%
| '''object animations'''
| '''character animations'''
| '''camera animations'''
|-
| env_setanim ''objectId oban_name''
| chr_animate ''ai_name oban_name''
| cm_anim <nowiki>[look|move|both]</nowiki> ''oban_name''
|-
|
|
| '''camera interpolation'''
|-
|
|
| cm_interpolate ''oban_name frame_number''
|}
 
 
===XML===
{| class="wikitable" width=100%
|width=120px| '''tag'''
|width=60px| '''type'''
| '''description'''
|-
|valign=top| <Flags>
|valign=top| flag
|
: NormalLoop
: BackToBackLoop
: RandomStartFrame
: Autostart
:: autostart animation (after an animated object is created
: ZAxisUp
:: 3DSMax generated animation (has Z axis pointing up)
|-
| <InitialTransform>
| matrix4x3
| initial position transform matrix
|-
| <BaseTransform>
| matrix4x3
| fixed transform matrix
|-
| <FrameLength>
| int16
| the value mus be equal to the last <Time> value plus 1 because <Time>0</Time> is also a frame; Oni crashes if you use a wrong value for <FrameLength>
|-
| <FrameCount>
| int16
| fubared animation frame length (in 1/60 seconds); does not work
|-
| <HalfStopFrame>
| int16
| stop frame for the first "half" of the animation; used by door animations to distinguish between open and close sequences
|-
| <KeyFrames>
|
| holds <OBANKeyFrame> tags
|-
| <Rotation>
| quaternion
| object rotation, can harvested from TRAM files
|-
| <Translation>
| vector3
| x y z object position
|-
| <Time>
| int32
| elapsed time in frames, use short intervalls for smooth animations
|}
 
;Transform matrices
:Like all matrices in Oni, they are composed of 3 vectors defining rotation/scaling/shearing and a 4th vector defining a translation.
:In the above table the 4 vectors are presented as rows ([[Wikipedia:row-major_order|Direct 3D convention]]), although OpenGL and Oni use them as columns.
:[[Wikipedia:Transformation_matrix#Affine_transformations|Affine transformations]] use a 4x4 matrix with 4 extra coefficients (in the presentation above, one would add one column on the right):
::three [[Wikipedia:3D_projection|projection transform]] coefficients (all of them are zero here); one final coefficient (always 1.0 for an affine transform matrix).
:Alternatively, one can think of the 3x4 matrix as a 3x3 rotation/scaling matrix and a position vector
::*Let X=(x, y, z) be the position of a vertex in the M3GM
::*Let M=(m11, m21, m31; m12, m22, m32; m13, m23, m33) be the 3x3 matrix
::*Let R=(m14, m24, m34) be the translation vector
::Then the absolute position of the vertex in the 3D world will be: X M + R
::(left multiplication is used because of the row-major notation above)
;Initial transform matrix
:It is used to position the object in the environment before the animation is played.
:When the animation is played, they use the fixed transform matrix and a quaternion.
;Fixed transform matrix
:This transformation is applied before the quaternion+position transform at every keyframe.
:The only transform that can't be handled by the quaternion+position is scaling/mirroring.
:Thus, the fixed transform is a scaling matrix most of the time (no rotation or translation).
:In the above example, the fixed transform scales the van up by 1.82 (along all three axes).
;Quaternions
:Those are used in Oni whenever interpolation of 3D rotation is involved (e.g., [[OBD_talk:TRAM/raw0x34#Quaternions|TRAM rotation]])
:In this case, rotation at intermediate frames is interpolated from the keyframe quaternions.
 
 
===data harvest from TRAM files===
It's possible to create animations in Mod Tool and making TRAM files out of them. Then you can extract the quaternions and rotations with onisplit [http://mods.oni2.net/node/38 v0.9.54.0] and use them for OBANs.
: [http://oni.bungie.org/community/forum/viewtopic.php?id=2276 HERE's] an excel macro to harvest such data for camera animations.
8,288

edits