SCASM Animations
The Landing Gear
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 c_gear, r_gear, or l_gear extension/retraction.

; 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 c_gear, r_gear and l_gear 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 c_gear, r_gear and l_gear would apply to those parts as well.

; Part: c_gear
:Part000092
Jump( :Draw014 )
; Animation Motion Table
:MotionTbl014
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( 4 )
Dr4( 0.000000 0.000000 -103.934364 -1304.485474 )
Dr4( 50.000000 0.000000 -103.934364 -1304.485474 )
Dr4( 100.000000 0.000000 -103.934364 -1304.485474 )
Dr4( 200.000000 0.000000 -103.934364 -1304.485474 )
; Animation Rotation Table
:RotationTbl014
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( 4 )
Dr4( 0.000000 -0.771625 0.000000 0.000000 0.636078 )
Dr4( 50.000000 -0.374607 0.000000 0.000000 0.927184 )
Dr4( 100.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 200.000000 0.000000 0.000000 0.000000 1.000000 )
VarBase( :MotionTbl014 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
VarBase( :RotationTbl014 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
SetMaterial( 0 -1 )
DrawTriList( 1479
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    )
Call32( :Part000086 )
TransformEnd
TransformEnd
Return

; Part: r_gear
:Part000091
Jump( :Draw013 )
; Animation Motion Table
:MotionTbl013
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( 5 )
Dr4( 0.000000 -174.183701 0.000007 105.940796 )
Dr4( 25.000000 -174.183701 0.000007 105.940796 )
Dr4( 75.000000 -174.183701 0.000007 105.940796 )
Dr4( 100.000000 -174.183701 0.000007 105.940796 )
Dr4( 200.000000 -174.183701 0.000007 105.940796 )
; Animation Rotation Table
:RotationTbl013
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( 5 )
Dr4( 0.000000 0.707107 0.707107 0.000000 0.000000 )
Dr4( 25.000000 0.707107 0.707107 -0.000000 -0.000000 )
Dr4( 75.000000 0.430446 0.902448 -0.007513 -0.015752 )
Dr4( 100.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 200.000000 0.000000 0.000000 0.000000 1.000000 )
VarBase( :MotionTbl013 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
VarBase( :RotationTbl013 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
SetMaterial( 0 -1 )
DrawTriList( 1391
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    24 25 26
    24 26 27
    24 27 28
    24 28 29
    30 31 32
    30 32 33
    30 33 34
    30 34 35
    36 37 38
    36 38 39
    40 41 42
    40 42 43
    44 45 46
    44 46 47
    48 49 50
    48 50 51
    52 53 54
    52 54 55
    56 57 58
    56 58 59
    60 61 62
    60 62 63
    64 65 41
    64 41 40
    66 67 68
    66 68 69
    70 71 72
    70 72 73
    74 75 76
    74 76 77
    78 79 80
    78 80 81
    82 83 84
    82 84 85
    82 85 86
    82 86 87
    )
Call32( :Part000078 )
Call32( :Part000080 )
TransformEnd
TransformEnd
Return

; Part: l_gear
:Part000090
Jump( :Draw012 )
; Animation Motion Table
:MotionTbl012
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( 5 )
Dr4( 0.000000 186.839966 0.000007 105.971687 )
Dr4( 25.000000 186.839966 0.000007 105.971687 )
Dr4( 75.000000 186.839966 0.000007 105.971687 )
Dr4( 100.000000 186.839966 0.000007 105.971687 )
Dr4( 200.000000 186.839966 0.000007 105.971687 )
; Animation Rotation Table
:RotationTbl012
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( 5 )
Dr4( 0.000000 0.706864 -0.706864 0.018510 -0.018510 )
Dr4( 25.000000 0.706864 -0.706864 0.018510 -0.018510 )
Dr4( 75.000000 -0.422473 0.905997 -0.011063 0.023724 )
Dr4( 100.000000 0.000000 -0.013090 0.000000 0.999914 )
Dr4( 200.000000 0.000000 -0.013090 0.000000 0.999914 )
VarBase( :MotionTbl012 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
VarBase( :RotationTbl012 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
SetMaterial( 0 -1 )
DrawTriList( 1303
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    24 25 26
    24 26 27
    24 27 28
    24 28 29
    30 31 32
    30 32 33
    30 33 34
    30 34 35
    36 37 38
    36 38 39
    40 41 42
    40 42 43
    44 45 46
    44 46 47
    48 49 50
    48 50 51
    52 53 54
    52 54 55
    56 57 58
    56 58 59
    60 61 62
    60 62 63
    64 65 66
    64 66 67
    68 69 70
    68 70 71
    72 73 74
    72 74 75
    55 54 76
    55 76 77
    78 79 80
    78 80 81
    82 83 84
    82 84 85
    82 85 86
    82 86 87
    )
Call32( :Part000077 )
Call32( :Part000081 )
TransformEnd
TransformEnd
Return

Edited SCA Code     Template     Original SCA Code

This is the edited object source code that produces the animated parts c_gear. r_gear and l_gear in fxpaint.mdl.

; Part: c_gear
:Part000092
Jump( :Draw014 )
; Animation Motion Table
:MotionTbl014
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( 4 )
Dr4( 0.000000 0.000000 -103.934364 -1304.485474 )
Dr4( 50.000000 0.000000 -103.934364 -1304.485474 )
Dr4( 100.000000 0.000000 -103.934364 -1304.485474 )
Dr4( 200.000000 0.000000 -103.934364 -1304.485474 )
; Animation Rotation Table
:RotationTbl014
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( 4 )
Dr4( 0.000000 -0.771625 0.000000 0.000000 0.636078 )
Dr4( 50.000000 -0.374607 0.000000 0.000000 0.927184 )
Dr4( 100.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 200.000000 0.000000 0.000000 0.000000 1.000000 )
:Draw014
VarBase( :MotionTbl014 )
Animate( :[-1] 0xA0 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
VarBase( :RotationTbl014 )
Animate( :[-1] 0xA0 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
SetMaterial( 0 -1 )
DrawTriList( 1479
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    )
Call32( :Part000086 )
TransformEnd
TransformEnd
Return

; Part: r_gear
:Part000091
Jump( :Draw013 )
; Animation Motion Table
:MotionTbl013
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( 5 )
Dr4( 0.000000 -174.183701 0.000007 105.940796 )
Dr4( 25.000000 -174.183701 0.000007 105.940796 )
Dr4( 75.000000 -174.183701 0.000007 105.940796 )
Dr4( 100.000000 -174.183701 0.000007 105.940796 )
Dr4( 200.000000 -174.183701 0.000007 105.940796 )
; Animation Rotation Table
:RotationTbl013
Dwx( 3 )
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( 5 )
Dr4( 0.000000 0.707107 0.707107 0.000000 0.000000 )
Dr4( 25.000000 0.707107 0.707107 -0.000000 -0.000000 )
Dr4( 75.000000 0.430446 0.902448 -0.007513 -0.015752 )
Dr4( 100.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 200.000000 0.000000 0.000000 0.000000 1.000000 )
:Draw013
VarBase( :MotionTbl013 )
Animate( :[-1] 0x9C 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
VarBase( :RotationTbl013 )
Animate( :[-1] 0x9C 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
SetMaterial( 0 -1 )
DrawTriList( 1391
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    24 25 26
    24 26 27
    24 27 28
    24 28 29
    30 31 32
    30 32 33
    30 33 34
    30 34 35
    36 37 38
    36 38 39
    40 41 42
    40 42 43
    44 45 46
    44 46 47
    48 49 50
    48 50 51
    52 53 54
    52 54 55
    56 57 58
    56 58 59
    60 61 62
    60 62 63
    64 65 41
    64 41 40
    66 67 68
    66 68 69
    70 71 72
    70 72 73
    74 75 76
    74 76 77
    78 79 80
    78 80 81
    82 83 84
    82 84 85
    82 85 86
    82 86 87
    )
Call32( :Part000078 )
Call32( :Part000080 )
TransformEnd
TransformEnd
Return

; Part: l_gear
:Part000090
Jump( :Draw012 )
; Animation Motion Table
:MotionTbl012
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( 5 )
Dr4( 0.000000 186.839966 0.000007 105.971687 )
Dr4( 25.000000 186.839966 0.000007 105.971687 )
Dr4( 75.000000 186.839966 0.000007 105.971687 )
Dr4( 100.000000 186.839966 0.000007 105.971687 )
Dr4( 200.000000 186.839966 0.000007 105.971687 )
; Animation Rotation Table
:RotationTbl012
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( 5 )
Dr4( 0.000000 0.706864 -0.706864 0.018510 -0.018510 )
Dr4( 25.000000 0.706864 -0.706864 0.018510 -0.018510 )
Dr4( 75.000000 -0.422473 0.905997 -0.011063 0.023724 )
Dr4( 100.000000 0.000000 -0.013090 0.000000 0.999914 )
Dr4( 200.000000 0.000000 -0.013090 0.000000 0.999914 )
:Draw012
VarBase( :MotionTbl012 )
Animate( :[-1] 0x98 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
VarBase( :RotationTbl012 )
Animate( :[-1] 0x98 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
SetMaterial( 0 -1 )
DrawTriList( 1303
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    24 25 26
    24 26 27
    24 27 28
    24 28 29
    30 31 32
    30 32 33
    30 33 34
    30 34 35
    36 37 38
    36 38 39
    40 41 42
    40 42 43
    44 45 46
    44 46 47
    48 49 50
    48 50 51
    52 53 54
    52 54 55
    56 57 58
    56 58 59
    60 61 62
    60 62 63
    64 65 66
    64 66 67
    68 69 70
    68 70 71
    72 73 74
    72 74 75
    55 54 76
    55 76 77
    78 79 80
    78 80 81
    82 83 84
    82 84 85
    82 85 86
    82 86 87
    )
Call32( :Part000077 )
Call32( :Part000081 )
TransformEnd
TransformEnd
Return