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.
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.
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 EffectEntities, Shader Modules create ShaderEntities and Action Modules create ActionEntities. 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.
FXeffect effect;
FXaction action;
// legal, FXeffect is an instance of an Effect Module,// which is an Object Based ModuleFXobject generic = (FXobject)effect;
// illegal!!, FXaction is an instance of an Action Module,// which is an Instance Based ModuleFXobject generic = (FXobject)action;