;-----------------------------------------------------------
; KSCRIPT2.K3D
; Sample Keyscript #2
; 3DStudio R4
; 940920
;
; Script Description:
;
; This script sets camera FOV to 120 at frame 0 and changes the 
;   FOV to 30 at the last frame of the animation.  This simulates
;   a camera zoom. 
;
; It expects there to be a camera in 3ds called Camera01.
;
; Before and after executing this script, go to 3ds and examine the Track and
;   Key Info for Camera01 to see how they've been affected.  Use Hold and
;   Fetch to preserve and restore states if you wish to modify this script to
;   see other effects on the 3ds database.
;
; The mesh file KSCR1-4.3DS contains sample geometry usable with this script
;

;-----------------------------------------------------------
; This line declares instances of a FOV key structure
;   with the names F1 and F2.  FOV stands for field of view.
;
DefFOV F1, F2


;-----------------------------------------------------------
; This line returns the total number of frames in the 
; animation to a reserved variable 'Time'.
;
NumFrames


;-----------------------------------------------------------
; The next section of code fills our FOV structure with
; the key values that we want to write to the 3ds database.
; value is the number of degrees that we want the FOV for Camera01
; time is the frame that we want to write the key at.
;
F1.value = 120          : ' The FOV value for the structure F1 is being set.
F1.time  = 0            : ' This field defines at which frame all fields 
			: ' are set to. 

F2.value = 30           : ' The FOV value for the structure F2 is being set.
F2.time  = Time : ' This field is being defined by the reserved variable
			: ' Time (Set by NumFrames).


;-----------------------------------------------------------
; This is the call to write a key to the 3ds database.  One
; key to Camera01 at frame 0 and another key to Camera01 at
; the value of 'Time'.  'Time' is set to (The last frame if
; defined by NumFrames).  The first parameter is the name of 
; the object that we are writing a key for.  The second parameter
; is a structure.  In this case it is our FOV struct.  CreateKey
; knows to write a FOV key because of the struct type.
;
CreateKey "Camera01", F1
CreateKey "Camera01", F2

; End of KSCRIPT2.K3D


