Modules


Introduction
A messiah plugin (.mp file) can contain multiple modules. Each of these modules performs some specific operation inside of messiah. There are several different types of modules each providing different capabilities and uses.
Perhaps the most familiar type of module is the Effect Module. The Effect Module is typically used to alter the motion of one or more objects and/or deform those objects during animation. I say that this is the typical use of the Effect Module, because that is what it has traditionally been used for, however messiah is a very open ended system and there are few constraints placed on modules.
Module Classes
Modules can be separated into different classes based on their general abilities.

Access Based Modules
All modules that fall under this classification have the ability to request and respond to, Access Notifications. This gives your Access Based Module three major abilities: respond to scene updates (i.e. frame change), display an interface to the user, and save information to various messiah files.
Any Access Based Module (with the exception of Setup Modules) can respond to scene updates by handling ACCESS_PROCESS() messages. By responding to P_POST_POINT_DISPLACE() your module can deform an object, the module does not need to be an Effect Module; any Access Based Module can do this (again, with the exception of Setup Modules). If you wanted to alter the motion of an object you would respond to P_POST_MOTION(), P_PRE_IK() or P_POST_IK() depending on where in the Animation Pipeline you wanted your changes to take place. That said, the user will only be expecting an Effect Module to modify an object's shape or motion during animation, so it is generally not advised to do so in other Module types. Don't say we didn't warn ya. See Mesh Deformation and Keyframe and Motion for more information.
Access Based Modules can display an interface to the user by handling ACCESS_INTERFACE() messages. In response to IN_CREATE() the Module will create its controls. These interfaces are displayed in the appropriate area of messiah's interface for that type of Module. That is, an interface for a Setup Module will be displayed in Setup Mode, a Shader Module will be displayed in Render Mode and so on. See Interface Creation for more information.
Access Based Modules can save data to messiah files by handling various Access Notification messages. If the Module is Non-Instance Based then it will save data to the scene file by responding to GEN_SAVE_SCENE(), it will save data to the config file by responding to GEN_SAVE_CONFIG(). If the Module is Instance Based then it may also save data in response to those Access Notifications, in addition it may save data for each instance of the Module's Entity (FXeffect, FXaction and FXshader). Object Based Modules will respond to O_SAVE() to save per instance data to the scene file. Non-Object Based Modules will have their own Access Notification messages to respond to (e.g. ACT_SAVE() for Actions).
Instance Based Modules
All modules that fall under this classification result in the creation of Entities. For example, an Effect Module creates Effect Entities, Shader Modules create Shader Entities and Action Modules create Action Entities. Each instance of the Module's Entity can store its own data. For example separate instances of an Effect Module may have different settings and may affect different objects. Each instance will also save its data to the scene file (the Module itself may also save data to the file like any other Access Based Module).
Another characteristic of Instance Based Modules is that when they are updating their interfaces they will need to take into account which instance is currently selected. The reason for this is pretty obvious, we want the controls in the interface to reflect the right instance. messiah passes the ID of the instance as ctl_data to your Instance Based Module's control_func(). See Interface Creation for more information.
Object Based Modules
In addition to the characteristics of Access Based Modules and Instance Based Modules, Object Based Modules have "channels", or animatable parameters. That is, the instances created by an Object Based Module have channels, the module itself does not. For example, and instance of a Shader can contain up to 32 animatable parameters. Any of the instances of an Object Based Module can be used anywhere an FXobject can be used, the same is not true of Instance Based Modules.
Example:

FXeffect effect;
FXaction action;

// legal, FXeffect is an instance of an Effect Module,
// which is an Object Based Module
FXobject generic = (FXobject)effect;

// illegal!!, FXaction is an instance of an Action Module,
// which is an Instance Based Module
FXobject generic = (FXobject)action;


© 2003 pmG WorldWide, LLC.


www.projectmessiah.com

groups.yahoo.com/pmGmessiah

Last Updated on Thu Jul 10 04:49:37 2003