Public Member Functions

Effect Class Reference

This reference page is linked to from the following overview topics: Rendering Plug-ins, Plug-in Base Classes.


Search for all occurrences

Detailed Description

See also:
Class SpecialFX, Class SFXParamDlg, Class IRendParams, Class RenderGlobalContext, Class Bitmap, Class ISave, Class ILoad, Class INode, Class Interface.

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;

#include <sfx.h>

Inheritance diagram for Effect:
Inheritance graph
[legend]

List of all members.

Public Member Functions

RefResult  NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message)
  Receives and responds to messages.
SClass_ID  SuperClassID ()
  Retrieves a constant representing the type of the plugin.
IOResult  Save (ISave *isave)
IOResult  Load (ILoad *iload)
virtual EffectParamDlg CreateParamDialog (IRendParams *ip)
virtual BOOL  SetDlgThing (EffectParamDlg *dlg)
virtual DWORD  GBufferChannelsRequired (TimeValue t)
virtual void  Apply (TimeValue t, Bitmap *bm, RenderGlobalContext *gc, CheckAbortCallback *cb)=0

Member Function Documentation

RefResult NotifyRefChanged ( Interval  changeInt,
RefTargetHandle  hTarget,
PartID partID,
RefMessage  message 
) [inline, virtual]

Receives and responds to messages.

A plugin which makes references must implement a method to receive and respond to messages broadcast by its dependents. This is done by implementing NotifyRefChanged(). The plugin developer usually implements this method as a switch statement where each case is one of the messages the plugin needs to respond to. The Method StdNotifyRefChanged calls this, which can change the partID to new value. If it doesn't depend on the particular message& partID, it should return REF_DONTCARE.

  • For developer that need to update a dialog box with data about an object you reference note the following related to this method: This method may be called many times. For instance, say you have a dialog box that displays data about an object you reference. This method will get called many time during the drag operations on that object. If you updated the display every time you'd wind up with a lot of 'flicker' in the dialog box. Rather than updating the dialog box each time, you should just invalidate the window in response to the NotifyRefChanged() call. Then, as the user drags the mouse your window will still receive paint messages. If the scene is complex the user may have to pause (but not let up on the mouse) to allow the paint message to go through since they have a low priority. This is the way many windows in 3ds Max work.
Parameters:
changeInt - This is the interval of time over which the message is active. Currently, all plug-ins will receive FOREVER for this interval.
hTarget - This is the handle of the reference target the message was sent by. The reference maker uses this handle to know specifically which reference target sent the message.
partID - This contains information specific to the message passed in. Some messages don't use the partID at all. See the section List of Reference Messages for more information about the meaning of the partID for some common messages.
message - The message parameters passed into this method is the specific message which needs to be handled.
Returns:
The return value from this method is of type RefResult. This is usually REF_SUCCEED indicating the message was processed. Sometimes, the return value may be REF_STOP. This return value is used to stop the message from being propagated to the dependents of the item.

Implements ReferenceMaker.

Reimplemented in MSPluginSpecialFX< Effect8 >.

                                                   {return REF_SUCCEED;}
SClass_ID SuperClassID ( ) [inline, virtual]

Retrieves a constant representing the type of the plugin.

Returns:
A super class id that uniquely identifies the type (category) of the plugin. Note that several plugin classes can be of the same type, thus return the same super class id. Plugins are uniquely identified by their class ids. List of Super Class IDs.
See also:
SClass_ID

Reimplemented from ReferenceTarget.

IOResult Save ( ISave isave ) [inline, virtual]
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.

Reimplemented from SpecialFX.

Reimplemented in MSPluginSpecialFX< Effect8 >.

{ return SpecialFX::Save(isave); }
IOResult Load ( ILoad iload ) [inline, virtual]
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.

Reimplemented from SpecialFX.

Reimplemented in MSPluginSpecialFX< Effect8 >.

{ return SpecialFX::Load(iload); }
virtual EffectParamDlg* CreateParamDialog ( IRendParams ip ) [inline, virtual]
Remarks:
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.
Returns:
A new instance of a class derived from EffectParamDlg.

Note: typedef SFXParamDlg EffectParamDlg;
Default Implementation:
{return NULL;}

Reimplemented from SpecialFX.

Reimplemented in MSPluginEffect, and MSEffectXtnd.

{ return NULL; }
virtual BOOL SetDlgThing ( EffectParamDlg dlg ) [inline, virtual]
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; }

Reimplemented from SpecialFX.

{ return FALSE; }
virtual DWORD GBufferChannelsRequired ( TimeValue  t ) [inline, virtual]
Remarks:
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.
Returns:
The required channels. See Image (G-Buffer) Channels.
Default Implementation:
{ return 0; }

Reimplemented in MSPluginEffect, and MSEffectXtnd.

{ return 0; }
virtual void Apply ( TimeValue  t,
Bitmap bm,
RenderGlobalContext gc,
CheckAbortCallback cb 
) [pure virtual]
Remarks:
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.

Implemented in MSPluginEffect, and MSEffectXtnd.


Effect Effect Effect Effect Effect Effect Effect Effect Effect Effect
Effect Effect Effect Effect Effect Effect Effect Effect Effect Effect