Class IRendParams

3DS Max Plug-In SDK

Class IRendParams

See Also: Class TimeChangeCallback, Class RendPickProc.

class IRendParams : public InterfaceServer

Description:

This is the interface given to a renderer, or atmospheric effect when it needs to display its parameters. For a renderer, the Render Scene dialog may be extended using this class. All methods of this class are implemented by the system.

Methods:

Prototype:

virtual TimeValue GetTime()=0;

Remarks:

Returns the current position of the frame slider.

Prototype:

virtual void RegisterTimeChangeCallback(TimeChangeCallback *tc)=0;

Remarks:

Register a callback object that will get called every time the user changes the frame slider.

Parameters:

TimeChangeCallback *tc

The callback object to register.

Prototype:

virtual void UnRegisterTimeChangeCallback(TimeChangeCallback *tc)=0;

Remarks:

Un-registers a callback object registered using RegisterTimeChangeCallback().

Parameters:

TimeChangeCallback *tc

The callback object to un-register.

Prototype:

virtual MtlBase *DoMaterialBrowseDlg(HWND hParent,DWORD flags,BOOL &newMat,BOOL &cancel)=0;

Remarks:

Brings up the material browse dialog allowing the user to select a material.

Parameters:

HWND hParent

The parent window handle.

DWORD flags

See List of Material Browser Flags.

BOOL &newMat

Set to TRUE if the material is new OR cloned; otherwise FALSE.

BOOL &cancel

Set to TRUE if the user cancels the dialog; otherwise FALSE.

Return Value:

The material returned will be NULL if the user selects 'None'

Prototype:

virtual HWND AddRollupPage(HINSTANCE hInst, TCHAR *dlgTemplate, DLGPROC dlgProc, TCHAR *title, LPARAM param=0,DWORD flags=0, int category = ROLLUP_CAT_STANDARD)=0;

Remarks:

This method adds rollup pages to the dialog and returns the window handle of the page.

Parameters:

HINSTANCE hInst

The DLL instance handle of the plug-in.

TCHAR *dlgTemplate

The dialog template for the rollup page.

DLGPROC dlgProc

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

TCHAR *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

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. Allthough 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.

Return Value:

The window handle of the rollup page.

Prototype:

virtual HWND AddRollupPage(HINSTANCE hInst, DLGTEMPLATE *dlgTemplate, DLGPROC dlgProc, TCHAR *title, LPARAM param=0,DWORD flags=0, int category = ROLLUP_CAT_STANDARD)=0;

Remarks:

This method is available in release 4.0 and later only.

This method adds rollup pages to the dialog and returns the window handle of the page. This method is currently not being 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.

TCHAR *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

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. Allthough 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.

Return Value:

The window handle of the rollup page.

Prototype:

virtual void DeleteRollupPage(HWND hRollup)=0;

Remarks:

Removes a rollup page and destroys it.

Parameters:

HWND hRollup

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

Prototype:

virtual void RollupMouseMessage(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)=0;

Remarks:

This 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 dialog, the plug-in should pass mouse messages to this function which will pass them on to the rollup.

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.

Prototype:

virtual void SetPickMode(RendPickProc *proc)=0;

Remarks:

This will set the command mode to a standard pick mode. The callback implements hit testing and a method that is called when the user actually picks an item.

Parameters:

RendPickProc *proc

The callback object. See Class RendPickProc.

Prototype:

virtual void EndPickMode()=0;

Remarks:

If a plug-in is finished editing its parameters it should not leave the user in a pick mode. This method will flush out any pick modes in the command stack.

Prototype:

virtual void PutMtlToMtlEditor(MtlBase *mb)=0;

Remarks:

When a plugin has a Texmap, clicking on the button associated with that map should cause this routine to be called.

Parameters:

MtlBase *mb

The MtlBase (Texmap or Mtl) to put to the materials editor.

Prototype:

virtual float GetMaxPixelSize() = 0;

Remarks:

This method is used internally.

Prototype:

virtual INT_PTR Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0);

Remarks:

This method is available in release 2.0 and later only.

This is a general purpose function that allows the API to be extended in the future. The 3ds max development team can assign new cmd numbers and continue to add functionality to this class without having to 'break' the API.

Parameters:

int cmd

The index of the command to execute.

ULONG arg1=0

Optional argument 1. See the documentation where the cmd option is discussed for more details on these parameters.

ULONG arg2=0

Optional argument 2.

ULONG arg3=0

Optional argument 3.

Return Value:

An integer return value. See the documentation where the cmd option is discussed for more details on the meaning of this value.