<<<<<<<<<<<<<<<<<

keyframe(gener) Script Generators keyframe(gener)

NAME

keyframe - a key frame script generator

DESCRIPTION

A keyframe is an object that generates cues and splines from a series of values. Keyframes can be used to produce smooth movement between the series of values for any number of object - message pairs. To accomplish this, the keyframe generates cues , splines , and data for each object - message pair. Keyframing involves three steps:

1) Specify the object - message - value for each key frame within the keyframe object.

2) Generate the key frame scripts with generate! .

3) Execute the generated cues by sending a start! to the scene. Within a keyframe object, individual key frames are stored as message, value pairs, indexed by time and object name.

SUPERCLASS

generator

INSTANCE VARIABLES

scene is the name of the scene to contain the generated cues .

file is the name of the file to contain the generated script. The default is "temp.scr".

default_spline is the class of the spline to be used for any key frames that do not explicitly set a spline. The default is "k_spline".

MESSAGES

t= time sets the current time. All object, message, and value messages will be applied at this time.

object= name sets the current object. Subsequent message and value will be associated with the named object.

message= string sets the current message. This may be any LYMB message.

value= (values) sets the value of the current keyframe. This may be 1, 2, or 3 scalars.

spline= name sets the spline to be used for the current object - message pair. Most of the time, the default spline, a k_spline, is sufficient. If you are keyframing orientations, you should use the o_spline.

t- time deletes all the key frames at the specified time.

object- name deletes the key frames for named object at the current time.

objects_at_t? returns a list of objects active at the current time.

ts_of_object? returns the times stored for the current object.

ts? returns the times stored for all objects.

messages_values? returns the messages and values for the current time and object.

normalize_data_on! normalize_data_off! sets the normalize data flag for the data and splines. On is the default and is sufficient for most applications. If you use o_spline, you should turn it off.

generate! generates the cues, splines and data for all objects and messages in the keyframe. The generated script is executed and also placed in the file specified in the file instance variable. Three collections are generated for each key frame: keyframename_cues, keyframename_splines, keyframename_datas. The following naming convention is used for generated objects:

cues - keyframename_object_message

splines - keyframename_object_message_spline

data - keyframename_object_message_data

EXAMPLE

cube_modeller new: acube; actor new: cube1 modeller= acube

scale=(.5,.5,.5) color=(0,1,0);

camera new: c1 position= (0,0,8) on!;

renderer new: aren pref_size= (750,750) cameras= c1 actors= [actor instances?];

keyframe new: key1 t = 0 object = cube1 message = `position=' value= (-2,-2,0) t = 2 object = cube1 message = `position=' value= (2,2,0) file= `/tmp/keytest.scr' generate!;

scene new: scene1 renderers= aren cues= [cue instances?];

scene1 start!;

SEE ALSO

scene cue k_spline c_spline o_spline data


Please send comments and suggestions to
consult@rpi.edu