Public Types | Public Member Functions | Static Public Attributes

Interface8 Class Reference

Search for all occurrences

Detailed Description

The interface class for max version 8.

This interface should always be retrieved over Interface or Interface7 when programming against version 8 of the application. It features new functionality and deprecates obsolete functions.

#include <maxapi.h>

Inheritance diagram for Interface8:
Inheritance graph
[legend]

List of all members.

Public Types

enum   LoadFromFileFlags { kRefreshViewports = 0x01, kSuppressPrompts = 0x02, kUseFileUnits = 0x04, kSetCurrentFilePath = 0x08 }
 

Flags for LoadFromFile method.

More...

Public Member Functions

virtual void  ColorById (DWORD id, Color &c)=0
  This method returns the color corresponding to the id in input.
virtual void  RegisterExitMAXCallback (ExitMAXCallback2 *cb)=0
  Register a callback object to be called during max shutdown.
virtual void  UnRegisterExitMAXCallback (ExitMAXCallback2 *cb)=0
  Unregister a callback object to be called during max shutdown.
virtual bool  DoMaxSaveAsDialog (HWND parentWnd, const MSTR &title, MSTR &filename, MSTR &initialDir, FilterList &extensionList)=0
  Opens a max-style File Save As dialog for generic file types.
virtual bool  DoMaxOpenDialog (HWND parentWnd, const MSTR &title, MSTR &filename, MSTR &initialDir, FilterList &extensionList)=0
  Opens a max-style Open dialog for generic file types.
virtual void  RegisterModelessRenderWindow (HWND hWnd)=0
  Makes a window modeless during a render.
virtual void  UnRegisterModelessRenderWindow (HWND hWnd)=0
  Un-registers a window registered with RegisterModelessRenderWindow().
virtual bool  IsSavingToFile ()=0
  Returns whether a file save operation is currently in progress.
virtual bool  LoadFromFile (const MCHAR *szFilename, unsigned long lFlags)=0
  Loads the specified scene file.
virtual bool  RevealInExplorer (const MSTR &path)=0
  Opens a Windows Explorer window pointing to the passed in path.
Rendering
virtual int  QuickRender (TimeValue t=TIME_PosInfinity, Bitmap *rendbm=NULL, RendProgressCallback *prog=NULL)=0
  Launches a Quick Render, as though pressing the Quick Render button.
virtual void  GetRendFrameList (IntTab &frameNums)=0
  Enumerates the frames for rendering, as specified in the Render Dialog.
virtual RendProgressCallback GetRendProgressCallback ()=0
  Returns the custom progress callback, if any, used for rendering through the UI.
virtual void  SetRendProgressCallback (RendProgressCallback *prog)=0
  Sets a custom progress callback, used for rendering through the UI.
virtual INode GetRendCamNode ()=0
  Returns the custom camera node, if any, used for rendering through the UI.
virtual void  SetRendCamNode (INode *camNode)=0
  Sets a custom camera node, used for rendering through the UI.
virtual BOOL  GetRendUseImgSeq ()=0
  Returns the "Put Image File List(s) in Output Path(s)" setting in the render dialog.
virtual void  SetRendUseImgSeq (BOOL onOff)=0
  Sets the "Put Image File List(s) in Output Path(s)" setting in the render dialog.
virtual int  GetRendImgSeqType ()=0
  Returns the file format used when the renderer creates image sequence files.
virtual void  SetRendImgSeqType (int type)=0
  Sets the file format used when the renderer creates image sequence files.
virtual void  CreateRendImgSeq (CreateRendImgSeqCallback *cb=NULL)=0
  Saves image sequence files (in .imsq or .ifl format) based on the current output settings.
virtual const
MaxSDK::AssetManagement::AssetUser
GetPreRendScriptAsset ()=0
  Returns the AssetUser of the Pre-Render Script as indicated in the render dialog.
virtual void  SetPreRendScriptAsset (const MaxSDK::AssetManagement::AssetUser &script)=0
  Sets the AssetUser of the Pre-Render Script as shown in the render dialog.
virtual BOOL  GetUsePreRendScript ()=0
  Returns the Enable setting for the Pre-Render Script in the render dialog.
virtual void  SetUsePreRendScript (BOOL onOff)=0
  Sets the Enable setting for the Pre-Render Script in the render dialog.
virtual BOOL  GetLocalPreRendScript ()=0
  Returns the Execute Locally setting for the Pre-Render Script in the render dialog.
virtual void  SetLocalPreRendScript (BOOL onOff)=0
  Sets the Execute Locally setting for the Pre-Render Script in the render dialog.
virtual const
MaxSDK::AssetManagement::AssetUser
GetPostRendScriptAsset ()=0
  Returns the AssetUser of the Post-Render Script as indicated in the render dialog.
virtual void  SetPostRendScriptAsset (const MaxSDK::AssetManagement::AssetUser &script)=0
  Sets the filename of the Post-Render Script as shown in the render dialog.
virtual BOOL  GetUsePostRendScript ()=0
  Returns the Enable setting for the Post-Render Script in the render dialog.
virtual void  SetUsePostRendScript (BOOL onOff)=0
  Sets the Enable setting for the Post-Render Script in the render dialog.
Animation
virtual BOOL  GetControllerOverrideRangeDefault ()=0
  Retrieves whether or not newly created controllers will respect animation range.
virtual void  SetControllerOverrideRangeDefault (BOOL override)=0
  Sets whether or not newly created controllers will respect animation range.
virtual void  GetDefaultTangentType (int &dfltInTangentType, int &dfltOutTangentType)=0
  Get the default tangent type for both the "In" and the "Out" tangent.
virtual void  SetDefaultTangentType (int dfltInTangentType, int dfltOutTangentType, BOOL writeInCfgFile=TRUE)=0
  Set the default tangent type for both the "In" and the "Out" tangent.
virtual BOOL  GetSpringQuickEditMode () const =0
  Returns whether quick manipulation mode for spring controllers is on.
virtual void  SetSpringQuickEditMode (BOOL in_quickEdit)=0
  Sets quick manipulation mode for spring controllers.
virtual void  SetSpringRollingStart (int in_start)=0
  Sets the rolling start value of the quick manipulation mode for spring controllers.
virtual int  GetSpringRollingStart () const =0
  Returns the rolling start value of the quick manipulation mode for spring controllers.

Static Public Attributes

static CoreExport const
Interface_ID 
kInterface8InterfaceID
  The ID for this interface. Pass this ID to Interface::GetInterface to get an Interface8 pointer.

Protected Member Functions

Path Configuration deprecated functions
virtual const MCHAR *  GetDir (int which)=0
  This function has been deprecated. See IPathConfigMgr.
virtual int  GetPlugInEntryCount ()=0
  This function has been deprecated. See IPathConfigMgr.
virtual const MCHAR *  GetPlugInDesc (int i)=0
  This function has been deprecated. See IPathConfigMgr.
virtual const MCHAR *  GetPlugInDir (int i)=0
  This function has been deprecated. See IPathConfigMgr.
virtual BOOL  SetDir (int which, MCHAR *dir)=0
  This function has been deprecated. See IPathConfigMgr.
virtual MSTR  GetMAXIniFile ()=0
  This function has been deprecated. See IPathConfigMgr.

Member Enumeration Documentation

Flags for LoadFromFile method.

See also:
Interface8::LoadFromFile
Enumerator:
kRefreshViewports 

When this flag is set, the viewports are redrawn once the file is loaded.

kSuppressPrompts 

When this flag is set, messages about file unit mistmatch and obsolete file versions will be suppressed.

kUseFileUnits 

This flag is only valid in conjunction with kSuppressPrompts.

If the current scene's system units differ from those of the scene's being loaded, turning on this flag will cause the system unit scale of the incoming scene to be used (objects that are loaded are not scaled). Otherwise, the incoming scene's objects will be rescaled to the current scene's system unit.

kSetCurrentFilePath 

When this flag is set, the current file path is set to the one of the file that was loaded and the name of the file is displayed in the 3ds Max's title bar.

Otherwise, the current file path and the title bar are not modified. If the file is not loaded successfuly, or 3ds Max is working in network rendering mode, the current path and title bar are not modified.

Note:
Turning this flag off (not specifying it) has no effect in 3ds Max 2008.

Member Function Documentation

virtual int QuickRender ( TimeValue  t = TIME_PosInfinity,
Bitmap rendbm = NULL,
RendProgressCallback prog = NULL 
) [pure virtual]

Launches a Quick Render, as though pressing the Quick Render button.

Parameters:
[in] t The time to render the image. Pass TIME_PosInfinity or TIME_NegInfinity to use the current slider time
[in] rendbm The bitmap to render to, or NULL for default handling. If a bitmap is provided, the caller is responsible for displaying the VFB and saving the file.
[in] prog The RendProgressCallback is an optional callback. Pass NULL for the default render progress dialog
Returns:
The result of the render - Nonzero if success; otherwise 0.
virtual void GetRendFrameList ( IntTab frameNums ) [pure virtual]

Enumerates the frames for rendering, as specified in the Render Dialog.

Parameters:
[out] frameNums The frame number list; this is resized and set by the callee
virtual RendProgressCallback* GetRendProgressCallback ( ) [pure virtual]

Returns the custom progress callback, if any, used for rendering through the UI.

If NULL, the renderer will use its default progress dialog

virtual void SetRendProgressCallback ( RendProgressCallback prog ) [pure virtual]

Sets a custom progress callback, used for rendering through the UI.

This will be used when performing a render through the UI. If set to NULL, the renderer will use its default progress dialog

Parameters:
[in] prog The custom progress callback
virtual INode* GetRendCamNode ( ) [pure virtual]

Returns the custom camera node, if any, used for rendering through the UI.

If NULL, the renderer will render from a viewport by default

virtual void SetRendCamNode ( INode camNode ) [pure virtual]

Sets a custom camera node, used for rendering through the UI.

If NULL, the renderer will render from a viewport by default, but this allows for specifying a perspective other than one of the viewports.

Parameters:
[in] camNode The custom camera node
virtual BOOL GetRendUseImgSeq ( ) [pure virtual]

Returns the "Put Image File List(s) in Output Path(s)" setting in the render dialog.

virtual void SetRendUseImgSeq ( BOOL  onOff ) [pure virtual]

Sets the "Put Image File List(s) in Output Path(s)" setting in the render dialog.

When enabled, a sequence file (in .imsq or .ifl format) will be saved for frames stored during the render, including separate sequence files for the frames of each render element

Parameters:
[in] onOff TRUE to enable writing of sequence files, FALSE to disable
virtual int GetRendImgSeqType ( ) [pure virtual]

Returns the file format used when the renderer creates image sequence files.

For .imsq files this is 0, otherwise for .ifl files this is 1

virtual void SetRendImgSeqType ( int  type ) [pure virtual]

Sets the file format used when the renderer creates image sequence files.

Parameters:
[in] type The format type. For .imsq files pass 0, otherwise for .ifl files pass 1
virtual void CreateRendImgSeq ( CreateRendImgSeqCallback cb = NULL ) [pure virtual]

Saves image sequence files (in .imsq or .ifl format) based on the current output settings.

Equivalent to pressing the "Create Now" button for image sequence files in the render dialog

Parameters:
[in] cb An optional callback object to be called for each sequence file created
virtual const MaxSDK::AssetManagement::AssetUser& GetPreRendScriptAsset ( ) [pure virtual]

Returns the AssetUser of the Pre-Render Script as indicated in the render dialog.

virtual void SetPreRendScriptAsset ( const MaxSDK::AssetManagement::AssetUser script ) [pure virtual]

Sets the AssetUser of the Pre-Render Script as shown in the render dialog.

For non-network rendering, the script is executed once before rendering begins. For network rendering, if the Execute Locally is enabled, the script is executed once, before submission; otherwise the script is executed once on each remote machine the job is assigned to. The script is executed before any pre-render notifcations, but after sequence files (.imsq or .ifl) are written

Parameters:
[in] script The filename to set for the the pre-render script
virtual BOOL GetUsePreRendScript ( ) [pure virtual]

Returns the Enable setting for the Pre-Render Script in the render dialog.

virtual void SetUsePreRendScript ( BOOL  onOff ) [pure virtual]

Sets the Enable setting for the Pre-Render Script in the render dialog.

Parameters:
[in] onOff TRUE to enable the pre-render script, FALSE to disable
virtual BOOL GetLocalPreRendScript ( ) [pure virtual]

Returns the Execute Locally setting for the Pre-Render Script in the render dialog.

virtual void SetLocalPreRendScript ( BOOL  onOff ) [pure virtual]

Sets the Execute Locally setting for the Pre-Render Script in the render dialog.

This setting affects network rendering, causing the script to be executed once before submission, instead of once per machine the job is assigned to.

Parameters:
[in] onOff TRUE to enable local execution of the pre-render script, FALSE to disable
virtual const MaxSDK::AssetManagement::AssetUser& GetPostRendScriptAsset ( ) [pure virtual]

Returns the AssetUser of the Post-Render Script as indicated in the render dialog.

virtual void SetPostRendScriptAsset ( const MaxSDK::AssetManagement::AssetUser script ) [pure virtual]

Sets the filename of the Post-Render Script as shown in the render dialog.

The script is executed after any post-render notifcations.

Parameters:
[in] script The filename to set for the the post-render script
virtual BOOL GetUsePostRendScript ( ) [pure virtual]

Returns the Enable setting for the Post-Render Script in the render dialog.

virtual void SetUsePostRendScript ( BOOL  onOff ) [pure virtual]

Sets the Enable setting for the Post-Render Script in the render dialog.

Parameters:
[in] onOff TRUE to enable the post-render script, FALSE to disable
virtual BOOL GetControllerOverrideRangeDefault ( ) [pure virtual]

Retrieves whether or not newly created controllers will respect animation range.

Retrieves the default value of the animation preference which determines whether the active range of parametric controllers will be respected or not. This preference does not affect keyable controllers. When range is respected, the controller evaluation at a time before the activation range start time will return the value at start time and evaluation after activation range end time, the value at end time. Users can see the activation range of controllers as a black line in the Track View, in Dope Sheet mode, when Edit Ranges is on.

Returns:
- TRUE if by default, the animation range of controllers is not respected, FALSE otherwise
virtual void SetControllerOverrideRangeDefault ( BOOL  override ) [pure virtual]

Sets whether or not newly created controllers will respect animation range.

Sets the default value of the animation preference which determines whether the active range of parametric controllers will be respected or not

See also:
GetControllerOverrideRangeDefault()
Parameters:
override - If FALSE, the active range of parametric controllers will be respected by default, otherwise it won't
virtual void GetDefaultTangentType ( int &  dfltInTangentType,
int &  dfltOutTangentType 
) [pure virtual]

Get the default tangent type for both the "In" and the "Out" tangent.

This tangent type is the one that gets applied to any new animation key created in Max.

Parameters:
[out] dfltInTangentType - default type for the "In" tangent.
[out] dfltOutTangentType - default type for the "Out" tangent.
virtual void SetDefaultTangentType ( int  dfltInTangentType,
int  dfltOutTangentType,
BOOL  writeInCfgFile = TRUE 
) [pure virtual]

Set the default tangent type for both the "In" and the "Out" tangent.

This tangent type will get set on any animation key created in Max.

Parameters:
[in] dfltInTangentType - default type for the "In" tangent.
[in] dfltOutTangentType - default type for the "Out" tangent.
[in] writeInCfgFile - TRUE if tangent type values have to be written in the config file, FALSE otherwise.
virtual BOOL GetSpringQuickEditMode ( ) const [pure virtual]

Returns whether quick manipulation mode for spring controllers is on.

Retrieves the animation preference controlling whether spring systems used in spring controllers are in quick edit mode. The default is to be OFF. If turned on, then when something invalidates a spring controller, instead of recomputing the results from start as would be required to get the correct results, it resets the system a certain number of frames back (see GetSpringRollingStart() below). This can make a big difference in interactivity.

Returns:
- TRUE if the spring controllers are in quick edit mode
virtual void SetSpringQuickEditMode ( BOOL  in_quickEdit ) [pure virtual]

Sets quick manipulation mode for spring controllers.

Sets the animation preference controlling whether spring systems used in spring controllers will be accurate at all times.

Parameters:
[in] in_quickEdit - turn on spring quick edit mode.
virtual void SetSpringRollingStart ( int  in_start ) [pure virtual]

Sets the rolling start value of the quick manipulation mode for spring controllers.

Sets the animation preference controlling how many frames back the spring controllers will use as a rolling starting point for simulation if invalidated, if the Quick Edit option is on (see SetSpringQuickEditMode above).

Parameters:
[in] in_start - the number of frames back when restarting.
See also:
SetSpringQuickEditMode
virtual int GetSpringRollingStart ( ) const [pure virtual]

Returns the rolling start value of the quick manipulation mode for spring controllers.

Returns the animation preference controlling how many frames back the spring controllers will use as a rolling starting point for simulation

See also:
GetSpringQuickEditMode
virtual void ColorById ( DWORD  id,
Color c 
) [pure virtual]

This method returns the color corresponding to the id in input.

This function represents the color-id mapping that is done for :

  • The Material Id render element
  • The Object Id render element
  • The Material Effects and Object channels of the rpf format
    Parameters:
    [in] id - the id for which we want the color
    [out] c - the color corresponding to the id
virtual void RegisterExitMAXCallback ( ExitMAXCallback2 cb ) [pure virtual]

Register a callback object to be called during max shutdown.

See also:
ExitMAXCallback2, ExitMAXCallback
Parameters:
[in] cb - the ExitMAXCallback2 object
virtual void UnRegisterExitMAXCallback ( ExitMAXCallback2 cb ) [pure virtual]

Unregister a callback object to be called during max shutdown.

Parameters:
[in] cb - the ExitMAXCallback2 object
virtual bool DoMaxSaveAsDialog ( HWND  parentWnd,
const MSTR title,
MSTR filename,
MSTR initialDir,
FilterList extensionList 
) [pure virtual]

Opens a max-style File Save As dialog for generic file types.

Launches a generic File Save As dialog which supports arbitrary file types. The dialog includes 3ds Max specific browsing features such as browse history. When this function returns it will save the new filter index in FilterList's data member m_newFilterIndex. This will allow developers to save the new index by calling FilterList::GetNewFilterIndex() and thus setting the correct filter index (calling FilterList::SetFilterIndex()) when this function is called again. This makes sure the dialog is showing the correct file extension to be used.

Postcondition:
filename contains the long filename user selection if this function returns "true"; initialDir contains the path of the file selected, if this function returns true, otherwise it contains the original contents passed-in
Parameters:
[in] parentWnd The window handle which should be this dialog's parent window.
[in] title The string to be set as the title of this dialog.
[in,out] filename As an in parameter, can contain the long or short name of the file that should be default selection of the dialog. As an out parameter, filename contains the long name of the file selected by the user, if this function returns true
[in,out] initialDir As an in parameter, contains the initial dialog directory. If the user clicks OK, then this parameter contains the user selected directory path.
[in] extensionList A list of extensions supported by this dialog. See FilterList documentation for details.
Returns:
true if the user makes an acceptable choice, false if canceled
virtual bool DoMaxOpenDialog ( HWND  parentWnd,
const MSTR title,
MSTR filename,
MSTR initialDir,
FilterList extensionList 
) [pure virtual]

Opens a max-style Open dialog for generic file types.

Launches a generic Open dialog which supports arbitrary file types. The dialog includes 3ds Max specific browsing features such as browse history. When this function returns it will save the new filter index in FilterList's data member m_newFilterIndex. This will allow developers to save the new index by calling FilterList::GetNewFilterIndex() and thus setting the correct filter index (calling FilterList::SetFilterIndex()) when this function is called again. This makes sure the dialog is showing the correct file extension to be used.

Postcondition:
filename contains the long filename user selection if this function returns true; initialDir contains the path of the file selected, if this function returns "true", otherwise it contains the original contents passed-in
Parameters:
[in] parentWnd The window handle which should be this dialog's parent window.
[in] title The string to be set as the title of this dialog.
[in,out] filename As an in parameter, can contain the long or short name of the file that should be default selection of the dialog. As an out parameter, filename contains the long name of the file selected by the user, if this function returns true
[in,out] initialDir As an in parameter, contains the initial dialog directory. If the user clicks OK, then this parameter contains the user selected directory path.
[in] extensionList A list of extensions supported by this dialog. See FilterList documentation for details.
Returns:
true if the user makes an acceptable choice, false if canceled
virtual void RegisterModelessRenderWindow ( HWND  hWnd ) [pure virtual]

Makes a window modeless during a render.

When a render is in progress, window messages to all windows but the virtual frame buffer and the progress window are suppressed in order to make the render operation modal. This method may be used to make a window modeless during the render operation. All messages sent to the given window handle will no longer be suppressed by the render executer.

Note: A modeless render dialog should, ideally, only display certain statistics or messages. It is unsafe to do any complex operation or user interaction from a modeless dialog while rendering. That is why 3ds max blocks most window messages while rendering by default.

PS: Be sure to un-register your window with UnRegisterModelessRenderWindow() when it is destroyed.

Parameters:
[in] hWnd Handle to the window to be registered.
virtual void UnRegisterModelessRenderWindow ( HWND  hWnd ) [pure virtual]

Un-registers a window registered with RegisterModelessRenderWindow().

See the documentation of RegisterModelessRenderWindow() for more details.

Parameters:
[in] hWnd Handle to the window to be un-registered.
virtual bool IsSavingToFile ( ) [pure virtual]

Returns whether a file save operation is currently in progress.

Returns:
true if a file save operation is in progress.
virtual bool LoadFromFile ( const MCHAR *  szFilename,
unsigned long  lFlags 
) [pure virtual]

Loads the specified scene file.

See also:
Interface8::LoadFromFileFlags
Parameters:
[in] szFilename the file to load
[in] lFlags combination of Interface8::LoadFromFileFlags flags.
Returns:
true if success, false if there was an error
virtual bool RevealInExplorer ( const MSTR path ) [pure virtual]

Opens a Windows Explorer window pointing to the passed in path.

This is a utility function for opening a Windows Explorer window with a given path. The path can point to a folder, or it can be a full path to a file. If the file path doesn't exist, a warning dialog will open indicating that the path does not exist and the explorer will not open. The explorer is executed using a ShellExecute command, and is independent of the calling application. In other words, shutting down max will not result in the explorer app being shut down.

Precondition:
An absolute path value <= 256 characters. A zero length path will result in the explorer opening to the system-default drive (most likely C:\). An invalid path will result in a warning dialog, as described above.
Postcondition:
An explorer window opens to the location specified by the path.
Parameters:
[in] path An absolute path for the location used as the default browse location of the explorer.
Returns:
true if shell function returns a success code
virtual const MCHAR* GetDir ( int  which ) [protected, pure virtual]

This function has been deprecated. See IPathConfigMgr.

Path Configuration - see IPathConfigMgr The following methods are now grouped under the new interface IPathConfigMgr See this class for usage details and new functionality.

Implements Interface.

virtual int GetPlugInEntryCount ( ) [protected, pure virtual]

This function has been deprecated. See IPathConfigMgr.

Implements Interface.

virtual const MCHAR* GetPlugInDesc ( int  i ) [protected, pure virtual]

This function has been deprecated. See IPathConfigMgr.

Implements Interface.

virtual const MCHAR* GetPlugInDir ( int  i ) [protected, pure virtual]

This function has been deprecated. See IPathConfigMgr.

Implements Interface.

virtual BOOL SetDir ( int  which,
MCHAR *  dir 
) [protected, pure virtual]

This function has been deprecated. See IPathConfigMgr.

Implements Interface7.

virtual MSTR GetMAXIniFile ( ) [protected, pure virtual]

This function has been deprecated. See IPathConfigMgr.

Implements Interface7.


Member Data Documentation

CoreExport const Interface_ID kInterface8InterfaceID [static]

The ID for this interface. Pass this ID to Interface::GetInterface to get an Interface8 pointer.


Interface8 Interface8 Interface8 Interface8 Interface8 Interface8 Interface8 Interface8 Interface8 Interface8
Interface8 Interface8 Interface8 Interface8 Interface8 Interface8 Interface8 Interface8 Interface8 Interface8