User Tools

Site Tools


DzSaveFilter

Base class for all classes that save DAZ Script-based scene settings.

More...

Inherits :

Enumerations

Methods

Detailed Description

Save filter classes save out a subset of scene settings in a DAZ Script format such as poses, light sets, camera sets, etc.

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 );
}