SCASM Animations
Folding Wings
Keyframe Animation

NOTE
FSDS Pro version 2.33 automatically includes keyframe animation tables when generating the object source code file (.sca) for your model!

Earlier versions of FSDS do not generate these tables, only the code for a static part. If you are using an earlier version of FSDS, you have to build the keyframe data tables code by hand with the help of a little hex editing of the MDL file.

Template     Original SCA Code     Edited SCA Code

In FSDS, each time you set a KeyFrame, you are generating a single row of translation and rotation data that appears in the animation tables for that part.

VAR - hex offset to the variables r_wingfold position or l_wingfold position.

; Part: PARTNAME
:PARTLABEL
IfVarAnd( :RETPARTNAME  90  8 )
Jump( :PARTNAME )

:RETPARTNAME
Return

:PARTNAME
Jump( :DrawTableNumber ) ; Animation Motion Table
:MotionTblNUM
Dwx( 1 )
Dr4( -1 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( rows )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
     ..........
Dr4( 100.000000 0.000000 0.000000 0.000000 )

; Animation Rotation Table
:RotationTblNUM
Dwx( 3 )
Dr4( -1 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( rows )
Dr4( 0.000000 0.000000 0.000000 0.000000 1.000000 )
     ..........
Dr4( 100.000000 0.000000 0.000000 0.000000 0.000000 )
:DrawTableNumber
VarBase( :MotionTblNUM )
Animate( :[-1] VAR 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
VarBase( :RotationTblNUM )
Animate( :[-1] VAR 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
SetMaterial(  m  t  )
DrawTriList( index  ... vertex indices ...  )
TransformEnd
TransformEnd
Return

Original SCA Code     Template     Edited SCA Code

; Part: r_wingfold
:Part000095
Jump( :Draw016 )
; Animation Motion Table
:MotionTbl016
Dwx( 0001 )
Dr4( -1.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( 3 )
Dr4( 0.000000 29.494886 0.000000 -124.846085 )
Dr4( 100.000000 -21.571218 20.115511 -124.846085 )
Dr4( 200.000000 -21.571218 20.115511 -124.846085 )
; Animation Rotation Table
:RotationTbl016
Dwx( 0003 )
Dr4( -1.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( 3 )
Dr4( 0.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 100.000000 0.000000 0.000000 0.930418 -0.366501 )
Dr4( 200.000000 0.000000 0.000000 0.930418 -0.366501 )
VarBase( :MotionTbl016 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
VarBase( :RotationTbl016 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
SetMaterial( 0 -1 )
DrawTriList( 1587
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    )
SetMaterial( 0 0 )
DrawTriList( 1587
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    )
Call32( :Part000006 )
Call32( :Part000043 )
Call32( :Part000045 )
Call32( :Part000047 )
Call32( :Part000073 )
TransformEnd
TransformEnd
Return

Edited SCA Code     Template     Original SCA Code

This is the edited object source code that produces the animated part r_wingfold in fxpaint.mdl. Note that since this part has child parts attached to it, the Call32( ... ) commands to those parts appear just before the two TransformEnd commands near the end of this code. This ensures that any animation to r_wingfold applies to those parts as well.

; Part: r_wingfold
:Part000095
Jump( :Draw016 )
; Animation Motion Table
:MotionTbl016
Dwx( 1 )
Dr4( -1.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( 3 )
Dr4( 0.000000 29.494886 0.000000 -124.846085 )
Dr4( 100.000000 -21.571218 20.115511 -124.846085 )
Dr4( 200.000000 -21.571218 20.115511 -124.846085 )
; Animation Rotation Table
:RotationTbl016
Dwx( 0003 )
Dr4( -1.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( 3 )
Dr4( 0.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 100.000000 0.000000 0.000000 0.930418 -0.366501 )
Dr4( 200.000000 0.000000 0.000000 0.930418 -0.366501 )
:Draw016
VarBase( :MotionTbl016 )
Animate( :[-1] 0xC6 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
VarBase( :RotationTbl016 )
Animate( :[-1] 0xC6 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
SetMaterial( 0 -1 )
DrawTriList( 1587
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    )
SetMaterial( 0 0 )
DrawTriList( 1587
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    )
Call32( :Part000006 )
Call32( :Part000043 )
Call32( :Part000045 )
Call32( :Part000047 )
Call32( :Part000073 )
TransformEnd
TransformEnd
Return