SCASM Animations
The Canopy
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 variable f_canopy 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

This is the original object source code for f_canopy generated by FSDS Pro v2.33 from fxpaint.fsc. Note that if this part had child parts attached to it, the Call32( ... ) commands to those parts would appear just before the two TransformEnd commands near the end of this code. This would ensure that any animation to f_canopy would also apply to those parts as well.

; Part: f_canopy
:Part000089
IfVarAnd( :RET10  90  8 )
Jump( :GO10 )
:RET10
Return
:GO10
Jump( :Draw011 )
; Animation Motion Table
:MotionTbl011
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( 2 )
Dr4( 0.000000 0.000000 193.667496 0.000000 )
Dr4( 100.000000 0.000000 193.667496 -273.715668 )
; Animation Rotation Table
:RotationTbl011
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( 2 )
Dr4( 0.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 100.000000 -0.008727 0.000000 0.000000 0.999962 )
VarBase( :MotionTbl011 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
VarBase( :RotationTbl011 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
SetMaterial( 5 -1 )
DrawTriList( 1291
    0 1 2
    1 3 2
    4 5 2
    5 0 2
    )
SetMaterial( 5 1 )
DrawTriList( 1291
    6 7 8
    6 9 7
    6 10 11
    6 8 10
    )
TransformEnd
TransformEnd
Return

Edited SCA Code     Template     Original SCA Code

This is the edited object source code that produces the animated part f_canopy in fxpaint.mdl.

; Part: f_canopy
:Part000089
IfVarAnd( :RET10  90  8 )
Jump( :GO10 )
:RET10
Return

:GO10
Jump( :Draw011 )
; Animation Motion Table
:MotionTbl011
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( 2 )
Dr4( 0.000000 0.000000 193.667496 0.000000 )
Dr4( 100.000000 0.000000 193.667496 -273.715668 )
; Animation Rotation Table
:RotationTbl011
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( 2 )
Dr4( 0.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 100.000000 -0.008727 0.000000 0.000000 0.999962 )
:Draw011
VarBase( :MotionTbl011 )
Animate( :[-1] 0xCE 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
VarBase( :RotationTbl011 )
Animate( :[-1] 0xCE 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
SetMaterial( 5 -1 )
DrawTriList( 1291
    0 1 2
    1 3 2
    4 5 2
    5 0 2
    )
SetMaterial( 5 1 )
DrawTriList( 1291
    6 7 8
    6 9 7
    6 10 11
    6 8 10
    )
TransformEnd
TransformEnd
Return