3ds Max C++ API Reference
IMtlParams Class Referenceabstract

#include <IMtlParams.h>

+ Inheritance diagram for IMtlParams:

Public Member Functions

virtual void MtlChanged ()=0
 
virtual HWND AddRollupPage (HINSTANCE hInst, const MCHAR *dlgTemplate, DLGPROC dlgProc, const MCHAR *title, LPARAM param=0, DWORD flags=0, int category=ROLLUP_CAT_STANDARD)=0
 
virtual HWND AddRollupPage (HINSTANCE hInst, DLGTEMPLATE *dlgTemplate, DLGPROC dlgProc, const MCHAR *title, LPARAM param=0, DWORD flags=0, int category=ROLLUP_CAT_STANDARD)=0
 
virtual void AddRollupPage (QWidget &qtWidget, const MCHAR *title, DWORD rollupFlags=0, int category=ROLLUP_CAT_STANDARD)=0
 Adds a rollup page that hosts a Qt dialog. More...
 
virtual HWND ReplaceRollupPage (HWND hOldRollup, HINSTANCE hInst, const MCHAR *dlgTemplate, DLGPROC dlgProc, const MCHAR *title, LPARAM param=0, DWORD flags=0, int category=ROLLUP_CAT_STANDARD)=0
 
virtual HWND ReplaceRollupPage (HWND hOldRollup, HINSTANCE hInst, DLGTEMPLATE *dlgTemplate, DLGPROC dlgProc, const MCHAR *title, LPARAM param=0, DWORD flags=0, int category=ROLLUP_CAT_STANDARD)=0
 
virtual void DeleteRollupPage (HWND hRollup)=0
 
virtual void DeleteRollupPage (QWidget &qtWidget)=0
 Removes a rollup page that hosts a Qt dialog. More...
 
virtual void RollupMouseMessage (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)=0
 
virtual int IsRollupPanelOpen (HWND hwnd)=0
 
virtual int GetRollupScrollPos ()=0
 
virtual void SetRollupScrollPos (int spos)=0
 
virtual void RegisterTimeChangeCallback (TimeChangeCallback *tc)=0
 
virtual void UnRegisterTimeChangeCallback (TimeChangeCallback *tc)=0
 
virtual void RegisterDlgWnd (HWND hDlg)=0
 
virtual int UnRegisterDlgWnd (HWND hDlg)=0
 
virtual TimeValue GetTime ()=0
 
virtual void SetPickMode (PickObjectProc *proc)=0
 
virtual void EndPickMode ()=0
 
virtual IRollupWindowGetMtlEditorRollup ()=0
 
virtual INT_PTR Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class Mtl, Materials, Textures and Maps, Class IRollupWindow.

Description:
This is the interface that is passed in to the material or texture map when it is in the material editor. All methods of this class are implemented by the system.

Member Function Documentation

◆ MtlChanged()

virtual void MtlChanged ( )
pure virtual
Remarks
This method may be called to causes the viewports to be redrawn. It should be called when any parameter that affects the look of the material in the viewport has been altered. If the material is not on a visible node in a shaded view, nothing will happen. This method should NOT be called as a spinner is being dragged, but only upon release of the mouse button.

◆ AddRollupPage() [1/3]

virtual HWND AddRollupPage ( HINSTANCE  hInst,
const MCHAR dlgTemplate,
DLGPROC  dlgProc,
const MCHAR title,
LPARAM  param = 0,
DWORD  flags = 0,
int  category = ROLLUP_CAT_STANDARD 
)
pure virtual
Remarks
This method may be called to add a rollup page to the material editor dialog. It returns the window handle of the dialog that makes up the rollup page.
Parameters:
HINSTANCE hInst

The DLL instance handle of the plug-in.

MCHAR *dlgTemplate

The dialog template for the rollup page.

DLGPROC dlgProc

The dialog proc to handle the message sent to the rollup page.

MCHAR *title

The title displayed in the title bar.

LPARAM param=0

Any specific data to pass along may be stored here. This may be later retrieved using the GetWindowLong() call from the Windows API.

DWORD flags=0

The following flag is defined:

APPENDROLL_CLOSED

Starts the page in the rolled up state.

int category = ROLLUP_CAT_STANDARD

The category parameter provides flexibility with regard to where a particular rollup should be displayed in the UI. RollupPanels with lower category fields will be displayed before RollupPanels with higher category fields. For RollupPanels with equal category value the one that was added first will be displayed first. Although it is possible to pass any int value as category there exist currently 5 different category defines: ROLLUP_CAT_SYSTEM, ROLLUP_CAT_STANDARD, and ROLLUP_CAT_CUSTATTRIB.

When using ROLLUP_SAVECAT, the rollup page will make the provided category sticky, meaning it will not read the category from the RollupOrder.cfg file, but rather save the category field that was passed as argument in the CatRegistry and in the RollupOrder.cfg file.

The method will take the category of the replaced rollup in case the flags argument contains ROLLUP_USEREPLACEDCAT. This is mainly done, so that this system works with param maps as well.
Returns
The window handle of the rollup page.

◆ AddRollupPage() [2/3]

virtual HWND AddRollupPage ( HINSTANCE  hInst,
DLGTEMPLATE *  dlgTemplate,
DLGPROC  dlgProc,
const MCHAR title,
LPARAM  param = 0,
DWORD  flags = 0,
int  category = ROLLUP_CAT_STANDARD 
)
pure virtual
Remarks
This method may be called to add a rollup page to the material editor dialog. It returns the window handle of the dialog that makes up the rollup page. This method is currently not used.
Parameters:
HINSTANCE hInst

The DLL instance handle of the plug-in.

DLGTEMPLATE *dlgTemplate

The dialog template for the rollup page.

DLGPROC dlgProc

The dialog proc to handle the message sent to the rollup page.

MCHAR *title

The title displayed in the title bar.

LPARAM param=0

Any specific data to pass along may be stored here. This may be later retrieved using the GetWindowLong() call from the Windows API.

DWORD flags=0

The following flag is defined:

APPENDROLL_CLOSED

Starts the page in the rolled up state.

int category = ROLLUP_CAT_STANDARD

The category parameter provides flexibility with regard to where a particular rollup should be displayed in the UI. RollupPanels with lower category fields will be displayed before RollupPanels with higher category fields. For RollupPanels with equal category value the one that was added first will be displayed first. Although it is possible to pass any int value as category there exist currently 5 different category defines: ROLLUP_CAT_SYSTEM, ROLLUP_CAT_STANDARD, and ROLLUP_CAT_CUSTATTRIB.

When using ROLLUP_SAVECAT, the rollup page will make the provided category sticky, meaning it will not read the category from the RollupOrder.cfg file, but rather save the category field that was passed as argument in the CatRegistry and in the RollupOrder.cfg file.

The method will take the category of the replaced rollup in case the flags argument contains ROLLUP_USEREPLACEDCAT. This is mainly done, so that this system works with param maps as well.
Returns
The window handle of the rollup page.

◆ AddRollupPage() [3/3]

virtual void AddRollupPage ( QWidget &  qtWidget,
const MCHAR title,
DWORD  rollupFlags = 0,
int  category = ROLLUP_CAT_STANDARD 
)
pure virtual

Adds a rollup page that hosts a Qt dialog.

Parameters
qtWidgetthe Qt widget that will be hosted in the rollup. This QWidget becomes the ownership of the system; it will be deleted by the system once no longer needed.
titleThe title string, displayed at the top of the rollup.l
rollupFlagsOptional rollup flags, such as APPENDROLL_CLOSED, DONTAUTOCLOSE, ROLLUP_SAVECAT, etc.
categoryThe category controls the ordering of the rollups, with lower values being inserted before rollups of higher category.
See also
void DeleteRollupPage(QWidget& qtWidget)

◆ ReplaceRollupPage() [1/2]

virtual HWND ReplaceRollupPage ( HWND  hOldRollup,
HINSTANCE  hInst,
const MCHAR dlgTemplate,
DLGPROC  dlgProc,
const MCHAR title,
LPARAM  param = 0,
DWORD  flags = 0,
int  category = ROLLUP_CAT_STANDARD 
)
pure virtual
Remarks
This method is used to replace the rollup page whose index is passed.
Parameters:
HWND hOldRollup

The handle to the rollup to replace.

HINSTANCE hInst

The DLL instance handle of the plug-in.

MCHAR *dlgTemplate

The dialog template for the rollup page.

DLGPROC dlgProc

The dialog proc to handle the message sent to the rollup page.

MCHAR *title

The title displayed in the title bar.

LPARAM param=0

Any specific data to pass along may be stored here.

DWORD flags=0

Append rollup page flags:

APPENDROLL_CLOSED

Starts the page in the rolled up state.

int category = ROLLUP_CAT_STANDARD

The category parameter provides flexibility with regard to where a particular rollup should be displayed in the UI. RollupPanels with lower category fields will be displayed before RollupPanels with higher category fields. For RollupPanels with equal category value the one that was added first will be displayed first. Although it is possible to pass any int value as category there exist currently 5 different category defines: ROLLUP_CAT_SYSTEM, ROLLUP_CAT_STANDARD, and ROLLUP_CAT_CUSTATTRIB.

When using ROLLUP_SAVECAT, the rollup page will make the provided category sticky, meaning it will not read the category from the RollupOrder.cfg file, but rather save the category field that was passed as argument in the CatRegistry and in the RollupOrder.cfg file.

The method will take the category of the replaced rollup in case the flags argument contains ROLLUP_USEREPLACEDCAT. This is mainly done, so that this system works with param maps as well.
Returns
The handle of the replacement page is returned.

◆ ReplaceRollupPage() [2/2]

virtual HWND ReplaceRollupPage ( HWND  hOldRollup,
HINSTANCE  hInst,
DLGTEMPLATE *  dlgTemplate,
DLGPROC  dlgProc,
const MCHAR title,
LPARAM  param = 0,
DWORD  flags = 0,
int  category = ROLLUP_CAT_STANDARD 
)
pure virtual
Remarks
This method is used to replace the rollup page whose index is passed. This method is currently not being used.
Parameters:
HWND hOldRollup

The handle to the rollup to replace.

HINSTANCE hInst

The DLL instance handle of the plug-in.

DLGTEMPLATE *dlgTemplate

The dialog template for the rollup page.

DLGPROC dlgProc

The dialog proc to handle the message sent to the rollup page.

MCHAR *title

The title displayed in the title bar.

LPARAM param=0

Any specific data to pass along may be stored here.

DWORD flags=0

Append rollup page flags:

APPENDROLL_CLOSED

Starts the page in the rolled up state.

int category = ROLLUP_CAT_STANDARD

The category parameter provides flexibility with regard to where a particular rollup should be displayed in the UI. RollupPanels with lower category fields will be displayed before RollupPanels with higher category fields. For RollupPanels with equal category value the one that was added first will be displayed first. Although it is possible to pass any int value as category there exist currently 5 different category defines: ROLLUP_CAT_SYSTEM, ROLLUP_CAT_STANDARD, and ROLLUP_CAT_CUSTATTRIB.

When using ROLLUP_SAVECAT, the rollup page will make the provided category sticky, meaning it will not read the category from the RollupOrder.cfg file, but rather save the category field that was passed as argument in the CatRegistry and in the RollupOrder.cfg file.

The method will take the category of the replaced rollup in case the flags argument contains ROLLUP_USEREPLACEDCAT. This is mainly done, so that this system works with param maps as well.
Returns
The handle of the replacement page is returned.

◆ DeleteRollupPage() [1/2]

virtual void DeleteRollupPage ( HWND  hRollup)
pure virtual
Remarks
This method may be called to remove a rollup page and destroy it.
Parameters:
HWND hRollup

The handle of the rollup window. This is the handle returned from AddRollupPage().

◆ DeleteRollupPage() [2/2]

virtual void DeleteRollupPage ( QWidget &  qtWidget)
pure virtual

Removes a rollup page that hosts a Qt dialog.

Remarks
The QWidget will get destroyed as a result of calling this.
See also
void AddRollupPage(QWidget& qtWidget, const MCHAR *title, DWORD rollupFlags, int category)

◆ RollupMouseMessage()

virtual void RollupMouseMessage ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
pure virtual
Remarks
This method allows hand cursor scrolling when the user clicks the mouse in an unused area of the dialog. When the user mouses down in dead area of the material editor, the plug-in should pass mouse messages to this function.

Note: In 3ds Max 2.0 and later only use of this method is no longer required – the functionality happens automatically.
Parameters:
HWND hDlg

The window handle of the dialog.

UINT message

The message sent to the dialog proc.

WPARAM wParam

Passed in to the dialog proc. Pass along to this method.

LPARAM lParam

Passed in to the dialog proc. Pass along to this method.
Example:
case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE:

im->iMtlParams->RollupMouseMessage(hDlg,message,wParam,lParam);

◆ IsRollupPanelOpen()

virtual int IsRollupPanelOpen ( HWND  hwnd)
pure virtual
Remarks
Returns nonzero if the rollup page whose handle is passed is open; otherwise zero.
Parameters:
HWND hwnd

The window handle of the rollup page to check.

◆ GetRollupScrollPos()

virtual int GetRollupScrollPos ( )
pure virtual
Remarks
Returns the rollup scroll position. This is used, for example, by the Standard material because it saves and restores the rollup page positions with the material. This is just a convenience for the user.

◆ SetRollupScrollPos()

virtual void SetRollupScrollPos ( int  spos)
pure virtual
Remarks
This method may be called to set the rollup scroll position. If the position was previously saved, this method may be called to restore it. The Standard material uses this method because it saves and restores the rollup positions with the material as a convenience for the user.
Parameters:
int spos

Specifies the rollup scroll position.

◆ RegisterTimeChangeCallback()

virtual void RegisterTimeChangeCallback ( TimeChangeCallback tc)
pure virtual
Remarks
Registers a callback object that will get called every time the current animation time is changed.
Parameters:
TimeChangeCallback *tc

The callback called when the time changes. See Class TimeChangeCallback.

◆ UnRegisterTimeChangeCallback()

virtual void UnRegisterTimeChangeCallback ( TimeChangeCallback tc)
pure virtual
Remarks
This method un-registers the time change callback.
Parameters:
TimeChangeCallback *tc

The callback called when the time changes. See Class TimeChangeCallback.

◆ RegisterDlgWnd()

virtual void RegisterDlgWnd ( HWND  hDlg)
pure virtual
Remarks
This is called automatically in AddRollupPage(), so a plug-in doesn't need to do it. It is now obsolete.
Parameters:
HWND hDlg

The handle of the dialog window.

◆ UnRegisterDlgWnd()

virtual int UnRegisterDlgWnd ( HWND  hDlg)
pure virtual
Remarks
This method is called automatically and is now obsolete.
Parameters:
HWND hDlg

The handle of the dialog window.

◆ GetTime()

virtual TimeValue GetTime ( )
pure virtual
Remarks
Returns the current time (the frame slider position).
Returns
The current time.

Pick an object from the scene

◆ SetPickMode()

virtual void SetPickMode ( PickObjectProc proc)
pure virtual
Remarks
Calling this methods puts the user into a pick mode where they can select items in the scene.
Parameters:
PickObjectProc *proc

This is the callback object for the picking. Its methods allow for filtering the picks, changing cursors over valid hits, and allowing multiple picks. See Class PickObjectProc.

◆ EndPickMode()

virtual void EndPickMode ( )
pure virtual
Remarks
This method is called to terminate the pick mode.

◆ GetMtlEditorRollup()

virtual IRollupWindow* GetMtlEditorRollup ( )
pure virtual
Remarks
This method returns an interface to Materials Editor rollup.

◆ Execute()

virtual INT_PTR Execute ( int  cmd,
ULONG_PTR  arg1 = 0,
ULONG_PTR  arg2 = 0,
ULONG_PTR  arg3 = 0 
)
inlinevirtual
394 { return 0; }