Manager responsible for folders and files associated with “content.”.
Inherits :
DAZ Script | |
---|---|
String | getCloudPathPrefix () |
String | getContentPath ( DzNode node ) |
void | autoRefreshChanged ( Boolean onOff ) |
void | cloudContentDirectoryChanged () |
void | contentDirectoryListChanged () |
void | folderTreeChanged () |
void | importDirectoryListChanged () |
void | loadScriptFinished () |
void | loadScriptStarting () |
void | mdlDirectoryListChanged () |
void | newFileCreated ( String filename ) |
void | onNewSceneChanged ( String filename ) |
void | poserDirectoryListChanged () |
void | recentFileListChanged () |
void | scriptFailed ( String filename ) |
void | scriptFinished ( String filename ) |
void | scriptLoadFailed ( String filename ) |
void | scriptLoadStarting ( String filename ) |
void | scriptStarting ( String filename ) |
void | startupSceneChanged ( String filename ) |
Responsible for the management of folder/file hierarchies associated with “content” (digital assets).
There is only one instance of this manager in an application. This instance is created and owned by DzApp. Request the instance via DzApp::getContentMgr().
See Also:
The types of directories that can be specified when working with this manager.
Holds whether or not the content manager automatically refreshes itself.
Holds the maximum length of the File > Open Recent submenu, in the main menu bar.
Holds the path of the scene that will load when the scene is cleared (if any).
Since:
Holds whether or not the built-in content is shown in the content panes.
Holds the path of the scene that will load on startup (if any).
Return Value:
Since:
String : getContentPath( DzNode node )
Checks the given node for a source file data item, and returns the path of the source file if one is found.
Parameter(s):
Return Value:
void : addContentDirectory( String directory, Boolean saveSetting=true )
Adds a native content directory to the list.
Parameter(s):
true
, causes the native content directory mappings to be saved immediately instead of when the application is closed.void : addImportDirectory( String directory, Boolean saveSetting=true )
Adds an import directory to the list.
Parameter(s):
true
, causes the Import directory mappings to be saved immediately instead of when the application is closed.void : addMDLDirectory( String directory, Boolean saveSetting=true )
Adds a directory where MDL files can reside to the list.
Parameter(s):
true
, causes the MDL directory mappings to be saved immediately instead of when the application is closed.Since:
void : addPoserDirectory( String directory, Boolean saveSetting=true )
Adds a Poser import content directory to the list.
Parameter(s):
true
, causes the Poser directory mappings to be saved immediately instead of when the application is closed.Attention:
void : addRecentFile( String filename )
Adds a file to the list of recent open files.
Parameter(s):
void : clearRecentFileList()
Clears the list of recent open files.
Boolean : contentDirectoryIsMapped( String dirPath )
Attempts to locate dirPath
among the mapped native content directories.
Parameter(s):
Return Value:
true
if the directory is mapped as a native content directory, otherwise false
.Since:
Displays a dialog to the user to perform a Poser content search on the local machine.
Return Value:
true
if the user accepted and a search was performed, otherwise false
.void : doDirNumCheck()
Causes the content manager to check the number of mapped content directories, and display a warning to the user if it is excessive.
void : fileCreated( String filename )
Notifies the content manager that a new content file has been saved.
DzContentFolder : findBaseDirectory( DirectoryTypes dirTypes, String path )
Given an absolute path, this method traverses the content directories and attempts to find the base (mapped) folder.
Parameter(s):
Return Value:
Since:
DzContentFolder : findBaseDirectory( String path, Boolean useImportFolders )
Given an absolute path, this method traverses the content directories and attempts to find the base (mapped) folder.
Parameter(s):
true
, the import folders will also be searched.Return Value:
String : findFile( String partialPath, DirectoryTypes dirTypes=CloudNativeAndBuiltInDirs )
Given a partial path (a file path that is relative to a content directory) this function traverses all folders of the specified mapped directory types in the following order (CloudDB, CloudDir, NativeDirs, PoserDirs, ImportDirs, MDLDirs, BuiltInDirs)
Parameter(s):
Return Value:
See Also:
String : findSourcePathForNode( DzNode sceneNode )
Finds the source path for a node in the scene.
Parameter(s):
Return Value:
String : getAbsolutePath( DirectoryTypes dirTypes, String relativePath, String preferredPath=“” )
Attempts to locate relativePath
by pre-pending the path information for each mapped content directory.
Parameter(s):
Return Value:
Since:
String : getAbsolutePath( String relativePath, Boolean useImportFolders, String preferredPath=“” )
Attempts to locate relativePath
by pre-pending the path information for each mapped content directory.
Parameter(s):
true
, the mapped import folders will also be searched.Return Value:
Array : getAbsolutePaths( DirectoryTypes dirTypes, String relativePath )
Attempts to locate relativePath
by pre-pending the path information for each mapped content directory.
Parameter(s):
Return Value:
Since:
Array : getAbsolutePaths( String relativePath, Boolean useImportFolders )
Attempts to locate relativePath
by pre-pending the path information for each mapped directory.
Parameter(s):
true
, the mapped import folders will also be searched.Return Value:
DzUri : getAbsoluteUri( DirectoryTypes dirTypes, String relativePath, String preferredPath=“” )
Attempts to locate relativePath
by pre-pending the path information for each mapped content directory.
Parameter(s):
Return Value:
Since:
DzContentFolder : getBuiltInContentDirectory()
Return Value:
String : getBuiltInContentDirectoryPath()
Return Value:
DzContentFolder : getBuiltInMDLDirectory( Number which )
Parameter(s):
Return Value:
Since:
String : getBuiltInMDLDirectoryPath( Number which )
Parameter(s):
Return Value:
Since:
String : getCloudAbsolutePath( String relativePath )
Attempts to locate relativePath
by pre-pending the path information for the mapped cloud directory.
Parameter(s):
Return Value:
Since:
DzContentFolder : getCloudContentDirectory()
Return Value:
Since:
String : getCloudContentDirectoryPath()
Return Value:
Since:
String : getCloudRelativePath( String absolutePath )
Attempts to shorten absolutePath
to a path that is relative to the cloud directory. If the path cannot be shortened, the original string is returned.
Parameter(s):
Return Value:
Since:
DzContentFolder : getContentDirectory( Number which )
Parameter(s):
Return Value:
String : getContentDirectoryPath( Number which )
Parameter(s):
Return Value:
DzContentReplaceMgr : getContentReplaceMgr()
Return Value:
String : getDefaultContentDirectoryPath()
Return Value:
String : getDefaultSharedContentDirectoryPath()
Return Value:
Since:
Array : getDirectoryContentsUrisList( DirectoryTypes dirTypes, Array relativeDirPaths, Array fileSuffixes )
Parameter(s):
Return Value:
Since:
String : getImportAbsolutePath( String relativePath )
Attempts to locate a file with the given relative path by pre-pending the path information for each mapped import directory, finally falling back to the Built-In content directory.
Parameter(s):
Return Value:
DzContentFolder : getImportDirectory( Number which )
Parameter(s):
Return Value:
String : getImportDirectoryPath( Number which )
Parameter(s):
Return Value:
Array : getImportFileExtensions()
Return Value:
Attention:
See Also:
Since:
String : getMappedPath( String path, Boolean useImportFolders, Boolean isRelative )
Attempts to extract the mapped directory portion of path
.
Parameter(s):
true
, the import folders will also be searched.true
, path
is treated as a relative path. If false
, path
is treated as an absolute path.Return Value:
String : getMappedPath( DirectoryTypes dirTypes, String path, Boolean isRelative )
Attempts to extract the mapped directory portion of path
.
Parameter(s):
true
, path
is treated as a relative path. If false
, path
is treated as an absolute path.Return Value:
String : getMDLAbsolutePath( String relativePath )
Attempts to locate a file with the given relative path by pre-pending the path information for each mapped MDL directory, as well as the built-in MDL directories, finally falling back to the built-in content directory.
Parameter(s):
Return Value:
DzContentFolder : getMDLDirectory( Number which )
Parameter(s):
Return Value:
Since:
String : getMDLDirectoryPath( Number which )
Parameter(s):
Return Value:
Since:
String : getMDLRelativePath( String absolutePath )
Attempts to shorten absolutePath
to a path that is relative to one of the mapped MDL directories. If the path cannot be shortened, the original string is returned.
Parameter(s):
Return Value:
Since:
String : getNativeAbsolutePath( String relativePath )
Attempts to locate relativePath
by pre-pending the path information for each mapped native directory, finally falling back to the Built-In content directory.
Parameter(s):
Return Value:
Array : getNativeBaseUserFacingExcludedDirs()
Return Value:
Since:
Array : getNativeFileExtensions()
Return Value:
Since:
Number : getNumBuiltInMDLDirectories()
Return Value:
Since:
Number : getNumContentDirectories()
Return Value:
Number : getNumImportDirectories()
Return Value:
Number : getNumMDLDirectories()
Return Value:
Since:
Number : getNumPoserDirectories()
Return Value:
String : getPoserAbsolutePath( String relativePath )
Attempts to locate a file with the given relative path by pre-pending the path information for each mapped Poser directory, finally falling back to the Built-In content directory.
Parameter(s):
Return Value:
Array : getPoserBaseUserFacingDirs()
Return Value:
Since:
DzContentFolder : getPoserDirectory( Number which )
Parameter(s):
Return Value:
String : getPoserDirectoryPath( Number which )
Parameter(s):
Return Value:
Array : getPoserFileExtensions()
Return Value:
Since:
Return Value:
String : getRelativePath( String absolutePath, Boolean useImportFolders )
Attempts to shorten absolutePath
to a path that is relative to one of the mapped content directories. If the path cannot be shortened, the original string is returned.
Parameter(s):
true
, the mapped import folders will also be searched.Return Value:
absolutePath
.String : getRelativePath( DirectoryTypes dirTypes, String absolutePath )
Attempts to shorten absolutePath
to a path that is relative to one of the mapped content directories. If the path cannot be shortened, the original path is returned.
Parameter(s):
Return Value:
absolutePath
.Since:
Array : getRelativePaths( DirectoryTypes dirTypes, String absolutePath )
Attempts to shorten absolutePath
to a list of paths that are relative to one of the mapped content directories.
Parameter(s):
Return Value:
absolutePath
.Since:
Array : getRelativePaths( String absolutePath, Boolean useImportFolders )
Attempts to shorten absolutePath
to a list of paths that are relative to one of the mapped content directories.
Parameter(s):
true
, the mapped import folders will also be searched.Return Value:
Array : getRelativeUrisList( DirectoryTypes dirTypes, Array relDirPaths, DzDir::Filters filters, Array suffixes, Boolean recurse )
Parameter(s):
Return Value:
Since:
Boolean : importDirectoryIsMapped( String dirPath )
Attempts to locate dirPath
among the mapped import directories.
Parameter(s):
Return Value:
true
if the directory is mapped as an import directory, otherwise false
.Since:
Boolean : importFile( String path )
Imports the file at the given path. A companion file (a DAZ Script file with the same name as the file being imported, or a DUF file if a DAZ Script does not exist) will be executed if one exists. This function should only be used in special circumstances. Use openFile() instead.
Parameter(s):
Return Value:
true
if the file was imported successfully, otherwise false
.See Also:
Boolean : isDirectoryMapped( String directory )
Parameter(s):
Return Value:
true
if directory
is mapped, otherwise false
.Boolean : isUserFacingDirectoryPath( DirectoryTypes dirTypes, String relativePath )
Parameter(s):
Return Value:
true
if relativePath
is considered “user facing” for the given directory type.Since:
Boolean : isUserFacingFilePath( DirectoryTypes dirTypes, String relativePath )
Parameter(s):
Return Value:
true
if relativePath
is considered “user facing” for the given directory type.Since:
Boolean : loadAsset( DzAsset asset, Boolean merge )
Loads an asset into the scene.
Parameter(s):
true
, combine the new asset with the existing scene. Othererwise, replace the existing scene with the new asset.Return Value:
true
if asset is loaded successfully, otherwise false
. (since 4.9.3.68)Since:
Boolean : loadAsset( DzAsset asset )
Loads an asset as a new scene.
Parameter(s):
Return Value:
true
if asset
is loaded successfully, otherwise false
. (since 4.9.3.68)Since:
Boolean : mdlDirectoryIsMapped( String dirPath )
Attempts to locate dirPath
among the mapped MDL directories.
Parameter(s):
Return Value:
true
if the directory is mapped as a MDL directory, otherwise false
.Since:
Boolean : mergeFiles( Array filenames )
Merges the contents of a list of files, either as native files or imported files, into the existing scene by calling openNativeFile() or importFile() based on the file extension. For file imports, a companion file (a DAZ Script file with the same name as the file being imported, or a DUF file if a DAZ Script does not exist) will be executed if one exists.
Parameter(s):
Return Value:
true
if the file was loaded successfully, otherwise false
.Boolean : openFile( String filename, Boolean merge=true )
Loads the contents of a file, either as a native file or an imported file, by calling openNativeFile() or importFile() based on the file extension. For file imports, a companion file (a DAZ Script file with the same name as the file being imported, or a DUF file if a DAZ Script does not exist) will be executed if one exists.
Parameter(s):
true
, the contents of the file will be merged into the existing scene. If false
, the scene will be cleared and the contents of the file will be opened in a new scene. (applies only for native files)Return Value:
true
if the file was loaded successfully, otherwise false
.Boolean : openNativeFile( String filename, Boolean merge=true )
Loads the contents of a native format file into the scene. This function should only be used in special circumstances. Use openFile() instead.
Parameter(s):
true
, the contents of the file will be merged into the existing scene. If false
, the scene will be cleared and the contents of the file will be opened in a new scene.Return Value:
true
if the file was loaded successfully, otherwise false
.See Also:
Boolean : openNativeUri( DzUri uri, String filename=“”, Boolean merge=true )
Loads the contents of a native format file into the scene. This function should only be used in special circumstances. Use openFile() instead.
Parameter(s):
true
, the contents of the file will be merged into the existing scene. If false
, the scene will be cleared and the contents of the file will be opened in a new scene.Return Value:
true
if the file was loaded successfully, otherwise false
.See Also:
Boolean : openUri( DzUri uri, String filename=“”, Boolean merge=true )
Loads the contents of a file, either as a native file or an imported file, by calling openNativeFile() or importFile() based on the file extension. For file imports, a companion file (a DAZ Script file with the same name as the file being imported, or a DUF file if a DAZ Script does not exist) will be executed if one exists.
Parameter(s):
filename
is supplied.uri
is supplied.true
, the contents of the file will be merged into the existing scene. If false
, the scene will be cleared and the contents of the file will be opened in a new scene. (applies only to native files).Return Value:
true
if the file was loaded successfully, otherwise false
.Boolean : poserDirectoryIsMapped( String dirPath )
Attempts to locate dirPath
path among the mapped Poser content directories.
Parameter(s):
Return Value:
true
if the directory is mapped as a Poser directory, otherwise false
.void : refresh( Boolean reloadIcons=false )
Refreshes any currently loaded content directories. Call this after any operation that makes changes to the file system, e.g. saving or deleting files, etc.
Parameter(s):
true
, all file icons will be reloaded - good for updating the current content directory when a file has been saved over, etc.DzError : reloadAssetsFromSource( DzNode sceneNode, DzSettings settings, String srcFilePath=“” )
Causes assets for a given node in the scene to be reloaded, using the given settings, from source files at the given path.
Parameter(s):
Return Value:
Boolean : reloadSceneAssetsFromSource( DzSettings settings )
Causes the assets for all nodes in the scene to be reloaded from their respective source files.
Parameter(s):
Return Value:
void : removeAllContentDirectories()
Removes all native content mapped directories.
void : removeAllImportDirectories()
Removes all import content directory mappings from the list.
void : removeAllMDLDirectories()
Removes all MDL directory mappings from the list.
Since:
void : removeAllPoserDirectories()
Removes all Poser import content directory mappings from the list.
Boolean : removeContentDirectory( String directory )
Removes a native content directory mapping from the list.
Parameter(s):
Return Value:
true
if the directory was removed, false
if the given directory is not in the list.Boolean : removeImportDirectory( String directory )
Removes an import content directory mapping from the list.
Parameter(s):
Return Value:
true
if the directory was removed, false
if the given directory is not in the list.Boolean : removeMDLDirectory( String directory )
Removes a MDL directory mapping from the list.
Parameter(s):
Return Value:
true
if the directory was removed, false
if the given directory is not in the list.Since:
Boolean : removePoserDirectory( String directory )
Removes a Poser import content directory mapping from the list.
Parameter(s):
Return Value:
true
if the directory was removed, false
if the given directory is not in the list.void : saveAllMappedDirectories()
Saves all currently mapped directories to application settings.
void : setCheckCompatibilityOn( Boolean useCheckCompatibility )
Deprecated
Exists only to keep old code from crashing. Do not use in new code. This function does nothing.
void : setCloudContentDirectory( String directory, Boolean saveSetting=true )
Sets the directory for content and utilities downloaded and installed through the application.
Parameter(s):
Since:
void : setContentDirectories( Array directories, Boolean saveSettings=true )
Sets the list of directories for native format files.
Parameter(s):
Since:
void : setImportDirectories( Array directories, Boolean saveSettings=true )
Sets the list of directories for other import format files.
Parameter(s):
Since:
void : setPoserDirectories( Array directories, Boolean saveSettings=true )
Sets the list of directories for Poser format files.
Parameter(s):
Since:
void : setUseDatabaseSearch( Boolean useDatabase )
Sets whether or not to use the database.
Parameter(s):
true
, turns database use on. If false
, turns database use off.Boolean : shouldMerge( String filename )
Given the filename, determines if the file should be treated as a 'merge' or an 'open' when loaded. This is determined first by content type. If that does not exist and the file is a .duf, it will attempt to retrieve the type from within the file.
Parameter(s):
Return Value:
true
if the file should be merged, otherwise false
.Boolean : usingCheckCompatibility()
Deprecated
Exists only to keep old code from crashing. Do not use in new code. This function does nothing and always returns false
.
Boolean : usingDatabaseSearch()
Return Value:
true
if database use is turned on, otherwise false
.void : autoRefreshChanged( Boolean onOff )
Signature:“autoRefreshChanged(bool)”
Emitted when the enabled state of the auto refresh has changed.
Parameter(s):
void : cloudContentDirectoryChanged()
Signature:“cloudContentDirectoryChanged()”
Emitted when the cloud content directory has changed.
void : contentDirectoryListChanged()
Signature:“contentDirectoryListChanged()”
Emitted when a content directory is added or removed.
void : folderTreeChanged()
Signature:“folderTreeChanged()”
Emitted when the currently loaded tree of folders has changed and needs to be rebuilt. Usually a result of a call to refresh(), or when one of the content directory lists has changed.
void : importDirectoryListChanged()
Signature:“importDirectoryListChanged()”
Emitted when an import directory is added or removed.
void : loadScriptFinished()
Signature:“loadScriptFinished()”
Emitted when the loading of a script has failed, or when the execution of a script has finished or failed.
Since:
void : loadScriptStarting()
Signature:“loadScriptStarting()”
Emitted when the loading of a script is starting.
Since:
void : mdlDirectoryListChanged()
Signature:“mdlDirectoryListChanged()”
Emitted when a MDL directory is added or removed.
void : newFileCreated( String filename )
Signature:“newFileCreated(const QString&)”
Emitted when a new content file has been created.
void : onNewSceneChanged( String filename )
Signature:“onNewSceneChanged(const QString&)”
Emitted when the file that is loaded on 'new' has been changed.
void : poserDirectoryListChanged()
Signature:“poserDirectoryListChanged()”
Emitted when a poser import directory is added or removed.
void : recentFileListChanged()
Signature:“recentFileListChanged()”
Emitted when a recent file is added or removed.
void : scriptFailed( String filename )
Signature:“scriptFailed(const QString&)”
Emitted when the execution of a script fails.
Since:
void : scriptFinished( String filename )
Signature:“scriptFinished(const QString&)”
Emitted when the execution of a script has finished.
Since:
void : scriptLoadFailed( String filename )
Signature:“scriptLoadFailed(const QString&)”
Emitted when the loading of a script fails.
Since:
void : scriptLoadStarting( String filename )
Signature:“scriptLoadStarting(const QString&)”
Emitted when the loading of a script is starting.
Since:
void : scriptStarting( String filename )
Signature:“scriptStarting(const QString&)”
Emitted when the execution of a script is starting.
Since:
void : startupSceneChanged( String filename )
Signature:“startupSceneChanged(const QString&)”
Emitted when the startup scene file has changed.
Parameter(s):