#include <mxsPlugin.h>
Public Member Functions |
|
MSTexmapXtnd (MSPluginClass *pc, BOOL loading) | |
~MSTexmapXtnd () | |
void | DeleteThis () |
ReferenceTarget * | get_delegate () |
void | GetClassName (MSTR &s) |
Retrieves the name of the plugin class.
|
|
Class_ID | ClassID () |
Retrieves a constant that uniquely
identifies the plugin class. |
|
void | FreeCaches () |
int | NumSubs () |
Animatable * | SubAnim (int i) |
MSTR | SubAnimName (int i) |
int | NumParamBlocks () |
IParamBlock2 * | GetParamBlock (int i) |
IParamBlock2 * | GetParamBlockByID (BlockID id) |
void * | GetInterface (ULONG id) |
Inherited from Animatable. |
|
int | NumRefs () |
Returns the total number of references this
ReferenceMaker can hold. |
|
RefTargetHandle | GetReference (int i) |
Returns the 'i-th' reference. |
|
RefTargetHandle | Clone (RemapDir &remap) |
This method is used by 3ds Max to clone an
object. |
|
int | BuildMaps (TimeValue t, RenderMapsContext &rmc) |
ULONG | Requirements (int subMtlNum) |
ULONG | LocalRequirements (int subMtlNum) |
void | MappingsRequired (int subMtlNum, BitArray &mapreq, BitArray &bumpreq) |
void | LocalMappingsRequired (int subMtlNum, BitArray &mapreq, BitArray &bumpreq) |
BOOL | IsMultiMtl () |
void | Update (TimeValue t, Interval &valid) |
void | Reset () |
Interval | Validity (TimeValue t) |
ParamDlg * | CreateParamDlg (HWND hwMtlEdit, IMtlParams *imp) |
IOResult | Save (ISave *isave) |
IOResult | Load (ILoad *iload) |
ULONG | GetGBufID () |
void | SetGBufID (ULONG id) |
void | EnumAuxFiles (AssetEnumCallback &assetEnum, DWORD flags) |
PStamp * | GetPStamp (int sz) |
PStamp * | CreatePStamp (int sz) |
void | DiscardPStamp (int sz) |
int | NumSubTexmaps () |
Texmap * | GetSubTexmap (int i) |
void | SetSubTexmap (int i, Texmap *m) |
MSTR | GetSubTexmapSlotName (int i) |
BOOL | SupportTexDisplay () |
DWORD_PTR | GetActiveTexHandle (TimeValue t, TexHandleMaker &thmaker) |
void | ActivateTexDisplay (BOOL onoff) |
BOOL | SupportsMultiMapsInViewport () |
void | SetupGfxMultiMaps (TimeValue t, Material *mtl, MtlMakerCallback &cb) |
ReferenceTarget * | GetRefTarget () |
AColor | EvalColor (ShadeContext &sc) |
float | EvalMono (ShadeContext &sc) |
Point3 | EvalNormalPerturb (ShadeContext &sc) |
BOOL | HandleOwnViewPerturb () |
BITMAPINFO * | GetVPDisplayDIB (TimeValue t, TexHandleMaker &thmaker, Interval &valid, BOOL mono=FALSE, int forceW=0, int forceH=0) |
void | GetUVTransform (Matrix3 &uvtrans) |
int | GetTextureTiling () |
void | InitSlotType (int sType) |
int | GetUVWSource () |
int | GetMapChannel () |
UVGen * | GetTheUVGen () |
XYZGen * | GetTheXYZGen () |
void | SetOutputLevel (TimeValue t, float v) |
int | LoadMapFiles (TimeValue t) |
void | RenderBitmap (TimeValue t, Bitmap *bm, float scale3D=1.0f, BOOL filter=FALSE) |
bool | IsLocalOutputMeaningful (ShadeContext &sc) |
bool | IsOutputMeaningful (ShadeContext &sc) |
int | IsHighDynamicRange () |
Public Attributes |
|
Texmap * | delegate |
Protected Member Functions |
|
virtual void | SetReference (int i, RefTargetHandle rtarg) |
Stores a
ReferenceTarget as its 'i-th' reference`. |
MSTexmapXtnd | ( | MSPluginClass * | pc, |
BOOL | loading | ||
) |
~MSTexmapXtnd | ( | ) | [inline] |
{ DeleteAllRefsFromMe(); }
void DeleteThis | ( | ) |
Reimplemented from MSPluginTexmap.
ReferenceTarget* get_delegate | ( | ) | [inline, virtual] |
void GetClassName | ( | MSTR & | s | ) | [inline, virtual] |
Retrieves the name of the plugin class.
This name is usually used internally for debugging purposes. For Material plug-ins this method is used to put up the material "type" name in the Material Editor.
s | Reference to a string filled in with the name of the plugin class |
Reimplemented from MSPluginTexmap.
Class_ID ClassID | ( | ) | [inline, virtual] |
Retrieves a constant that uniquely identifies the plugin class.
This method must return the unique ID for the plugin class. If two ClassIDs conflict, the system will only load the first conflicting one it finds. A program (gencid.exe) is provided to generate unique class id values.
Reimplemented from MSPluginTexmap.
{ return pc->class_id; }
void FreeCaches | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ delegate->FreeCaches(); }
int NumSubs | ( | ) | [virtual] |
Reimplemented from MSPluginTexmap.
Animatable* SubAnim | ( | int | i | ) | [virtual] |
i | This is the index of the sub-anim to return. |
Reimplemented from MSPluginTexmap.
MSTR SubAnimName | ( | int | i | ) | [virtual] |
i | The index of the parameter name to return |
Reimplemented from MSPluginTexmap.
int NumParamBlocks | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
IParamBlock2* GetParamBlock | ( | int | i | ) | [inline, virtual] |
i | The zero based index of the ParamBlock2 to return. |
Reimplemented from MSPluginTexmap.
{ return pblocks[i]; }
IParamBlock2* GetParamBlockByID | ( | BlockID | id | ) | [inline] |
Reimplemented from MSPluginTexmap.
{ return MSPlugin::GetParamBlockByID(id); }
void* GetInterface | ( | ULONG | id | ) | [inline, virtual] |
Inherited from Animatable.
Returns a pointer to the interface.
id | - The id of the interface. |
Reimplemented from MSPluginTexmap.
{ if (id == I_MAXSCRIPTPLUGIN) return (MSPlugin*)this; else return MSPluginTexmap::GetInterface(id); }
int NumRefs | ( | ) | [virtual] |
Returns the total number of references this ReferenceMaker can hold.
The plugin implements this method to indicate the total number of of references it can make. This includes all references whether they are NULL (inactive) or non-NULL (active) at the time when this method is called. A plugin can hold a variable number of references, thus the return value of this method is not to be cached and reused by client code.
Reimplemented from MSPluginTexmap.
RefTargetHandle GetReference | ( | int | i | ) | [virtual] |
Returns the 'i-th' reference.
The plugin implements this method to return its 'i-th' reference. The plug-in simply keeps track of its references using an integer index for each one. This method is normally called by the system.
i | - The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1. |
Reimplemented from MSPluginTexmap.
virtual void SetReference | ( | int | i, |
RefTargetHandle | rtarg | ||
) | [protected, virtual] |
Stores a ReferenceTarget as its 'i-th' reference`.
The plugin implements this method to store the reference handle passed to it as its 'i-th' reference. In its implementation of this method, the plugin should simply assign the reference handle passed in as a parameter to the member variable that holds the 'i-th' reference. Other reference handling methods such as ReferenceMaker::DeleteReference(), or ReferenceMaker::ReplaceReference() should not be called from within this method. The plugin itself or other plugins should not call this method directly. The system will call this method when a new reference is created or an existing one is replaced by calling ReferenceMaker::ReplaceReference().
i | - The index of the reference to store. Valid values are from 0 to NumRefs()-1. |
rtarg | - The reference handle to store. |
Reimplemented from MSPluginTexmap.
RefTargetHandle Clone | ( | RemapDir & | remap | ) | [virtual] |
This method is used by 3ds Max to clone an object.
class MyDerivedPlugin : public MyBasePlugin { const int MY_REFERENCE = 1; ReferenceTarget* Clone(RemapDir& remap) { ReferenceTarget* result = new MyDerivedPlugin(); BaseClone(this, result, remap); return result; } void BaseClone(ReferenceTarget* from, ReferenceTarget* to, RemapDir& remap) { if (!to || !from || from == to) return; MyBasePlugin::BaseClone(from, to, remap); to->ReplaceReference(MY_REFERENCE, remap->CloneRef(from->GetReference(MY_REFERENCE))); } };
This method should not be directly called by plug-ins. Instead, either RemapDir::CloneRef() or CloneRefHierachy() should be used to perform cloning. These methods ensure that the mapping from the original object to the clone is added to the RemapDir used for cloning, which may be used during backpatch operations
remap | - A RemapDir instance used for remapping references during a Clone. |
Reimplemented from MSPluginTexmap.
int BuildMaps | ( | TimeValue | t, |
RenderMapsContext & | rmc | ||
) | [inline, virtual] |
t | The current time. |
rmc | Provides information about the view being rendered and can provide access to the global rendering environment information via RenderGlobalContext *gc = rmc.GetGlobalContext(). See Class RenderMapsContext and Class RenderGlobalContext. |
Reimplemented from MSPluginTexmap.
ULONG Requirements | ( | int | subMtlNum | ) | [inline, virtual] |
subMtlNum | Specifies the number of the sub-material whose requirements should be returned. -1 may be used to return a value generated by looping over all the sub-materials and ORing together the requirements. |
Reimplemented from MSPluginTexmap.
{ return delegate->Requirements(subMtlNum); }
ULONG LocalRequirements | ( | int | subMtlNum | ) | [inline, virtual] |
subMtlNum | Specifies the number of the sub-material whose requirements should be returned. |
Reimplemented from MSPluginTexmap.
{ return delegate->LocalRequirements(subMtlNum); }
subMtlNum | Specifies the number of the sub-material whose mapping information is retrieved. |
mapreq | This array of bits is initialized to an empty set with MAX_MESHMAPS elements. Each bit corresponds to a mapping channel. Set a bit to one to indicate the material requires the corresponding UVW channel. |
bumpreq | This array of bits is initialized to an empty set with MAX_MESHMAPS elements. Each bit corresponds to a mapping channel. Set a bit to one to indicate the material requires the corresponding bump mapping channel. |
Reimplemented from MSPluginTexmap.
{ delegate->MappingsRequired(subMtlNum, mapreq, bumpreq); }
void LocalMappingsRequired | ( | int | subMtlNum, |
BitArray & | mapreq, | ||
BitArray & | bumpreq | ||
) | [inline, virtual] |
subMtlNum | Specifies the number of the sub-material whose mapping information is retrieved. |
mapreq | This array of bits is initialized to an empty set with MAX_MESHMAPS elements. Each bit corresponds to a mapping channel. Set a bit to one to indicate the material requires the corresponding UVW channel. |
bumpreq | This array of bits is initialized to an empty set with MAX_MESHMAPS elements. Each bit corresponds to a mapping channel. Set a bit to one to indicate the material requires the corresponding bump mapping channel. |
void LocalMappingsRequired(int subMtlNum, BitArray & mapreq, BitArray &bumpreq) { uvGen->MappingsRequired(subMtlNum,mapreq,bumpreq); }
void LocalMappingsRequired(int subMtlNum, BitArray & mapreq,BitArray &bumpreq) { xyzGen->MappingsRequired(subMtlNum,mapreq,bumpreq); }
Reimplemented from MSPluginTexmap.
{ delegate->LocalMappingsRequired(subMtlNum, mapreq, bumpreq); }
BOOL IsMultiMtl | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->IsMultiMtl(); }
void Update | ( | TimeValue | t, |
Interval & | valid | ||
) | [virtual] |
t | The current time. |
valid | The validity interval to update to reflect the validity interval of the material or texture at the time passed. |
Reimplemented from MSPluginTexmap.
void Reset | ( | ) | [inline, virtual] |
void DoubleSided::Reset() { dblsidedCD.Reset(this, TRUE); // Resets all pb2's Init(); }
Reimplemented from MSPluginTexmap.
Interval Validity | ( | TimeValue | t | ) | [virtual] |
t | Specifies the time about which to compute the validity interval. |
Reimplemented from MSPluginTexmap.
ParamDlg* CreateParamDlg | ( | HWND | hwMtlEdit, |
IMtlParams * | imp | ||
) | [virtual] |
hwMtlEdit | The window handle of the materials editor. |
imp | The interface pointer for calling methods in 3ds Max. |
Reimplemented from MSPluginTexmap.
Reimplemented from MSPluginTexmap.
{ return MSPluginTexmap::Save(isave); } // return delegate->Save(isave); }
Reimplemented from MSPluginTexmap.
{ return MSPluginTexmap::Load(iload); } // return delegate->Load(iload); }
ULONG GetGBufID | ( | ) | [inline] |
Reimplemented from MSPluginTexmap.
void SetGBufID | ( | ULONG | id | ) | [inline] |
Reimplemented from MSPluginTexmap.
void EnumAuxFiles | ( | AssetEnumCallback & | nameEnum, |
DWORD | flags | ||
) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ if ((flags&FILE_ENUM_CHECK_AWORK1)&&TestAFlag(A_WORK1)) return; // LAM - 4/21/03 ReferenceTarget::EnumAuxFiles(assetEnum, flags); }
PStamp* GetPStamp | ( | int | sz | ) | [inline, virtual] |
sz | One of the following values: PS_SMALL for small (32x32) images. PS_LARGE for large (88x88) images. PS_TINY for tiny (24x24) images. |
Reimplemented from MSPluginTexmap.
PStamp* CreatePStamp | ( | int | sz | ) | [inline] |
Reimplemented from MSPluginTexmap.
{ return delegate->CreatePStamp(sz); }
void DiscardPStamp | ( | int | sz | ) | [inline, virtual] |
sz | One of the following values: PS_SMALL for small (32x32) images. PS_LARGE for large (88x88) images. PS_TINY for tiny (24x24) images. |
Reimplemented from MSPluginTexmap.
{ delegate->DiscardPStamp(sz); }
int NumSubTexmaps | ( | ) | [virtual] |
Reimplemented from MSPluginTexmap.
Texmap* GetSubTexmap | ( | int | i | ) | [virtual] |
Reimplemented from MSPluginTexmap.
void SetSubTexmap | ( | int | i, |
Texmap * | m | ||
) | [virtual] |
Reimplemented from MSPluginTexmap.
MSTR GetSubTexmapSlotName | ( | int | i | ) | [virtual] |
Reimplemented from MSPluginTexmap.
BOOL SupportTexDisplay | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->SupportTexDisplay(); }
DWORD_PTR GetActiveTexHandle | ( | TimeValue | t, |
TexHandleMaker & | thmaker | ||
) | [inline, virtual] |
t | The time to return the texture handle. |
thmaker | This class provides methods for creating a texture handle from a 3ds Max bitmap and a Windows DIB. It also has a method to retrieve the required size of the texture map. See Class TexHandleMaker. |
Reimplemented from MSPluginTexmap.
{ return delegate->GetActiveTexHandle(t, thmaker); }
void ActivateTexDisplay | ( | BOOL | onoff | ) | [inline, virtual] |
onoff | TRUE if the texture is being used; FALSE if it is no longer being used. |
Reimplemented from MSPluginTexmap.
{ delegate->ActivateTexDisplay(onoff); }
BOOL SupportsMultiMapsInViewport | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->SupportsMultiMapsInViewport(); }
void SetupGfxMultiMaps | ( | TimeValue | t, |
Material * | mtl, | ||
MtlMakerCallback & | cb | ||
) | [inline, virtual] |
t | The time at which to evaluate the material. |
mtl | Points to the interactive renderer material to update. |
cb | This callback object is provided as a helper to fill in the Material properties above. See Class MtlMakerCallback. |
Reimplemented from MSPluginTexmap.
{ delegate->SetupGfxMultiMaps(t, mtl, cb); }
ReferenceTarget* GetRefTarget | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->GetRefTarget(); }
AColor EvalColor | ( | ShadeContext & | sc | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
float EvalMono | ( | ShadeContext & | sc | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
Point3 EvalNormalPerturb | ( | ShadeContext & | sc | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->EvalNormalPerturb(sc); }
BOOL HandleOwnViewPerturb | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->HandleOwnViewPerturb(); }
BITMAPINFO* GetVPDisplayDIB | ( | TimeValue | t, |
TexHandleMaker & | thmaker, | ||
Interval & | valid, | ||
BOOL | mono = FALSE , |
||
int | forceW = 0 , |
||
int | forceH = 0 |
||
) | [inline, virtual] |
Reimplemented from Texmap.
{ return delegate->GetVPDisplayDIB(t, thmaker, valid, mono, forceW, forceH); }
void GetUVTransform | ( | Matrix3 & | uvtrans | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{delegate->GetUVTransform(uvtrans); }
int GetTextureTiling | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->GetTextureTiling(); }
void InitSlotType | ( | int | sType | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ delegate->InitSlotType(sType); }
int GetUVWSource | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->GetUVWSource(); }
int GetMapChannel | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->GetMapChannel (); } // only relevant if above returns UVWSRC_EXPLICIT
UVGen* GetTheUVGen | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->GetTheUVGen(); } // maps with a UVGen should implement this
XYZGen* GetTheXYZGen | ( | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->GetTheXYZGen(); } // maps with a XYZGen should implement this
void SetOutputLevel | ( | TimeValue | t, |
float | v | ||
) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ delegate->SetOutputLevel(t, v); }
int LoadMapFiles | ( | TimeValue | t | ) | [inline, virtual] |
class MtlEnum { virtual void proc(MtlBase *m) = 0; }; void EnumMtlTree(MtlBase *mb, MtlEnum &tenum) { tenum.proc(mb); for (int i=0; i<mb->NumSubTexmaps(); i++) { Texmap *st = mb->GetSubTexmap(i); if (st) EnumMtlTree(st,tenum); } if (IsMtl(mb)) { Mtl *m = (Mtl *)mb; for (i=0; i<m->NumSubMtls(); i++) { Mtl *sm = m->GetSubMtl(i); if (sm) EnumMtlTree(sm,tenum); } } }
class RefEnumProc { virtual void proc(ReferenceMaker *rm)=0; }; void EnumRefs(ReferenceMaker *rm, RefEnumProc &proc) { proc.proc(rm); for (int i=0; i<rm->NumRefs(); i++) { ReferenceMaker *srm = rm->GetReference(i); if (srm) EnumRefs(srm,proc); } }
class MyEnum: public RefEnumProc { void proc(ReferenceMaker *rm) { // do something ... } } void afunction(Mtl* m) { MyEnum enumer; EnumRefs(m,&enumer); }
Reimplemented from MSPluginTexmap.
{ return delegate->LoadMapFiles(t); }
void RenderBitmap | ( | TimeValue | t, |
Bitmap * | bm, | ||
float | scale3D = 1.0f , |
||
BOOL | filter =
FALSE |
||
) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ delegate->RenderBitmap(t, bm, scale3D, filter); }
bool IsLocalOutputMeaningful | ( | ShadeContext & | sc | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->IsLocalOutputMeaningful( sc ); }
bool IsOutputMeaningful | ( | ShadeContext & | sc | ) | [inline, virtual] |
Reimplemented from MSPluginTexmap.
{ return delegate->IsOutputMeaningful( sc ); }
int IsHighDynamicRange | ( | ) | [inline] |
{ return delegate->IsHighDynamicRange( ); }