Class SceneImport
See Also: Class ImpInterface, Class Interface.
class SceneImport
Description:
This is a base class for creating file import plug-ins. The plug-in implements methods of this class to describe the properties of the import plug-in and a method that handles the actual import process.
Methods:
Prototype:
SceneImport();
Remarks:
Constructor.
Prototype:
virtual ~SceneImport();
Remarks:
Destructor.
Prototype:
virtual int ExtCount() = 0;
Remarks:
Implemented by the Plug-In.
Returns the number of file name extensions supported by the plug-in.
Prototype:
virtual const TCHAR *Ext(int i) = 0;
Remarks:
Implemented by the Plug-In.
Returns the 'i-th' file name extension (i.e. "3DS").
Parameters:
int i
The index of the file name extension to return.
Prototype:
virtual const TCHAR *LongDesc() = 0;
Remarks:
Implemented by the Plug-In.
Returns a long ASCII description of the file type being imported (i.e. "Autodesk 3D Studio File").
Prototype:
virtual const TCHAR *ShortDesc() = 0;
Remarks:
Implemented by the Plug-In.
Returns a short ASCII description of the file type being imported (i.e. "3D Studio").
Prototype:
virtual const TCHAR *AuthorName() = 0;
Remarks:
Implemented by the Plug-In.
Returns the ASCII Author name.
Prototype:
virtual const TCHAR *CopyrightMessage() = 0;
Remarks:
Implemented by the Plug-In.
Returns the ASCII Copyright message for the plug-in.
Prototype:
virtual const TCHAR *OtherMessage1() = 0;
Remarks:
Implemented by the Plug-In.
Returns the first message string that is displayed.
Prototype:
virtual const TCHAR *OtherMessage2() = 0;
Remarks:
Implemented by the Plug-In.
Returns the second message string that is displayed.
Prototype:
virtual unsigned int Version() = 0;
Remarks:
Implemented by the Plug-In.
Returns the version number of the import plug-in. The format is the version number * 100 (i.e. v3.01 = 301).
Prototype:
virtual void ShowAbout(HWND hWnd) = 0;
Remarks:
Implemented by the Plug-In.
This method is called to have the plug-in display its "About..." box.
Parameters:
HWND hWnd
The parent window handle for the dialog.
Prototype:
virtual int DoImport(const TCHAR *name, ImpInterface *ii,Interface *i, BOOL suppressPrompts=FALSE) = 0;
Remarks:
Implemented by the Plug-In.
This method actually performs the file import.
Parameters:
const TCHAR *name
The file name chosen by the user to import.
ImpInterface *ii
An import interface pointer that may be used to create objects and nodes in the scene.
Interface *i
Pass the 3ds max interface pointer here.
BOOL suppressPrompts=FALSE
This parameter is available in release 2.0 and later only.
When TRUE, the plug-in must not display any dialogs requiring user input. It is up to the plug-in as to how to handle error conditions or situations requiring user input. This is an option set up for the 3ds max API in order for plug-in developers to create batch import plugins which operate unattended. See Interface::ImportFromFile().
Return Value:
One of the following three values should be returned
#define IMPEXP_FAIL 0
#define IMPEXP_SUCCESS 1
#define IMPEXP_CANCEL 2
Prototype:
virtual int ZoomExtents();
Remarks:
This method is available in release 3.0 and later only.
This method is used to control the zoom extents done after the import is accomplished. It returns a value that indicates if the plug-in should override the user preference setting.
Also see the method Interface::GetImportZoomExtents() which returns the state of the system zoom extents flag.
Return Value:
One of the following values:
ZOOMEXT_NOT_IMPLEMENTED
Indicates to use the preference setting.
ZOOMEXT_YES
Indicates to do a zoom extents after import regardless of the preference setting.
ZOOMEXT_NO
Indicates to not do a zoom extents regardless of the preference setting.
Default Implementation:
{ return ZOOMEXT_NOT_IMPLEMENTED; }