User Tools

Site Tools


DzSaveFilterMgr

Manager of all scene setting save filter classes.

More...

Inherits :

Enumerations

Static Methods

Methods

DAZ Script
DzErrordoSave ( Number filterIndex, String dir=“” )
StringgetSavePath ()
DzErrorwriteFile ( ScriptFileMode mode, String fileName, String filterName=“” )

Detailed Description

There is only one instance of this manager in an application. This instance is created and owned by DzApp. Don't create an instance of this class, but rather request a pointer to it from DzApp via DzApp::getSaveFilterMgr().

Example:

Getting the class names of all DzSaveFilter objects

var oSaveFilterMgr = App.getSaveFilterMgr();
var nSaveFilters = oSaveFilterMgr.getNumFilters();
var oSaveFilter = undefined;
for( var i = 0; i < nSaveFilters; i +=1 ){
	oSaveFilter = oSaveFilterMgr.getFilter( i );
	print( oSaveFilter.className() );
}

Enumerations


: ScriptFileMode

Save mode for saving the script to file. Values correspond with DzScript::ScriptFileMode.

  • UseExtension - If the file name extension is .dsb, the file is saved as DAZScriptFile, otherwise as TextScriptFile
  • TextScriptFile - Plain text file - no Unicode support
  • DAZScriptFile - Binary DAZ file format - supports Unicode characters
  • EncDAZScriptFile - Encrypted Binary DAZ file format - supports Unicode characters

Static Methods


Number : findFilter( String className )

Parameter(s):

  • className - The class name of the save filter to find.

Return Value:

  • The index of the save filter with the given class name.

DzSaveFilter : getFilter( Number i )

Parameter(s):

  • i - The index of the save filter to get.

Return Value:

  • A new instance of the i'th exporter in the list.

String : getFilterName( Number i )

Parameter(s):

  • i - The index of the save filter to get the name of.

Return Value:

  • The name of the i'th filter.

Number : getNumFilters()

Return Value:

  • The number of save filters currently supported.

Methods


DzError : doSave( Number filterIndex, String dir=“” )

Save the scene contents to a file with the given save filter. Prompts the user for a file to save to.

Parameter(s):

  • filterIndex - The index of the save filter class to use.
  • dir - The directory to start the file dialog in, if empty, the current load/save directory is used.

Return Value:

  • DZ_NO_ERROR if the file export was successful.

String : getSavePath()

Return Value:

  • Last directory that files were saved to.

DzError : writeFile( ScriptFileMode mode, String fileName, String filterName=“” )

Save the scene contents to a file with the given save filter.

Parameter(s):

  • mode - The file mode for saving the script
  • fileName - The name of the file to export to.
  • filterName - Optional argument. Class name of the filter to use, or no argument to show a choose filter dialog.

Return Value:

  • DZ_NO_ERROR if the file export was successfull.