Class Effect
See Also: Class SpecialFX, Class SFXParamDlg, Class IRendParams,Class RenderGlobalContext, Class Bitmap, Class ISave, Class ILoad, Class INode, Class Interface.
class Effect : public SpecialFX
Description:
This class is available in release 3.0 and later only.
This is the base class used in the creation of Rendering Effect plug-ins. In 3ds max 3.0 these plug-in are added in sequence after a rendering is complete without the use of Video Post. A developer creates a sub-class of this class and implements or calls the methods shown below.
Plug-In Information:
Class Defined In RENDER.H
Super Class ID RENDER_EFFECT_CLASS_ID
Standard File Name Extension DLV
Extra Include File Needed None
There are also methods in the Interface class for manipulating the Effects List:
virtual int NumEffects()=0;
virtual Effect *GetEffect(int i)=0;
virtual void SetEffect(int i,Effect *e)=0;
virtual void AddEffect(Effect *eff)=0;
virtual void DeleteEffect(int i)=0;
Methods:
public:
Prototype:
virtual EffectParamDlg *CreateParamDialog(IRendParams *ip);
Remarks:
Implemented by the Plug-In.
This method creates and returns a new instance of a class derived from EffectParamDlg to manage the user interface. This put up a modal dialog that lets the user edit the plug-ins parameters.
Parameters:
IRendParams *ip
This is the interface given to the rendering effect so it may display its parameters.
Return Value:
A new instance of a class derived from EffectParamDlg.
Note: typedef SFXParamDlg EffectParamDlg;
Default Implementation:
{return NULL;}
Prototype:
virtual BOOL SetDlgThing(EffectParamDlg* dlg);
Remarks:
You should implement this if you are using the ParamMap2 AUTO_UI system and the effect has secondary dialogs that have something other than the incoming effect as their 'thing'. Called once for each secondary dialog for you to install the correct thing. Return TRUE if you process the dialog, FALSE otherwise, in which case the incoming effect will be set into the dialog.
Note: Developers needing more information on this method can see the remarks for MtlBase::CreateParamDlg() which describes a similar example of this method in use (in that case it's for use by a texture map plug-in).
Parameters:
EffectParamDlg* dlg
Points to the ParamDlg.
Default Implementation:
{ return FALSE; }
Prototype:
virtual DWORD GBufferChannelsRequired(TimeValue t);
Remarks:
Implemented by the Plug-In.
Returns a DWORD that indicates the channels that this Effect requires in the output bitmap.
Parameters:
TimeValue t
The time at which the channels are required.
Return Value:
The required channels. See List of Image Channels.
Default Implementation:
{ return 0; }
Prototype:
virtual void Apply(TimeValue t, Bitmap *bm, RenderGlobalContext *gc, CheckAbortCallback *cb)=0;
Remarks:
Implemented by the Plug-In.
This is the method that is called to apply the effect to the bitmap passed.
Parameters:
TimeValue t
The time at which to apply the effect.
Bitmap *bm
The bitmap the effect modifies and stores the result in.
RenderGlobalContext *gc
This can be used to retireve information about the global rendering enviornment.
CheckAbortCallback *cb
Points to an object whose Check() method may be called to determine if the user wants to abort. See Class CheckAbortCallback.
Prototype:
IOResult Save(ISave *isave);
Remarks:
Implemented by the System.
To facilitate naming rendering effects a 'name' string exists in the base class. This method should be called at the start of the developer's sub-classed Effect plug-in to save the name.
Parameters:
ISave *isave
An interface for saving data.
Prototype:
IOResult Load(ILoad *iload);
Remarks:
Implemented by the System.
To facilitate naming rendering effects a 'name' string exists in the base class. This method should be called at the start of the developer's sub-classed Effect plug-in to load the name.
Parameters:
ILoad *iload
An interface for loading data.