VIDI Presenter 3D Animator Toolkit


Animator Routine Descriptions

How the resources are set up

File Type: AniM
File Creator: VDoz
 
Resources
---------
 
Type   ID   Description
-----------------------------------------------------------------
mVER  any   2-bytes (short). Module Version #. PrePro currently only recognizes 
            animator plug-ins with an mVER values of 1.  Any other value in this 
            resource and the plug-in will be ignored.
mFLG  any   4-bytes (long). 32-bit field telling which routines are
            available in this plug-in.
            0x00000001 = has Config Routines
            0x00000002 = Calc Routine (if 1, does not call Apply routine)
            Bits 2-31 are reserved for future expansion.
 
Ani0	Main 68000 (no FPU) Code Segment. (any extra segs use CCD0)
 
Ani1	Main 68000 (w/ FPU) Code Segment. (any extra segs use CCD1)
 
Ani2	PowerPC Code (all code is always in single segment).
 

note: Resource Names of Ani0-Ani2 are used in selector pop-up. If they are un-named, the plug-in will be skipped. Also current version of Presenter at time of this document update did not support PowerPC module. It may in a future version and should not crash the current one.

Entry point for all animators is: (C and Pascal)

pascal OSErr main(Ptr ParmsPtr, 
		  Handle *DataHndlPtr,
		  Handle *ConfigHndlPtr, 
		  GlobalProcs_Ptr gProcs, 
		  short Selector)
 
function main ( ParmsPtr: Ptr; 
		var DataHndl: Handle; 
		var ConfigHndl: Handle; 
		gProcs: GlobalProcs_Ptr; 
		Selector: integer): integer;
 

ParmsPtr is used by presenter to send the location of event specific information.

DataHndl is a Handle maintained by presenter for you. You create and dispose of this handle yourself during AnimatorInit and AnimatorDispose calls.

ConfigHndl is a Handle to the objects current parameters. If no parameters have been set yet the value is nil.

gProcs is used to make calls back into presenter from your module. This is done to write out status lines or execute SANE commands.

Selector is a value which pertains to which operation presenter wants you to perform. The values are as follows:

  1. k_AnimatorInit
  2. k_AnimatorDispose
  3. k_AnimatorConfigOpen
  4. k_AnimatorConfigEvent
  5. k_AnimatorConfigClose
  6. k_AnimatorInterpolate
  7. k_AnimatorApply
  8. k_AnimatorCalc


The operations and what is expected of you

INIT k_AnimatorInit 1
This is called once at the beginning of use. You can allocate your data handle at this time. A local data handle is good for holding information to be used from cell to cell or during config dialog time (you can also init/dispose during config time).

DISPOSE k_AnimatorDispose 2
Called to close your module. This is usually not done until the model is closed. At this point you should release any memory grabbed during INIT.

CONFIGOPEN k_AnimatorConfigOpen 3
Called when someone double clicks on your animator and your animator has the config flag (0x0001) set in the mFLG resource. The ConfigHndl should hold the parameters for the animator or nil if nothing has been assigned yet. ParmsPtr->theWindow holds a place for your dialog window ptr to go when you open your dialog. The dialog box must be non-modal - in other words, DO NOT CALL "ModalDialog". At this point you can also open a data handle if one was not created at INIT time. Dialog windows should be opened invisible, Presenter will center and show.

CONFIGEVENT k_AnimatorConfigEvent 4
Called each time an event is to processed in your dialog. ParmsPtr passes you the event record so you can act upon it. When the close button is pressed, place a 1 in ParmsPtr->ApplyFlags. If canceled return a 2.

CONFIGCLOSE k_AnimatorConfigClose 5
Called when dialog is closed. You need to release all memory allocated during CONFIGOPEN time. If you created a ConfigHndl, Presenter will take care of it, do not dispose of the ConfigHndl. And finally dispose of the dialog.

INTERPOLATE k_AnimatorInterpolate 6
This routine is called in the current version of PrePro(3.2). It will be called whenever an animator has been applied more than once on the same timeline, passing two config handles in the parameter stuct. The routine should examine the two handles, and load the "ConfigHndl" with the resulting interpolated configuration.

APPLY k_AnimatorApply 7
This is where all the work gets done. ParmsPtr contains information about the current time as well as a pointer to object information. ConfigHndl will contain any information set up in the config dialog. It should alter the BaseInfo record passed in the parameter block to perform whatever animation desired.

CALC k_AnimatorCalc 8
This works similarly to AnimatorApply, except it is only called during a "Calculate ND Cells" command. It should alter the BaseInfo record passed to it, and set "MakeCell" to TRUE whenever an ND cells needs to be created. (i.e. Collision creates an ND cell whenever it detects a collision between groups).

Back To Start Page


Last update 26FEB96 by Eric Popejoy.






Copyright © 1997 by WebNation
All trademarks are the property of their respective holders

Switch to Standard View