Public Member Functions | Static Public Member Functions | Static Public Attributes

Effect8 Class Reference

Search for all occurrences

Detailed Description

Extension to class Effect, new to 3ds max 8.

This class extends the Effect class through the addition of new methods.

All new Effect plugins should derive from the class. All existing Effect should ideally be re-compiled and derived from this class.

An Effect8* can easily be retrieved from an Effect& by calling: Effect8::GetEffect8(Effect& effect)

#include <sfx.h>

Inheritance diagram for Effect8:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool  SupportsBitmap (Bitmap &bitmap)=0
  Returns wether the given bitmap is supported by the effect.
virtual CoreExport BaseInterface GetInterface (Interface_ID id)
  The InterfaceServer mechanism is used to retrieve a Effect8* from a Effect*.
virtual CoreExport void *  GetInterface (ULONG id)
  The compiler will hide this overload of GetInterface() unless we define it here.

Static Public Member Functions

static CoreExport Effect8 GetEffect8 (Effect &effect)
  Converts an Effect& to an Effect8*, if possible.
static CoreExport bool  SupportsBitmap (Effect &effect, Bitmap &bitmap)
  Checks whether the given effect supports the given bitmap.

Static Public Attributes

static CoreExport const
Interface_ID 
m_kEffect8_Interface_ID
  The interface ID of class Effect8, used in combination with the InterfaceServer mechanism to retrieve a Effect8* from a Effect*.

Member Function Documentation

static CoreExport Effect8* GetEffect8 ( Effect effect ) [static]

Converts an Effect& to an Effect8*, if possible.

May return NULL if the Effect does not derive from class Effect8.

Parameters:
[in] effect - The effect for which you want to retrieve the Effect8 interface.
Returns:
A pointer to interface Effect8, if implemented by the effect.
static CoreExport bool SupportsBitmap ( Effect effect,
Bitmap bitmap 
) [static]

Checks whether the given effect supports the given bitmap.

By default, all Effects which do not implement Effect8 only support 16bits-per-channel bitmaps with alpha (BMM_TRUE_64). The reason for this is that, prior to Max 8, this was the only type of bitmap ever used for render output. With Max 8, 32bit floating-point bitmaps may be created.

Parameters:
[in] effect - The effect which you want to test for compatibilty.
[in] bitmap - The bitmap which you want to test for compatibility.
Returns:
true if the given effect supports the given bitmap, false otherwise.
virtual bool SupportsBitmap ( Bitmap bitmap ) [pure virtual]

Returns wether the given bitmap is supported by the effect.

The implementation should usualy check the bitmap type (bitmap.Storage()->Type()) to determine whether it supports that type.

Usage example: An effect plugin which uses the BMM_Color_64 version of Bitmap::GetPixels() will work with 32bit floating-point bitmaps, but will clamp the colors and should therefore be considered incompatible. An effect plugin which uses the BMM_Color_fl version of Bitmap::GetPixels() can be considered as compatible with all bitmap types.

To check whether an effect supports a given bitmap, it is advised to call the static method Effect8::SupportsBitmap(Effect&, Bitmap&) instead of this. The static method handles class Effect as well as Effect8 and implements appropriate default behaviour for class Effect.

Parameters:
[in] bitmap - The bitmap to be tested for compatibility.
Returns:
true if the bitmap is supported by this render effect, false otherwise.

Implemented in MSPluginEffect.

virtual CoreExport BaseInterface* GetInterface ( Interface_ID  id ) [virtual]

The InterfaceServer mechanism is used to retrieve a Effect8* from a Effect*.

Reimplemented from BaseInterface.

Reimplemented in MSPluginSpecialFX< Effect8 >, and MSSpecialFXXtnd< Effect, MSPluginEffect >.

virtual CoreExport void* GetInterface ( ULONG  id ) [virtual]

The compiler will hide this overload of GetInterface() unless we define it here.

Reimplemented from ReferenceTarget.

Reimplemented in MSPluginSpecialFX< Effect8 >, and MSSpecialFXXtnd< Effect, MSPluginEffect >.


Member Data Documentation

CoreExport const Interface_ID m_kEffect8_Interface_ID [static]

The interface ID of class Effect8, used in combination with the InterfaceServer mechanism to retrieve a Effect8* from a Effect*.


Effect8 Effect8 Effect8 Effect8 Effect8 Effect8 Effect8 Effect8 Effect8 Effect8
Effect8 Effect8 Effect8 Effect8 Effect8 Effect8 Effect8 Effect8 Effect8 Effect8