User Tools

Site Tools


DzAssetIOMgr

Manager responsible for the asset filters that load/save DSON files.

More...

Inherits :

Enumerations

Static Methods

Methods

Signals

voidassetImported ()
voidassetImportStarting ()
voidassetLoadError ( String filename )
voidassetLoadFinished ( String filename )
voidassetLoadStarted ( String filename )
voidassetSaved ()
voidassetSaveError ( String filename )
voidassetSaveFinished ( String filename )
voidassetSaveStarted ( String filename )

Detailed Description

Responsible for the management of the filters that load/save assets in the native DAZ Scene Object Notation (DSON) format.

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

See Also:

Enumerations


: DzOpenMethod

Enumerated open methods.

  • DefaultMethod - If no nodes (or only the default camera) exist, this behaves as OpenNew. Otherwise, this behaves as MergeFile.
  • OpenNew - Resets the scene to its initial, clean state. All scene data is deleted and the undo stack is cleared.
  • MergeFile - Merges the file with any pre-existing elements in the scene.

Static Methods


DzAssetIOFilter : currentSaveFilter()

Return Value:

  • The current save filter (if any), otherwise null.

Since:

  • 4.15.0.16

Number : findAssetFilterIndex( String className )

Parameter(s):

  • className - The classname of the asset filter to find.

Return Value:

  • The index of the asset filter with the given classname (if any), otherwise -1.

Since:

  • 4.11.0.225

Number : findFilter( String className )

Deprecated

Exists only to keep old code working. Do not use in new code. Use getAssetFilter() instead.


QObject : findObjectInstance( DzUri uri )

Parameter(s):

  • uri - The URI of an asset instance to find during file load.

Return Value:

  • The object for the specified URI (if any), otherwise null.

Since:

  • 4.9.4.111

DzAssetIOFilter : getAssetFilter( Number i )

Parameter(s):

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

Return Value:

  • A new instance of the i'th asset filter in the list (if valid), otherwise null.

Attention:

  • You are responsible for deleting the returned instance (if any).

Since:

  • 4.11.0.225

String : getAssetFilterName( Number i )

Parameter(s):

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

Return Value:

  • The name of the i'th asset filter (if valid), otherwise an empty string.

Since:

  • 4.11.0.225

DzAssetIOFilter : getFilter( Number i )

Deprecated

Exists only to keep old code working. Do not use in new code. Use getAssetFilter() instead.


String : getFilterName( Number i )

Deprecated

Exists only to keep old code working. Do not use in new code. Use getAssetFilterName() instead.


Number : getNumAssetFilters()

Return Value:

  • The number of save filters currently supported.

Since:

  • 4.11.0.225

Number : getNumFilters()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getNumAssetFilters() instead.


Boolean : isReading()

Return Value:

  • if data is currently being read, otherwise false.

Since:

  • 4.15.0.16

Boolean : isReadingOrWriting()

Return Value:

  • if data is currently being read or written, otherwise false.

Since:

  • 4.15.0.16

Boolean : isWriting()

Return Value:

  • if data is currently being written, otherwise false.

Since:

  • 4.15.0.16

Methods


DzError : doLoad( String filename, DzOpenMethod method=DefaultMethod, DzFileLoadFilter filter=null )

Loads an asset file.

Parameter(s):

  • filename - The full name of the file to load.
  • method - The method to use for loading.
  • filter - The filter to use.

Return Value:

  • DZ_NO_ERROR if the file load was successful, otherwise an appropriate error code.

See Also:


DzError : doSave( Number filterIndex )

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

Parameter(s):

  • filterIndex - The index of the asset filter to use.

Return Value:

  • DZ_NO_ERROR if the file save was successful, otherwise an appropriate error code.

DzError : doSaveWithOptions( DzAssetIOFilter filter, DzFileIOSettings options, Boolean saveOnly=false, String filename=“”, String startingDir=“”, String category=“” )

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

Parameter(s):

  • filter - The filter to use.
  • options - The options to use.
  • saveOnly - Whether to only save the file, or to also create an associated icon and assign metadata.
  • filename - The full name of the file to save to.
  • startingDir - The path of the directory to start the save dialog in.
  • category - The category to assign the saved file to.

Return Value:

  • DZ_NO_ERROR if the file save was successful, otherwise an appropriate error code.

DzError : doSceneSaveAs()

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

Return Value:

  • DZ_NO_ERROR if the file save was successful, otherwise an appropriate error code.

DzAuthor : getCurrentAssetContributor()

Return Value:

See Also:

Since:

  • 4.15.0.16

String : getCurrentAssetId()

Return Value:

  • If isReadingOrWriting() is false, an empty string. If isReading() is true, the asset identifier for the file being read. If isWriting() is true, the asset identifier for the file being written.

See Also:

Since:

  • 4.15.0.16

DzVersion : getCurrentAssetRevision()

Return Value:

See Also:

Since:

  • 4.15.0.16

String : getCurrentAssetType()

Return Value:

  • If isReadingOrWriting() is false, an empty string. If isReading() is true, the asset type for the file being read. If isWriting() is true, the asset type for the file being written.

See Also:

Since:

  • 4.15.0.16

Object : getCurrentFileInfo()

Return Value:

  • If isReadingOrWriting() is false, an empty object. If isReading() is true, an object containing “file_version” and “asset_info” for the file being read. If isWriting() is true, an object containing “file_version” and “asset_info” for the file being written.

Since:

  • 4.15.0.16

String : getCurrentFilename()

Return Value:

  • The full name of the file that is currently being read from or written to (if any), otherwise an empty string.

Since:

  • 4.15.0.16

DzVersion : getCurrentFileVersion()

Return Value:

See Also:

Since:

  • 4.15.0.16

String : getDefaultDSONAssetCachePath()

Return Value:

  • The default path for the DSON assets cache.

String : getDSONAssetCachePath()

Return Value:

  • The path that the DSON assets cache resides in.

See Also:


DzAuthor : getFileAssetContributor( String filename )

Parameter(s):

  • filename - The full name of the file to retrieve the information from.

Return Value:

  • The “asset_info” contributor embedded in an asset file (if any), otherwise an invalid DzAuthor.

See Also:

Since:

  • 4.15.0.16

String : getFileAssetType( String filename )

Parameter(s):

  • filename - The full name of the file to retrieve the information from.

Return Value:

  • The “asset_info” type embedded in an asset file (if any), otherwise an empty string.

See Also:

Since:

  • 4.15.0.16

Object : getFileInfo( String filename )

Parameter(s):

  • filename - The full name of the file to retrieve the information from.

Return Value:

  • An object containing the “file_version” and “asset_info” embedded in the specified asset file (if any), otherwise an empty object. The “asset_info” only contains “type” and “contributor” values - it does not include the “id”, “revision”, or “modified” values.

Since:

  • 4.15.0.16

DzVersion : getFileVersion( String filename )

Parameter(s):

  • filename - The full name of the file to retrieve the information from.

Return Value:

  • The “file_version” embedded in an asset file (if any), otherwise an invalid DzVersion.

See Also:

Since:

  • 4.15.0.16

String : getLoadPath()

Return Value:

  • The path of the last directory that files were loaded from.

String : getSavePath()

Return Value:

  • The path of the last directory that files were saved to.

DzError : loadFromUri( DzUri fileUri, DzOpenMethod method=DefaultMethod, DzFileLoadFilter filter=null )

Loads an asset from URI.

Parameter(s):

  • fileUri - The URI of the file to load.
  • method - The method to use for loading.
  • filter - The filter to use.

Return Value:

  • DZ_NO_ERROR if the file load was successful, otherwise an appropriate error code.

See Also:


void : setDSONAssetCachePath( String cacheFullPath )

Sets the path for the DSON asset cache.

Parameter(s):

  • cacheFullPath - The path to set.

See Also:

Signals


void : assetImported()

Signature:“assetImported()”

Emitted when an asset has been loaded.


void : assetImportStarting()

Signature:“assetImportStarting()”

Emitted when an asset load is starting.


void : assetLoadError( String filename )

Signature:“assetLoadError(const QString&)”

Emitted when an asset load error occures.

Parameter(s):

  • filename - The relative path of the asset.

Since:

  • 4.15.0.16

void : assetLoadFinished( String filename )

Signature:“assetLoadFinished(const QString&)”

Emitted when an asset load is finished.

Parameter(s):

  • filename - The relative path of the asset.

Since:

  • 4.15.0.16

void : assetLoadStarted( String filename )

Signature:“assetLoadStarted(const QString&)”

Emitted when an asset load has started.

Parameter(s):

  • filename - The relative path of the asset.

Since:

  • 4.15.0.16

void : assetSaved()

Signature:“assetSaved()”

Emitted when an asset has been saved.


void : assetSaveError( String filename )

Signature:“assetSaveError(const QString&)”

Emitted when an asset save error occurs.

Parameter(s):

  • filename - The path of the asset.

Since:

  • 4.15.0.16

void : assetSaveFinished( String filename )

Signature:“assetSaveFinished(const QString&)”

Emitted when an asset save is finished.

Parameter(s):

  • filename - The path of the asset.

Since:

  • 4.15.0.16

void : assetSaveStarted( String filename )

Signature:“assetSaveStarted(const QString&)”

Emitted when an asset save has started.

Parameter(s):

  • filename - The path of the asset.

Since:

  • 4.15.0.16