User Tools

Site Tools


DzImportMgr

Manager responsible for scene file importers.

More...

Inherits :

Static Methods

DAZ Script
BooleancanImport ( String filename )
DzImporterfindImporter ( String filename )
DzImporterfindImporterByClassName ( String className )
NumberfindImporterIndex ( String filename )
NumbergetNumImporters ()
voidmakeGeometryFileFilter ( DzFileFilter filter, String defaultFilter=“”, Boolean makeAllFilesEntry=true )
voidmakeImportFileFilter ( DzFileFilter filter, String defaultFilter=“”, Boolean makeAllFilesEntry=true )

Methods

DAZ Script
StringgetImportFileName ()
StringgetImportPath ()
BooleanisImporting ()
DzErrorreadFile ( String filename, Number importerIdx=-1 )
DzErrorreadFile ( String filename, Number importerIdx, DzFileIOSettings options )
DzShapereadGeometry ( String filename, Number importerIdx, DzFileIOSettings options )
DzShapereadGeometry ( String filename, Number importerIdx=-1 )
voidsetImportFileName ( String fileName )
voidsetImportPath ( String path )

Signals

Detailed Description

There is only one instance of this manager in an application. This instance is created and owned by DzApp. Request the instance via DzApp::getImportMgr().

See Also:

Static Methods


Boolean : canImport( String filename )

Calls recognize() on each of the importers and attempts to match an importer with the filename.

Parameter(s):

  • filename - The name of the file to try to find an importer for.

Return Value:

  • true if an importer was found that can read the given file.

DzImporter : findImporter( String filename )

Calls recognize() on each of the importers and attempts to match an importer with the filename.

Parameter(s):

  • filename - The name of the file to try to find an importer for.

Return Value:

  • A new instance of the matching importer, or NULL if none was found. The caller takes ownership of this pointer and is responsible for deleting it.

DzImporter : findImporterByClassName( String className )

Attempts to locate an importer class type by name.

Parameter(s):

  • className - The class name of the importer to find.

Return Value:

  • A new instance of the matching importer, or NULL if none was found. The caller takes ownership of this pointer and is responsible for deleting it.

Number : findImporterIndex( String filename )

Calls recognize() on each of the importers and attempts to match an importer with the filename.

Parameter(s):

  • filename - The name of the file to try to find an importer for.

Return Value:

  • The index of a matching importer, or -1 if none was found.

Number : getNumImporters()

Return Value:

  • The number of importers currently supported.

void : makeGeometryFileFilter( DzFileFilter filter, String defaultFilter=“”, Boolean makeAllFilesEntry=true )

Populates the given filter with all the geometry types recognized by the import manager.

Parameter(s):

  • filter - The filter to populate
  • defaultFilter - The filter to set as the default
  • makeAllFilesEntry - If true, an extra filter is appended to the list that matches all the valid extensions.

void : makeImportFileFilter( DzFileFilter filter, String defaultFilter=“”, Boolean makeAllFilesEntry=true )

Populates the given filter with all the types recognized by the import manager.

Parameter(s):

  • filter - The filter to populate
  • defaultFilter - The filter to set as the default
  • makeAllFilesEntry - If true, an extra filter is appended to the list that matches all the valid extensions.

Methods


String : getImportFileName()

Gets the full import file name.

Return Value:

  • The full import file name.

String : getImportPath()

Gets the default import directory - this is typically the last directory that the user imported a file from, and will be the directory that user will be taken to next time the file import dialog is displayed.

Return Value:

  • The current default directory that files are imported from.

Boolean : isImporting()

Return Value:

  • true if there is currently a file being imported, otherwise false.

DzError : readFile( String filename, Number importerIdx=-1 )

Import the contents of a file into the scene.

Parameter(s):

  • filename - The name of the file to import. This must be the full filename including the path to the file.
  • importerIdx - The index of the importer class to use. If this is less than 0, then the recognize function of the importer classes will be called with the fileName to attempt to find an appropriate importer.

Return Value:

  • DZ_NO_ERROR if the file import was successful.

DzError : readFile( String filename, Number importerIdx, DzFileIOSettings options )

Import the contents of a file into the scene.

Parameter(s):

  • filename - The name of the file to import. This must be the full filename including the path to the file.
  • importerIdx - The index of the importer class to use. If this is less than 0, then the recognize function of the importer classes will be called with the fileName to attempt to find an appropriate importer.
  • options - The options to use while importing the file.

Return Value:

  • DZ_NO_ERROR if the file import was successful.

DzShape : readGeometry( String filename, Number importerIdx, DzFileIOSettings options )

Reads the geometry file into a new shape.

Parameter(s):

  • filename - The full path of the file to import.
  • importerIdx - The index of the importer to use, if invalid (<0) the file's extension will be used to select an appropriate importer.
  • options - The options to use while importing the file.

Return Value:

  • The new shape that the geometry was read into, NULL on failure.

DzShape : readGeometry( String filename, Number importerIdx=-1 )

Reads the geometry file into a new shape.

Parameter(s):

  • filename - The full path of the file to import.
  • importerIdx - The index of the importer to use, if invalid (<0) the file's extension will be used to select an appropriate importer.

Return Value:

  • The new shape that the geometry was read into, NULL on failure.

void : setImportFileName( String fileName )

Sets the import file name - this is the full file name that file was import

Parameter(s):

  • fileName - The full file name.

void : setImportPath( String path )

Sets the default import directory - this is the directory that user will be taken to next time the file import dialog is displayed.

Parameter(s):

  • path - The new default path for importing files.

Signals


void : fileImported()

Signature:“fileImported()”

Emitted after importing a file. This may not always be emitted after every fileImportStarting() signal if there were errors during file loading.


void : fileImportStarting()

Signature:“fileImportStarting()”

Emitted just before importing a file.