19.2.1. Effect file functions
There are a few functions that must be implemented in the effect script files for them to work properly. These functions are called at different times by the Demorize system when a presentation is playing and the object that has the script attached to it is has activated the scripting. The different functions that are called upon by the system are described below:
- GetDescription - Allows the script to give a textual description of what it is used for.
- GetProperties - Returns an array with the names and description of the internal properties within the script that can be manipulated from the outside.
- GetPropertyValues - Returns the values for each of the internal properties.
- SetPropertyValues - Sets the values for each of the internal properties.
- SetTarget - This is the place in which you get to know which object in the scene layer that the script is assigned to. This is usually the place where you retrieve references to the properties for the object that you are going to manipulate later on in the OnTime functions.
- GetKeys - Returns a list of values from 0.0 to 1.0 which tells where on the script's internal timeline that keys for the script's properties can be set.
- DefineKey - Sets the value for the internal properties at the given key. The key that is given as input is one of the keys that has been returned by the GetKeys function.
- OnReset - Called when the script is created or restarted.
- OnTimeBegin - Called at the beginning just before the script is about to be activated and run on the timeline.
- OnTime - Called for every time step that the script is active on the timeline. This is usually the place where you animate an object's properties.
- OnTimeEnd - Called at the end of the script's timeline when it is about to be deactived.