This reference page is linked to from the following overview topics: Porting Simple Material and Texture Map Plug-ins to Nitrous, Porting Advanced Material and Texture Map Plug-ins to Nitrous, Parameter Flags, Principal Classes for Materials and Textures, Accessing Material Properties, Editing Material and Texture Parameters.
#include <imtl.h>
Public Member Functions |
|
CoreExport | MtlBase () |
CoreExport | ~MtlBase () |
CoreExport Class_ID | ClassID () |
Retrieves a constant that uniquely
identifies the plugin class. |
|
MSTR & | GetName () |
CoreExport void | SetName (MSTR s) |
CoreExport void | SetMtlFlag (int mask, BOOL val=TRUE) |
CoreExport void | ClearMtlFlag (int mask) |
CoreExport int | TestMtlFlag (int mask) |
int | GetMeditObjType () |
void | SetMeditObjType (int t) |
int | GetMeditTiling () |
void | SetMeditTiling (int t) |
CoreExport BOOL | AnyMulti () |
BOOL | TextureDisplayEnabled () |
virtual CoreExport MSTR | GetFullName () |
CoreExport MtlBase & | operator= (const MtlBase &m) |
virtual int | BuildMaps (TimeValue t, RenderMapsContext &rmc) |
virtual CoreExport ULONG | Requirements (int subMtlNum) |
virtual ULONG | LocalRequirements (int subMtlNum) |
virtual CoreExport void | MappingsRequired (int subMtlNum, BitArray &mapreq, BitArray &bumpreq) |
virtual void | LocalMappingsRequired (int subMtlNum, BitArray &mapreq, BitArray &bumpreq) |
virtual BOOL | IsMultiMtl () |
virtual int | MapSlotType (int i) |
CoreExport void | DeactivateMapsInTree () |
virtual void | Update (TimeValue t, Interval &valid)=0 |
virtual void | Reset ()=0 |
virtual Interval | Validity (TimeValue t)=0 |
virtual ParamDlg * | CreateParamDlg (HWND hwMtlEdit, IMtlParams *imp)=0 |
CoreExport IOResult | Save (ISave *isave) |
CoreExport IOResult | Load (ILoad *iload) |
ULONG | GetGBufID () |
void | SetGBufID (ULONG id) |
CoreExport void | EnumAuxFiles (AssetEnumCallback &nameEnum, DWORD flags) |
virtual CoreExport PStamp * | GetPStamp (int sz) |
virtual CoreExport PStamp * | CreatePStamp (int sz, BOOL Render=FALSE) |
virtual CoreExport void | DiscardPStamp (int sz) |
CoreExport SvGraphNodeReference | SvTraverseAnimGraph (IGraphObjectManager *gom, Animatable *owner, int id, DWORD flags) |
CoreExport bool | SvHandleDoubleClick (IGraphObjectManager *gom, IGraphNode *gNode) |
CoreExport MSTR | SvGetName (IGraphObjectManager *gom, IGraphNode *gNode, bool isBeingEdited) |
CoreExport bool | SvCanSetName (IGraphObjectManager *gom, IGraphNode *gNode) |
CoreExport bool | SvSetName (IGraphObjectManager *gom, IGraphNode *gNode, MSTR &name) |
CoreExport COLORREF | SvHighlightColor (IGraphObjectManager *gom, IGraphNode *gNode) |
CoreExport bool | SvIsSelected (IGraphObjectManager *gom, IGraphNode *gNode) |
Returns true if the object is selected in
its schematic view. |
|
CoreExport MultiSelectCallback * | SvGetMultiSelectCallback (IGraphObjectManager *gom, IGraphNode *gNode) |
CoreExport bool | SvCanSelect (IGraphObjectManager *gom, IGraphNode *gNode) |
virtual BOOL | SupportTexDisplay () |
virtual DWORD_PTR | GetActiveTexHandle (TimeValue t, TexHandleMaker &thmaker) |
CoreExport void | IncrActive () |
CoreExport void | DecrActive () |
int | Active () |
virtual void | ActivateTexDisplay (BOOL onoff) |
CoreExport MtlBase * | GetActiveMB () |
Get the active MtlBase. |
|
CoreExport void | SetActiveMB (MtlBase *activeMB) |
Set the active MtlBase. |
|
virtual BOOL | SupportsMultiMapsInViewport () |
virtual void | SetupGfxMultiMaps (TimeValue t, Material *mtl, MtlMakerCallback &cb) |
virtual void * | GetInterface (ULONG id) |
Inherited from Animatable. |
|
virtual BaseInterface * | GetInterface (Interface_ID id) |
Inherited from Animatable. |
|
virtual ReferenceTarget * | GetRefTarget () |
virtual CoreExport int | SetProperty (ULONG id, void *data) |
virtual CoreExport void * | GetProperty (ULONG id) |
virtual CoreExport void | BaseClone (ReferenceTarget *from, ReferenceTarget *to, RemapDir &remap) |
This method copies base class data from an
object to its clone. |
|
virtual BOOL | GetTransparencyHint (TimeValue t, Interval &valid) |
Transparency hint indicates whether the
material is potentially transparent for both rendering and viewport
display, so that the renderers or viewport can decide whether to
optimize it or not. |
|
Public Attributes |
|
Quat | meditRotate |
ULONG | gbufID |
Friends |
|
class | Texmap |
CoreExport MtlBase | ( | ) |
CoreExport ~MtlBase | ( | ) |
CoreExport Class_ID ClassID | ( | ) | [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 Animatable.
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
MSTR& GetName | ( | ) | [inline] |
{ return name; }
CoreExport void SetName | ( | MSTR | s | ) |
CoreExport void SetMtlFlag | ( | int | mask, |
BOOL | val = TRUE |
||
) |
mask | The flags to alter. See Material Flags. |
val | If TRUE the mask is ORed into the flags (mtlFlags |= mask); otherwise (mtlFlags &= ~mask). |
CoreExport void ClearMtlFlag | ( | int | mask | ) |
mask | The flags to clear. See Material Flags. |
CoreExport int TestMtlFlag | ( | int | mask | ) |
mask | The flags to test. |
int GetMeditObjType | ( | ) | [inline] |
{ return (mtlFlags&MTL_MEDIT_OBJTYPE_MASK)>>MTL_OBJTYPE_SHIFT; }
void SetMeditObjType | ( | int | t | ) | [inline] |
{ mtlFlags &= ~MTL_MEDIT_OBJTYPE_MASK; mtlFlags |= t<<MTL_OBJTYPE_SHIFT; }
int GetMeditTiling | ( | ) | [inline] |
{ return (mtlFlags&MTL_MEDIT_TILING_MASK)>>MTL_TILING_SHIFT; }
void SetMeditTiling | ( | int | t | ) | [inline] |
{ mtlFlags &= ~MTL_MEDIT_TILING_MASK; mtlFlags |= t<<MTL_TILING_SHIFT; }
CoreExport BOOL AnyMulti | ( | ) |
BOOL TextureDisplayEnabled | ( | ) | [inline] |
{ return TestMtlFlag(MTL_TEX_DISPLAY_ENABLED); }
virtual CoreExport MSTR GetFullName | ( | ) | [virtual] |
Reimplemented in MSPluginTexmap, and MSPluginMtl.
virtual 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 in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ return 1; }
virtual CoreExport ULONG Requirements | ( | int | subMtlNum | ) | [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 in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
virtual ULONG LocalRequirements | ( | int | subMtlNum | ) | [inline, virtual] |
subMtlNum | Specifies the number of the sub-material whose requirements should be returned. |
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ return 0; }
virtual CoreExport void MappingsRequired | ( | int | subMtlNum, |
BitArray & | mapreq, | ||
BitArray & | bumpreq | ||
) | [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. |
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
virtual 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 in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ }
virtual BOOL IsMultiMtl | ( | ) | [inline, virtual] |
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ return FALSE; }
virtual int MapSlotType | ( | int | i | ) | [inline, virtual] |
Implements ISubMap.
Reimplemented in Texmap.
{ return defaultSlotType; }
CoreExport void DeactivateMapsInTree | ( | ) |
virtual void Update | ( | TimeValue | t, |
Interval & | valid | ||
) | [pure 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. |
Implemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
virtual void Reset | ( | ) | [pure virtual] |
void DoubleSided::Reset() { dblsidedCD.Reset(this, TRUE); // Resets all pb2's Init(); }
Implemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
virtual Interval Validity | ( | TimeValue | t | ) | [pure virtual] |
t | Specifies the time about which to compute the validity interval. |
Implemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
virtual ParamDlg* CreateParamDlg | ( | HWND | hwMtlEdit, |
IMtlParams * | imp | ||
) | [pure virtual] |
hwMtlEdit | The window handle of the materials editor. |
imp | The interface pointer for calling methods in 3ds Max. |
Implemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
isave | An interface pointer available for saving data. See Class ISave, I/O Results. |
IOResult Gradient::Save(ISave *isave) { IOResult res; // Save common stuff isave->BeginChunk(MTL_HDR_CHUNK); res = MtlBase::Save(isave); if (res!=IO_OK) return res; isave->EndChunk(); for (int i=0; i<NSUBTEX; i++) { if (mapOn[i]==0) { isave->BeginChunk(MAPOFF_CHUNK+i); isave->EndChunk(); } } return IO_OK; }
Reimplemented from ReferenceMaker.
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
iload | An interface pointer for calling methods to load data. See Class ILoad, I/O Results. |
IOResult Gradient::Load(ILoad *iload) { IOResult res; int id; while (IO_OK==(res=iload->OpenChunk())) { switch(id = iload->CurChunkID()) { case MTL_HDR_CHUNK: res = MtlBase::Load(iload); break; case MAPOFF_CHUNK+0: case MAPOFF_CHUNK+1: case MAPOFF_CHUNK+2: mapOn[id-MAPOFF_CHUNK] = 0; break; } iload->CloseChunk(); if (res!=IO_OK) return res; } iload->RegisterPostLoadCallback(new ParamBlockPLCB(versions,NUM_OLDVERSIONS,&curVersion,this,1)); return IO_OK; }
Reimplemented from ReferenceMaker.
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
ULONG GetGBufID | ( | ) | [inline] |
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ return gbufID; }
void SetGBufID | ( | ULONG | id | ) | [inline] |
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ gbufID = id; }
CoreExport void EnumAuxFiles | ( | AssetEnumCallback & | nameEnum, |
DWORD | flags | ||
) | [virtual] |
Reimplemented from ReferenceMaker.
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
virtual CoreExport PStamp* GetPStamp | ( | int | sz | ) | [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 in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
virtual CoreExport PStamp* CreatePStamp | ( | int | sz, |
BOOL | Render =
FALSE |
||
) | [virtual] |
void DisplayMB(MtlBase *mb, HDC hdc, int x, int y) { mb->CreatePStamp(0,TRUE); // create and render a small pstamp PStamp *ps = mb->GetPStamp(0); if (ps) { int d = PSDIM(0); int scanw = ByteWidth(d); int nb = scanw*d; UBYTE *workImg = new UBYTE[nb]; if (NULL == workImg) return; ps->GetImage(workImg); Rect rect; rect.left = x; rect.top = y; rect.right = x+d; rect.bottom = y+d; GetGPort()->DisplayMap(hdc, rect,0,0, workImg, scanw); delete [] workImg; } }
sz | One of the following values: PS_SMALL for small (32x32) images. PS_LARGE for large (88x88) images. PS_TINY for tiny (24x24) images. |
Render | If set to true, the postage stamp bitmap will have the MtlBase rendered into it automatically. The bitmap can then be retrieved using PStamp::GetImage, for drawing in the UI. |
virtual CoreExport void DiscardPStamp | ( | int | sz | ) | [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 in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
CoreExport SvGraphNodeReference SvTraverseAnimGraph | ( | IGraphObjectManager * | gom, |
Animatable * | owner, | ||
int | id, | ||
DWORD | flags | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
owner | The owning animatable. |
id | This is usually the sub-anim number (but can actually be any value the developer chooses). |
flags | See List of Schematic %View AddAnimatable Flags. |
Reimplemented from Animatable.
Reimplemented in Texmap, UVGen, XYZGen, and TextureOutput.
CoreExport bool SvHandleDoubleClick | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to the node in the schematic view. |
Reimplemented from Animatable.
CoreExport MSTR SvGetName | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode, | ||
bool | isBeingEdited | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to this node in the schematic view. |
isBeingEdited | TRUE if the item is being edited; FALSE if not. |
{ Animatable *owner; int subNum; MSTR name; owner = gNode->GetOwner(); subNum = gNode->GetID(); name = owner->SubAnimName(subNum); return name; }
Reimplemented from Animatable.
Reimplemented in UVGen, XYZGen, and TextureOutput.
CoreExport bool SvCanSetName | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to this node in the schematic view. |
Reimplemented from Animatable.
CoreExport bool SvSetName | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode, | ||
MSTR & | name | ||
) | [virtual] |
gom< | Points to the schematic view window manager. |
gNode | Points to this node in the schematic view. |
name | The new name to set. |
Reimplemented from Animatable.
CoreExport COLORREF SvHighlightColor | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to this node in the schematic view. |
Reimplemented from Animatable.
CoreExport bool SvIsSelected | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
Returns true if the object is selected in its schematic view.
Reimplemented from Animatable.
CoreExport MultiSelectCallback* SvGetMultiSelectCallback | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to the node in the schematic view. |
Reimplemented from Animatable.
CoreExport bool SvCanSelect | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to the node in the schematic view. |
Reimplemented from Animatable.
virtual BOOL SupportTexDisplay | ( | ) | [inline, virtual] |
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ return FALSE; } // supports map display in viewport
virtual 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 in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{return 0;}
CoreExport void IncrActive | ( | ) |
CoreExport void DecrActive | ( | ) |
int Active | ( | ) | [inline] |
virtual void ActivateTexDisplay | ( | BOOL | onoff | ) | [inline, virtual] |
onoff | TRUE if the texture is being used; FALSE if it is no longer being used. |
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{}
CoreExport MtlBase* GetActiveMB | ( | ) |
CoreExport void SetActiveMB | ( | MtlBase * | activeMB | ) |
virtual BOOL SupportsMultiMapsInViewport | ( | ) | [inline, virtual] |
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ return FALSE; }
virtual 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 in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{}
virtual void* GetInterface | ( | ULONG | id | ) | [inline, virtual] |
Inherited from Animatable.
Returns a pointer to the interface.
id | - The id of the interface. |
Reimplemented from ReferenceTarget.
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{ if(id==I_SUBMAP) return (ISubMap*)this; else return ReferenceTarget::GetInterface(id); }
virtual BaseInterface* GetInterface | ( | Interface_ID | id | ) | [inline, virtual] |
Inherited from Animatable.
Returns a pointer to the Base Interface for the interface ID passed.
id | - The unique ID of the interface to get |
Reimplemented from ReferenceTarget.
Reimplemented in MSMtlXtnd.
{ return ReferenceTarget::GetInterface(id); }
virtual ReferenceTarget* GetRefTarget | ( | ) | [inline, virtual] |
Implements ISubMap.
Reimplemented in MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.
{return this;}
virtual CoreExport int SetProperty | ( | ULONG | id, |
void * | data | ||
) | [virtual] |
id | The id for the property. |
data | A pointer to the data to store. |
int PathPosition::SetProperty(ULONG id, void *data) { if (id==PROPID_JOINTPARAMS) { if (!data) { int index = aprops.FindProperty(id); if (index>=0) { aprops.Delete(index,1); } } else { JointParamsPath *jp = (JointParamsPath*)GetProperty(id); if (jp) { *jp = *((JointParamsPath*)data); delete (JointParamsPath*)data; } else { aprops.Append(1,(AnimProperty**)&data); } } return 1; } else if (id==PROPID_INTERPUI) { if (!data) { int index = aprops.FindProperty(id); if (index>=0) { aprops.Delete(index,1); } } else { InterpCtrlUI *ui = (InterpCtrlUI*)GetProperty(id); if (ui) { *ui = *((InterpCtrlUI*)data); } else { aprops.Append(1,(AnimProperty**)&data); } } return 1; } else { return Animatable::SetProperty(id,data); } }
Reimplemented from Animatable.
Reimplemented in MSMtlXtnd.
virtual CoreExport void* GetProperty | ( | ULONG | id | ) | [virtual] |
id | The id of the property to retrieve. |
void* PathPosition::GetProperty(ULONG id) { if (id==PROPID_INTERPUI || id==PROPID_JOINTPARAMS) { int index = aprops.FindProperty(id); if (index>=0) { return aprops[index]; } else { return NULL; } } else { return Animatable::GetProperty(id); } }
Reimplemented from Animatable.
Reimplemented in MSMtlXtnd.
virtual CoreExport void BaseClone | ( | ReferenceTarget * | from, |
ReferenceTarget * | to, | ||
RemapDir & | remap | ||
) | [virtual] |
This method copies base class data from an object to its clone.
This method is available in release 4.0 and later only. Virtual method.
from | - Points to the old object to clone. |
to | - Points to the new object created. |
remap | - This class is used for remapping references during a Clone. |
Reimplemented from ReferenceTarget.
virtual BOOL GetTransparencyHint | ( | TimeValue | t, |
Interval & | valid | ||
) | [inline, virtual] |
Transparency hint indicates whether the material is potentially transparent for both rendering and viewport display, so that the renderers or viewport can decide whether to optimize it or not.
t | The time to get the transparency hint at. |
valid | The validity interval of the returned value. |
{ return TRUE; }
friend class Texmap [friend] |