User Tools

Site Tools


DzSaveFilter (deprecated)

Base class for filters that save script-based scene settings. (deprecated).

More...

Inherits :

Enumerations

Methods

Detailed Description

Deprecated

Save filters save out a subset of scene settings such as poses, light sets, camera sets, etc. in DAZ Script format. Script based presets are deprecated in favor of those in the DAZ Scene Object Notation (DSON) format.

See Also:

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

Methods


String : getDescription()

Return Value:

  • The name of the filter.

String : getLoadSavePath()

TODO: Add description.


void : setLoadSavePath( String path )

TODO: Add description.


DzError : writeFile( String filename, ScriptFileMode mode )

Saves to a file.

Parameter(s):

  • filename - Name of the file to export to.
  • mode - The type of file to save.

Return Value:

  • DZ_NO_ERROR on success, otherwise an error code.

Example:

Export a DAZ Script based Pose Preset.

var oSaveFilterMgr = App.getSaveFilterMgr();
var nSaveFilter = oSaveFilterMgr.findFilter( "DzPoseFilter" );
var oSaveFilter = oSaveFilterMgr.getFilter( nSaveFilter );
if( oSaveFilter ){
	oSaveFilter.writeFile( "c:/test", oSaveFilter.TextScriptFile );
}

DzError : writeFile( String filename, ScriptFileMode mode, DzFileIOSettings options )

Saves to a file.

Parameter(s):

  • filename - Name of the file to export to.
  • mode - The type of file to save.
  • options - The options for the save filter.

Return Value:

  • DZ_NO_ERROR on success, otherwise an error code.

Example:

Export a DAZ Script based Pose Preset, without displaying the Save Options dialog.

var oSaveFilterMgr = App.getSaveFilterMgr();
var nSaveFilter = oSaveFilterMgr.findFilter( "DzPoseFilter" );
var oSaveFilter = oSaveFilterMgr.getFilter( nSaveFilter );
if( oSaveFilter ){
	var oSettings = new DzFileIOSettings();
	//oSaveFilter.getDefaultOptions( oSettings );
	oSaveFilter.getOptions( oSettings, false, "c:/test" );
	oSaveFilter.writeFile( "c:/test", oSaveFilter.TextScriptFile, oSettings );
}