Editor API
UnigineEditor public API
UnigineEditor::AssetManager Class Reference

This class is used to manage assets in the Editor. You can check if an asset with the specified GUID exists, get its file path, or subscribe for signals to perform certain actions when an asset is added, moved, updated, or deleted. AssetManager extends the functionality of UNIGINE's File System, being based on it. It performs operations itself while controlling the File System. Paths and GUIDs used for Unigine::FileSystem can be used for UnigineEditor::AssetManager as well. All paths returned by the AssetManager (via getAssetPaths, getDirectoryPaths, etc.) are virtual. More...

Static Public Member Functions

static Unigine::UGUID getAssetGUIDFromPath (const char *asset_path)
 Returns asset GUID for the specified asset path. This GUID can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class. More...
 
static Unigine::String getAssetPathFromGUID (const Unigine::UGUID &asset_guid)
 Returns asset path for the specified asset GUID. More...
 
static bool importAssetSync (const char *asset_path, const Unigine::Ptr< Collection > &import_parameters={})
 Imports the specified asset with the specified set of import settings synchronously. The function call will not return until the blocking operation is complete, unlike the importAssetAsync() method. More...
 
static bool importAssetAsync (const char *asset_path, const Unigine::Ptr< Collection > &import_parameters={})
 Imports the specified asset with the specified set of import settings asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the importAssetSync() method. More...
 
static bool reimportAssetSync (const char *asset_path, const Unigine::Ptr< Collection > &import_parameters={})
 Reimports the specified asset with the specified set of import settings synchronously. The function call will not return until the blocking operation is complete, unlike the reimportAssetAsync() method. More...
 
static bool reimportAssetAsync (const char *asset_path, const Unigine::Ptr< Collection > &import_parameters={})
 Reimports the specified asset with the specified set of import settings asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the reimportAssetSync() method. More...
 
static bool removeAssetSync (const char *asset_path)
 Removes the specified asset synchronously. The function call will not return until the blocking operation is complete, unlike the removeAssetAsync() method. More...
 
static bool removeAssetAsync (const char *asset_path)
 Removes the specified asset asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the removeAssetSync() method. More...
 
static bool moveAssetSync (const char *old_asset_path, const char *new_asset_path)
 Moves the specified asset to a new location synchronously. The function call will not return until the blocking operation is complete, unlike the moveAssetAsync() method. More...
 
static bool moveAssetAsync (const char *old_asset_path, const char *new_asset_path)
 Moves the specified asset to a new location asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the moveAssetSync() method. More...
 
static bool renameAssetSync (const char *asset_path, const char *new_asset_name)
 Renames the specified asset synchronously. The function call will not return until the blocking operation is complete, unlike the renameAssetAsync() method. More...
 
static bool renameAssetAsync (const char *asset_path, const char *new_asset_name)
 Renames the specified asset asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the renameAssetSync() method. More...
 
static bool copyAssetSync (const char *asset_path, const char *new_asset_path)
 Copies the specified asset to the specified destination path synchronously. The function call will not return until the blocking operation is complete, unlike the copyAssetAsync() method. More...
 
static bool copyAssetAsync (const char *asset_path, const char *new_asset_path)
 Copies the specified asset to the specified destination path asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the copyAssetSync() method. More...
 
static bool isAsset (const char *asset_path)
 Returns a value indicating whether an asset with the specified file path exists. More...
 
static Unigine::Ptr< CollectiongetAssetImportParameters (const char *asset_path)
 Returns the set of import parameters for the specified asset path. More...
 
static bool isAssetWritable (const char *asset_path)
 Returns a value indicating whether the asset with the specified file path can be updated (writing operation is enabled for it). More...
 
static Unigine::Vector< Unigine::UGUID > getAssetGUIDs ()
 Returns the list of GUIDs for all assets in the root project directory (including all subdirectories). These GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class. More...
 
static void getAssetGUIDs (Unigine::Vector< Unigine::UGUID > &asset_guids)
 Saves to the vector specified as the argument GUIDs for all assets in the root project directory (including all subdirectories). These GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class. More...
 
static Unigine::Vector< Unigine::String > getAssetPaths ()
 Returns the list of paths for all assets in the root project directory (including all subdirectories). More...
 
static void getAssetPaths (Unigine::Vector< Unigine::String > &asset_paths)
 Saves to the vector specified as the argument the list of paths for all assets in the root project directory (including all subdirectories). More...
 
static Unigine::Vector< Unigine::UGUID > getAssetGUIDsForDirectory (const char *directory_path)
 Returns the list of GUIDs for all assets in the specified directory (including all subdirectories). Thess GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class. More...
 
static void getAssetGUIDsForDirectory (const char *directory_path, Unigine::Vector< Unigine::UGUID > &asset_guids)
 Saves to the vector specified as the argument the list of GUIDs for all assets in the specified directory (including all subdirectories). Thess GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class. More...
 
static Unigine::Vector< Unigine::String > getAssetPathsForDirectory (const char *directory_path)
 Returns the list of paths for all assets in the specified directory (including all subdirectories). More...
 
static void getAssetPathsForDirectory (const char *directory_path, Unigine::Vector< Unigine::String > &asset_paths)
 Saves to the vector specified as the argument the list of paths for all assets in the specified directory (including all subdirectories). More...
 
static Unigine::Vector< Unigine::UGUID > getRuntimeGUIDs (const char *asset_path)
 Returns the list of all runtime GUIDs for the specified asset path (some assets, like FBX-containers may produce multiple runtimes on importing). Thess GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class. More...
 
static void getRuntimeGUIDs (const char *asset_path, Unigine::Vector< Unigine::UGUID > &runtime_guids)
 Saves to the vector specified as the argument the list of all runtime GUIDs for the specified asset path (some assets, like FBX-containers may produce multiple runtimes on importing). Thess GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class. More...
 
static Unigine::String getRuntimeAlias (const Unigine::UGUID &runtime_guid)
 Returns an alias used for the runtime with the specified GUID. More...
 
static bool isRuntimePrimary (const Unigine::UGUID &runtime_guid)
 Returns a value indicating whether the runtime with the specified GUID is a primary one. More...
 
static bool createDirectory (const char *directory_path)
 Creates a new directory. The function will create all parent directories necessary to create the directory specified. More...
 
static bool removeDirectorySync (const char *directory_path)
 Removes the specified directory synchronously. The function call will not return until the blocking operation is complete, unlike the removeDirectoryAsync() method. More...
 
static bool removeDirectoryAsync (const char *directory_path)
 Removes the specified directory asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the removeDirectorySync() method. More...
 
static bool moveDirectorySync (const char *old_directory_path, const char *new_directory_path)
 Moves the specified directory to a new location synchronously. The function call will not return until the blocking operation is complete, unlike the moveDirectoryAsync() method. More...
 
static bool moveDirectoryAsync (const char *old_directory_path, const char *new_directory_path)
 Moves the specified directory to a new location asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the moveDirectorySync() method. More...
 
static bool renameDirectorySync (const char *directory_path, const char *new_directory_name)
 Renames the specified directory synchronously. The function call will not return until the blocking operation is complete, unlike the renameDirectoryAsync() method. More...
 
static bool renameDirectoryAsync (const char *directory_path, const char *new_directory_name)
 Renames the specified directory asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the renameDirectorySync() method. More...
 
static bool copyDirectorySync (const char *directory_path, const char *new_directory_path)
 Copies the specified directory to the specified destination path synchronously. The function call will not return until the blocking operation is complete, unlike the copyDirectoryAsync() method. More...
 
static bool copyDirectoryAsync (const char *directory_path, const char *new_directory_path)
 Copies the specified directory to the specified destination path asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the copyDirectorySync() method. More...
 
static bool isDirectory (const char *directory_path)
 Returns a value indicating whether the specified directory path exists. More...
 
static bool isDirectoryWritable (const char *directory_path)
 Returns a value indicating whether the specified directory path is writable. More...
 
static Unigine::Vector< Unigine::String > getDirectoryPathsAll ()
 Returns the list of all subdirectories for the root project directory. More...
 
static void getDirectoryPathsAll (Unigine::Vector< Unigine::String > &directory_paths)
 Saves to the vector specified as the argument the list of all subdirectories for the root project directory. More...
 
static Unigine::Vector< Unigine::String > getDirectoryPaths (const char *directory_path)
 Returns the list of all subdirectories for the specified directory path. More...
 
static void getDirectoryPaths (const char *directory_path, Unigine::Vector< Unigine::String > &directory_paths)
 Saves to the vector specified as the argument the list of all subdirectories for the specified directory path. More...
 
static bool createMountPoint (const char *directory_path, const Unigine::Ptr< MountPointParameters > &mount_creation_parameters)
 Creates a new mount point for the specified path applying the specified parameters (access mode, filters, etc.) and the corresponding .umount file. More...
 
static bool removeMountPoint (const char *directory_path)
 Unmounts the mount point for the specified path and deletes the corresponding .umount file. More...
 
static bool isMountPoint (const char *directory_path)
 Returns a value indicating whether a mount point with the specified path exists. More...
 
static Unigine::Ptr< MountPointParametersgetMountPointParameters (const char *directory_path)
 Returns the parameters for the specified mount point (access mode, filters, etc.) as an instance of the MountPointParameters class). More...
 
static bool refreshMountPointAsync (const char *directory_path)
 Reloads the data and updates the mount point with the specified path asynchronously. After calling this method the operation is put in a queue. More...
 
static void blockAutoRefresh ()
 Increments an internal counter which is used to determine whether to allow automatic refreshing of the assets database (i.e. automatic reimporting of changed assets). When building your own Editor tools, you can use this method together with unblockAutoRefresh() to prevent an auto-refreshing from happening during certain operations (e.g. if you are building a custom integration with a version control system). This method does not simply enable the auto-refresh feature. Instead, it increments a counter, and only allows auto-refresh when the counter reaches zero. Therefore, each time you call blockAutoRefresh(), you must make sure you also make a corresponding call to unblockAutoRefresh(). This internal counter is used so that if your code executes multiple nested 'block' and 'unblock' pairs, the inner pairs do not accidentally re-enable auto-refresh too early. Instead, each pair increments and decrements the counter by one, and if your code is correctly nested, the final outer call to unblockAutoRefresh() sets the counter to zero. More...
 
static void unblockAutoRefresh ()
 Decrements an internal counter which is used to determine whether to allow automatic refreshing of the assets database (i.e. automatic reimporting of changed assets). When building your own Editor tools, you can use this method together with blockAutoRefresh() to prevent an auto-refreshing from happening during certain operations (e.g. if you are building a custom integration with a version control system). This method does not simply enable the auto-refresh feature. Instead, it decrements a counter, and only allows auto-refresh when the counter reaches zero. It is designed to be used to re-enable auto-refresh after a call to blockAutoRefresh() previously disabled it. This internal counter is used so that if your code executes multiple nested 'block' and 'unblock' pairs, the inner pairs do not accidentally re-enable auto-refresh too early. Instead, each pair increments and decrements the counter by one, and if your code is correctly nested, the final outer call to unblockAutoRefresh() sets the counter to zero. More...
 
static bool isAutoRefreshBlocked ()
 Returns a value indicating whether automatic refreshing of the assets database is currently blocked or not (i.e. automatic reimporting of changed assets). When building your own Editor tools, you can use blockAutoRefresh() together with unblockAutoRefresh() to prevent an auto-refreshing from happening during certain operations (e.g. if you are building a custom integration with a version control system). The system does not simply enable/disable the auto-refresh feature. Instead, it increments (see unblockAutoRefresh) and decrements (see blockAutoRefresh) a counter, and only allows auto-refresh when the counter reaches zero. This internal counter is used so that if your code executes multiple nested 'block' and 'unblock' pairs, the inner pairs do not accidentally re-enable auto-refresh too early. Instead, each pair increments and decrements the counter by one, and if your code is correctly nested, the final outer call to unblockAutoRefresh() sets the counter to zero. More...
 
static Unigine::Event< const char * > & getEventAssetAdded ()
 This event may be called upon either of the following occurs: More...
 
static Unigine::Event< const char * > & getEventAssetBeforeRemove ()
 While this event is called, the information on the asset being deleted (such as 'getAssetImportParameters()') is still accessible via the AssetManager API. More...
 
static Unigine::Event< const char * > & getEventAssetRemoved ()
 The event is called when the asset is removed. More...
 
static Unigine::Event< const char * > & getEventAssetChanged ()
 The event is called when the asset has been changed OR the parameters of the meta have been changed, which caused the asset reimport and/or the meta file update. More...
 
static Unigine::Event< const char *, const char * > & getEventAssetMoved ()
 The event is called when the asset has been moved or renamed. More...
 
static Unigine::Event< const char * > & getEventDirectoryAdded ()
 The event is called when a new directory has been added. More...
 
static Unigine::Event< const char * > & getEventDirectoryBeforeRemove ()
 While this event is called, the information on the directory being deleted (such as 'isDirectoryWritable()') is still accessible via the AssetManager API. More...
 
static Unigine::Event< const char * > & getEventDirectoryRemoved ()
 The event is called when the directory is removed. More...
 
static Unigine::Event< const char *, const char * > & getEventDirectoryMoved ()
 The event is called when the directory has been moved or renamed. More...
 
static Unigine::Event & getEventProcessBegin ()
 The event is called when AssetManager has started asynchronous processing assets or directories that have been added, changed, moved, renamed, or deleted. More...
 
static Unigine::Event & getEventProcessEnd ()
 The event is called when AssetManager has finished asynchronous processing assets or directories that have been added, changed, moved, renamed, or deleted. More...
 
static Unigine::String generateUniquePath (const char *path)
 Generates a unique path which is not currently used in the File System for the specified path. Unique paths for files having an extension shall be generated without affecting the extension: folder/file.png -> folder/file_0.png. More...
 
static bool isExist (const char *path)
 Checks if the specified path exists, either it is registered in the Asset System (it is an asset, a folder, or a mount point), or it is an existing file in the File System which is not added to Asset System for some reason (e.g., its name or extension is forbidden or filtered out by exclusive or ignore filters). More...
 

Detailed Description

This class is used to manage assets in the Editor. You can check if an asset with the specified GUID exists, get its file path, or subscribe for signals to perform certain actions when an asset is added, moved, updated, or deleted. AssetManager extends the functionality of UNIGINE's File System, being based on it. It performs operations itself while controlling the File System. Paths and GUIDs used for Unigine::FileSystem can be used for UnigineEditor::AssetManager as well. All paths returned by the AssetManager (via getAssetPaths, getDirectoryPaths, etc.) are virtual.

Member Function Documentation

◆ blockAutoRefresh()

static void UnigineEditor::AssetManager::blockAutoRefresh ( )
static

Increments an internal counter which is used to determine whether to allow automatic refreshing of the assets database (i.e. automatic reimporting of changed assets). When building your own Editor tools, you can use this method together with unblockAutoRefresh() to prevent an auto-refreshing from happening during certain operations (e.g. if you are building a custom integration with a version control system). This method does not simply enable the auto-refresh feature. Instead, it increments a counter, and only allows auto-refresh when the counter reaches zero. Therefore, each time you call blockAutoRefresh(), you must make sure you also make a corresponding call to unblockAutoRefresh(). This internal counter is used so that if your code executes multiple nested 'block' and 'unblock' pairs, the inner pairs do not accidentally re-enable auto-refresh too early. Instead, each pair increments and decrements the counter by one, and if your code is correctly nested, the final outer call to unblockAutoRefresh() sets the counter to zero.

◆ copyAssetAsync()

static bool UnigineEditor::AssetManager::copyAssetAsync ( const char *  asset_path,
const char *  new_asset_path 
)
static

Copies the specified asset to the specified destination path asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the copyAssetSync() method.

Parameters
asset_pathPath to the asset to be copied.
new_asset_pathDestination path to which the asset is to be copied.
Returns
true if a new copy task for the specified asset and destination path is successfully added to the queue; otherwise, false.

◆ copyAssetSync()

static bool UnigineEditor::AssetManager::copyAssetSync ( const char *  asset_path,
const char *  new_asset_path 
)
static

Copies the specified asset to the specified destination path synchronously. The function call will not return until the blocking operation is complete, unlike the copyAssetAsync() method.

Parameters
asset_pathPath to the asset to be copied.
new_asset_pathDestination path to which the asset is to be copied.
Returns
true if the specified asset is successfully copied to the specified destination path; otherwise, false.

◆ copyDirectoryAsync()

static bool UnigineEditor::AssetManager::copyDirectoryAsync ( const char *  directory_path,
const char *  new_directory_path 
)
static

Copies the specified directory to the specified destination path asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the copyDirectorySync() method.

Parameters
directory_pathPath to the directory to be copied.
new_directory_pathNew directory name.
Returns
true if the specified directory is successfully copied to the specified destination path; otherwise, false.

◆ copyDirectorySync()

static bool UnigineEditor::AssetManager::copyDirectorySync ( const char *  directory_path,
const char *  new_directory_path 
)
static

Copies the specified directory to the specified destination path synchronously. The function call will not return until the blocking operation is complete, unlike the copyDirectoryAsync() method.

Parameters
directory_pathPath to the directory to be copied.
new_directory_pathDestination path to which the directory is to be copied.
Returns
true if the specified directory is successfully copied to the specified destination path; otherwise, false.

◆ createDirectory()

static bool UnigineEditor::AssetManager::createDirectory ( const char *  directory_path)
static

Creates a new directory. The function will create all parent directories necessary to create the directory specified.

Parameters
directory_pathNew directory path to be created.
Returns
true if the specified directory is created successfully or already exists when this method is called; otherwise, false (including the case when the specified directory path exists in a read-only mount).

◆ createMountPoint()

static bool UnigineEditor::AssetManager::createMountPoint ( const char *  directory_path,
const Unigine::Ptr< MountPointParameters > &  mount_creation_parameters 
)
static

Creates a new mount point for the specified path applying the specified parameters (access mode, filters, etc.) and the corresponding .umount file.

Parameters
directory_pathPath to the directory to be mounted.
mount_creation_parametersParameters of the mount point to be created (access mode, filters, etc.).
Returns
true if the mount point is created successfully; otherwise, false.

◆ generateUniquePath()

static Unigine::String UnigineEditor::AssetManager::generateUniquePath ( const char *  path)
static

Generates a unique path which is not currently used in the File System for the specified path. Unique paths for files having an extension shall be generated without affecting the extension: folder/file.png -> folder/file_0.png.

Returns
Unique generated file system path for the specified path on success, or an empty string in the following cases:
  1. Specified path is empty
  2. Specified path points somewhere outside the data folder and mount points
  3. Root folder of the specified path is known to be read-only.

◆ getAssetGUIDFromPath()

static Unigine::UGUID UnigineEditor::AssetManager::getAssetGUIDFromPath ( const char *  asset_path)
static

Returns asset GUID for the specified asset path. This GUID can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class.

Parameters
asset_pathPath to the asset to retrieve a GUID for.
Returns
Asset GUID for the specified asset path.

◆ getAssetGUIDs() [1/2]

static Unigine::Vector<Unigine::UGUID> UnigineEditor::AssetManager::getAssetGUIDs ( )
static

Returns the list of GUIDs for all assets in the root project directory (including all subdirectories). These GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class.

Returns
The list of GUIDs for all assets in the root project directory (including all subdirectories).

◆ getAssetGUIDs() [2/2]

static void UnigineEditor::AssetManager::getAssetGUIDs ( Unigine::Vector< Unigine::UGUID > &  asset_guids)
static

Saves to the vector specified as the argument GUIDs for all assets in the root project directory (including all subdirectories). These GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class.

Parameters
asset_guidsThe vector to store GUIDs for all assets in the root project directory (including all subdirectories).

◆ getAssetGUIDsForDirectory() [1/2]

static Unigine::Vector<Unigine::UGUID> UnigineEditor::AssetManager::getAssetGUIDsForDirectory ( const char *  directory_path)
static

Returns the list of GUIDs for all assets in the specified directory (including all subdirectories). Thess GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class.

Parameters
directory_pathDirectory path for which all asset GUIDs are to be retrieved.
Returns
The list of GUIDs for all assets in the specified directory (including all subdirectories).

◆ getAssetGUIDsForDirectory() [2/2]

static void UnigineEditor::AssetManager::getAssetGUIDsForDirectory ( const char *  directory_path,
Unigine::Vector< Unigine::UGUID > &  asset_guids 
)
static

Saves to the vector specified as the argument the list of GUIDs for all assets in the specified directory (including all subdirectories). Thess GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class.

Parameters
directory_pathDirectory path for which all asset GUIDs are to be retrieved.
asset_guidsThe vector to store GUIDs for all assets in the specified directory (including all subdirectories).

◆ getAssetImportParameters()

static Unigine::Ptr<Collection> UnigineEditor::AssetManager::getAssetImportParameters ( const char *  asset_path)
static

Returns the set of import parameters for the specified asset path.

Parameters
asset_pathPath of the asset to be checked.
Returns
Import parameters for the specified asset path on success; or nullptr, if an error has occurred.

◆ getAssetPathFromGUID()

static Unigine::String UnigineEditor::AssetManager::getAssetPathFromGUID ( const Unigine::UGUID &  asset_guid)
static

Returns asset path for the specified asset GUID.

Parameters
asset_guidGUID of the asset to retrieve a path for.
Returns
Asset path for the specified asset GUID.

◆ getAssetPaths() [1/2]

static Unigine::Vector<Unigine::String> UnigineEditor::AssetManager::getAssetPaths ( )
static

Returns the list of paths for all assets in the root project directory (including all subdirectories).

Returns
The list of paths for all assets in the root project directory (including all subdirectories).

◆ getAssetPaths() [2/2]

static void UnigineEditor::AssetManager::getAssetPaths ( Unigine::Vector< Unigine::String > &  asset_paths)
static

Saves to the vector specified as the argument the list of paths for all assets in the root project directory (including all subdirectories).

Parameters
asset_pathsThe vector to store paths for all assets in the root project directory (including all subdirectories).

◆ getAssetPathsForDirectory() [1/2]

static Unigine::Vector<Unigine::String> UnigineEditor::AssetManager::getAssetPathsForDirectory ( const char *  directory_path)
static

Returns the list of paths for all assets in the specified directory (including all subdirectories).

Parameters
directory_pathDirectory path for which all asset paths are to be retrieved.
Returns
The list of paths for all assets in the specified directory (including all subdirectories).

◆ getAssetPathsForDirectory() [2/2]

static void UnigineEditor::AssetManager::getAssetPathsForDirectory ( const char *  directory_path,
Unigine::Vector< Unigine::String > &  asset_paths 
)
static

Saves to the vector specified as the argument the list of paths for all assets in the specified directory (including all subdirectories).

Parameters
directory_pathDirectory path for which all asset paths are to be retrieved.
asset_pathsThe vector to store paths for all assets in the specified directory (including all subdirectories).

◆ getDirectoryPaths() [1/2]

static Unigine::Vector<Unigine::String> UnigineEditor::AssetManager::getDirectoryPaths ( const char *  directory_path)
static

Returns the list of all subdirectories for the specified directory path.

Parameters
directory_pathDirectory path.
Returns
The list of all subdirectories for the specified directory path.

◆ getDirectoryPaths() [2/2]

static void UnigineEditor::AssetManager::getDirectoryPaths ( const char *  directory_path,
Unigine::Vector< Unigine::String > &  directory_paths 
)
static

Saves to the vector specified as the argument the list of all subdirectories for the specified directory path.

Parameters
directory_pathDirectory path.
directory_pathsThe vector to store all subdirectories for the specified directory path.

◆ getDirectoryPathsAll() [1/2]

static Unigine::Vector<Unigine::String> UnigineEditor::AssetManager::getDirectoryPathsAll ( )
static

Returns the list of all subdirectories for the root project directory.

Returns
The list of all subdirectories for the root project directory.

◆ getDirectoryPathsAll() [2/2]

static void UnigineEditor::AssetManager::getDirectoryPathsAll ( Unigine::Vector< Unigine::String > &  directory_paths)
static

Saves to the vector specified as the argument the list of all subdirectories for the root project directory.

Parameters
directory_pathsThe vector to store all subdirectories for the root project directory.

◆ getEventAssetAdded()

static Unigine::Event<const char *>& UnigineEditor::AssetManager::getEventAssetAdded ( )
static

This event may be called upon either of the following occurs:

  1. The asset has been copied. After the asset has been copied, AssetManager notifies via this event that a new asset has been added.
  2. The user has added a new asset to the folders tracked by the Editor while the Editor is running.

/summary>

◆ getEventAssetBeforeRemove()

static Unigine::Event<const char *>& UnigineEditor::AssetManager::getEventAssetBeforeRemove ( )
static

While this event is called, the information on the asset being deleted (such as 'getAssetImportParameters()') is still accessible via the AssetManager API.

◆ getEventAssetChanged()

static Unigine::Event<const char *>& UnigineEditor::AssetManager::getEventAssetChanged ( )
static

The event is called when the asset has been changed OR the parameters of the meta have been changed, which caused the asset reimport and/or the meta file update.

◆ getEventAssetMoved()

static Unigine::Event<const char *, const char *>& UnigineEditor::AssetManager::getEventAssetMoved ( )
static

The event is called when the asset has been moved or renamed.

◆ getEventAssetRemoved()

static Unigine::Event<const char *>& UnigineEditor::AssetManager::getEventAssetRemoved ( )
static

The event is called when the asset is removed.

◆ getEventDirectoryAdded()

static Unigine::Event<const char *>& UnigineEditor::AssetManager::getEventDirectoryAdded ( )
static

The event is called when a new directory has been added.

◆ getEventDirectoryBeforeRemove()

static Unigine::Event<const char *>& UnigineEditor::AssetManager::getEventDirectoryBeforeRemove ( )
static

While this event is called, the information on the directory being deleted (such as 'isDirectoryWritable()') is still accessible via the AssetManager API.

◆ getEventDirectoryMoved()

static Unigine::Event<const char *, const char *>& UnigineEditor::AssetManager::getEventDirectoryMoved ( )
static

The event is called when the directory has been moved or renamed.

◆ getEventDirectoryRemoved()

static Unigine::Event<const char *>& UnigineEditor::AssetManager::getEventDirectoryRemoved ( )
static

The event is called when the directory is removed.

◆ getEventProcessBegin()

static Unigine::Event& UnigineEditor::AssetManager::getEventProcessBegin ( )
static

The event is called when AssetManager has started asynchronous processing assets or directories that have been added, changed, moved, renamed, or deleted.

◆ getEventProcessEnd()

static Unigine::Event& UnigineEditor::AssetManager::getEventProcessEnd ( )
static

The event is called when AssetManager has finished asynchronous processing assets or directories that have been added, changed, moved, renamed, or deleted.

◆ getMountPointParameters()

static Unigine::Ptr<MountPointParameters> UnigineEditor::AssetManager::getMountPointParameters ( const char *  directory_path)
static

Returns the parameters for the specified mount point (access mode, filters, etc.) as an instance of the MountPointParameters class).

Parameters
directory_pathPath to the mounted directory.
Returns
Parameters of the mount point on success; otherwise, nullptr if an error has occurred.

◆ getRuntimeAlias()

static Unigine::String UnigineEditor::AssetManager::getRuntimeAlias ( const Unigine::UGUID &  runtime_guid)
static

Returns an alias used for the runtime with the specified GUID.

Parameters
runtime_guidRuntime GUID for which the alias is to be retrieved.
Returns
The alias used for the runtime with the specified GUID.

◆ getRuntimeGUIDs() [1/2]

static Unigine::Vector<Unigine::UGUID> UnigineEditor::AssetManager::getRuntimeGUIDs ( const char *  asset_path)
static

Returns the list of all runtime GUIDs for the specified asset path (some assets, like FBX-containers may produce multiple runtimes on importing). Thess GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class.

Parameters
asset_pathAsset path for which the list of runtime GUIDs is to be retrieved.
Returns
The list of all runtime GUIDs for the specified asset path.

◆ getRuntimeGUIDs() [2/2]

static void UnigineEditor::AssetManager::getRuntimeGUIDs ( const char *  asset_path,
Unigine::Vector< Unigine::UGUID > &  runtime_guids 
)
static

Saves to the vector specified as the argument the list of all runtime GUIDs for the specified asset path (some assets, like FBX-containers may produce multiple runtimes on importing). Thess GUIDs can be used in calls to Unigine::FileSystem. Additional information for a given GUID can be obtained via the Unigine::FileSystem class.

Parameters
asset_pathAsset path for which the list of runtime GUIDs is to be retrieved.
runtime_guidsThe vector to store all runtime GUIDs for the specified asset path.

◆ importAssetAsync()

static bool UnigineEditor::AssetManager::importAssetAsync ( const char *  asset_path,
const Unigine::Ptr< Collection > &  import_parameters = {} 
)
static

Imports the specified asset with the specified set of import settings asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the importAssetSync() method.

Parameters
asset_pathPath to the asset to be imported. This asset-file MUST be inside the data_path (or inside a registered mount point, which is actually the same).
import_parametersSet of import parameters for the asset.
Returns
true if a new import task for the specified asset is successfully added to the queue; otherwise, false.

◆ importAssetSync()

static bool UnigineEditor::AssetManager::importAssetSync ( const char *  asset_path,
const Unigine::Ptr< Collection > &  import_parameters = {} 
)
static

Imports the specified asset with the specified set of import settings synchronously. The function call will not return until the blocking operation is complete, unlike the importAssetAsync() method.

Parameters
asset_pathPath to the asset to be imported. This asset-file MUST be inside the data_path (or inside a registered mount point, which is actually the same).
import_parametersSet of import parameters for the asset.
Returns
true if the specified asset is imported successfully; otherwise, false.

◆ isAsset()

static bool UnigineEditor::AssetManager::isAsset ( const char *  asset_path)
static

Returns a value indicating whether an asset with the specified file path exists.

Parameters
asset_pathPath of the asset to be checked.
Returns
true if an asset with the specified file path exists; otherwise, false.

◆ isAssetWritable()

static bool UnigineEditor::AssetManager::isAssetWritable ( const char *  asset_path)
static

Returns a value indicating whether the asset with the specified file path can be updated (writing operation is enabled for it).

Parameters
asset_pathAsset path to be checked.
Returns
true if the asset with the specified file path can be updated; otherwise, false.

◆ isAutoRefreshBlocked()

static bool UnigineEditor::AssetManager::isAutoRefreshBlocked ( )
static

Returns a value indicating whether automatic refreshing of the assets database is currently blocked or not (i.e. automatic reimporting of changed assets). When building your own Editor tools, you can use blockAutoRefresh() together with unblockAutoRefresh() to prevent an auto-refreshing from happening during certain operations (e.g. if you are building a custom integration with a version control system). The system does not simply enable/disable the auto-refresh feature. Instead, it increments (see unblockAutoRefresh) and decrements (see blockAutoRefresh) a counter, and only allows auto-refresh when the counter reaches zero. This internal counter is used so that if your code executes multiple nested 'block' and 'unblock' pairs, the inner pairs do not accidentally re-enable auto-refresh too early. Instead, each pair increments and decrements the counter by one, and if your code is correctly nested, the final outer call to unblockAutoRefresh() sets the counter to zero.

◆ isDirectory()

static bool UnigineEditor::AssetManager::isDirectory ( const char *  directory_path)
static

Returns a value indicating whether the specified directory path exists.

Parameters
directory_pathDirectory path to be checked.
Returns
true if the specified directory exists; otherwise, false.

◆ isDirectoryWritable()

static bool UnigineEditor::AssetManager::isDirectoryWritable ( const char *  directory_path)
static

Returns a value indicating whether the specified directory path is writable.

Parameters
directory_pathDirectory path to be checked.
Returns
true if the specified directory path is writable; otherwise, false.

◆ isExist()

static bool UnigineEditor::AssetManager::isExist ( const char *  path)
static

Checks if the specified path exists, either it is registered in the Asset System (it is an asset, a folder, or a mount point), or it is an existing file in the File System which is not added to Asset System for some reason (e.g., its name or extension is forbidden or filtered out by exclusive or ignore filters).

Returns
true if the specified path exists; otherwise, false.

◆ isMountPoint()

static bool UnigineEditor::AssetManager::isMountPoint ( const char *  directory_path)
static

Returns a value indicating whether a mount point with the specified path exists.

Parameters
directory_pathDirectory path to be checked.
Returns
true if the mount point exists; otherwise, false.

◆ isRuntimePrimary()

static bool UnigineEditor::AssetManager::isRuntimePrimary ( const Unigine::UGUID &  runtime_guid)
static

Returns a value indicating whether the runtime with the specified GUID is a primary one.

Parameters
runtime_guidRuntime GUID to be checked.
Returns
true if the runtime with the specified GUID is a primary one; otherwise, false.

◆ moveAssetAsync()

static bool UnigineEditor::AssetManager::moveAssetAsync ( const char *  old_asset_path,
const char *  new_asset_path 
)
static

Moves the specified asset to a new location asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the moveAssetSync() method.

Parameters
old_asset_pathOld asset path (FROM which the asset is moved).
new_asset_pathNew asset path (TO which the asset is moved).
Returns
true if a new move task for the specified asset and destination path is successfully added to the queue; otherwise, false.

◆ moveAssetSync()

static bool UnigineEditor::AssetManager::moveAssetSync ( const char *  old_asset_path,
const char *  new_asset_path 
)
static

Moves the specified asset to a new location synchronously. The function call will not return until the blocking operation is complete, unlike the moveAssetAsync() method.

Parameters
old_asset_pathOld asset path (FROM which the asset is moved).
new_asset_pathNew asset path (TO which the asset is moved).
Returns
true if the specified asset is successfully moved to the specified path; otherwise, false.

◆ moveDirectoryAsync()

static bool UnigineEditor::AssetManager::moveDirectoryAsync ( const char *  old_directory_path,
const char *  new_directory_path 
)
static

Moves the specified directory to a new location asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the moveDirectorySync() method.

Parameters
old_directory_pathOld directory path (FROM which the directory is moved).
new_directory_pathNew directory path (TO which the directory is moved).
Returns
true if the specified directory is successfully moved to the specified path; otherwise, false.

◆ moveDirectorySync()

static bool UnigineEditor::AssetManager::moveDirectorySync ( const char *  old_directory_path,
const char *  new_directory_path 
)
static

Moves the specified directory to a new location synchronously. The function call will not return until the blocking operation is complete, unlike the moveDirectoryAsync() method.

Parameters
old_directory_pathOld directory path (FROM which the directory is moved).
new_directory_pathNew directory path (TO which the directory is moved).
Returns
true if the specified directory is successfully moved to the specified path; otherwise, false.

◆ refreshMountPointAsync()

static bool UnigineEditor::AssetManager::refreshMountPointAsync ( const char *  directory_path)
static

Reloads the data and updates the mount point with the specified path asynchronously. After calling this method the operation is put in a queue.

Parameters
directory_pathDirectory path for the mount point to be refreshed.
Returns
true if the mount point is refreshed successfully; otherwise, false.

◆ reimportAssetAsync()

static bool UnigineEditor::AssetManager::reimportAssetAsync ( const char *  asset_path,
const Unigine::Ptr< Collection > &  import_parameters = {} 
)
static

Reimports the specified asset with the specified set of import settings asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the reimportAssetSync() method.

Parameters
asset_pathPath to the asset to be reimported.
import_parametersSet of import parameters for the asset.
Returns
true if a new reimport task for the specified asset is successfully added to the queue; otherwise, false.

◆ reimportAssetSync()

static bool UnigineEditor::AssetManager::reimportAssetSync ( const char *  asset_path,
const Unigine::Ptr< Collection > &  import_parameters = {} 
)
static

Reimports the specified asset with the specified set of import settings synchronously. The function call will not return until the blocking operation is complete, unlike the reimportAssetAsync() method.

Parameters
asset_pathPath to the asset to be reimported.
import_parametersSet of import parameters for the asset.
Returns
true if the specified asset is reimported successfully; otherwise, false.

◆ removeAssetAsync()

static bool UnigineEditor::AssetManager::removeAssetAsync ( const char *  asset_path)
static

Removes the specified asset asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the removeAssetSync() method.

Parameters
asset_pathPath to the asset to be removed.
Returns
true if a new remove task for the specified asset is successfully added to the queue; otherwise, false.

◆ removeAssetSync()

static bool UnigineEditor::AssetManager::removeAssetSync ( const char *  asset_path)
static

Removes the specified asset synchronously. The function call will not return until the blocking operation is complete, unlike the removeAssetAsync() method.

Parameters
asset_pathPath to the asset to be removed.
Returns
true if the specified asset is removed successfully; otherwise, false.

◆ removeDirectoryAsync()

static bool UnigineEditor::AssetManager::removeDirectoryAsync ( const char *  directory_path)
static

Removes the specified directory asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the removeDirectorySync() method.

Parameters
directory_pathDirectory path to be removed.
Returns
true if the specified directory is removed successfully; otherwise, false.

◆ removeDirectorySync()

static bool UnigineEditor::AssetManager::removeDirectorySync ( const char *  directory_path)
static

Removes the specified directory synchronously. The function call will not return until the blocking operation is complete, unlike the removeDirectoryAsync() method.

Parameters
directory_pathDirectory path to be removed.
Returns
true if the specified directory is removed successfully; otherwise, false.

◆ removeMountPoint()

static bool UnigineEditor::AssetManager::removeMountPoint ( const char *  directory_path)
static

Unmounts the mount point for the specified path and deletes the corresponding .umount file.

Parameters
directory_pathMount path to be removed.
Returns
true if the mount point is removed successfully; otherwise, false.

◆ renameAssetAsync()

static bool UnigineEditor::AssetManager::renameAssetAsync ( const char *  asset_path,
const char *  new_asset_name 
)
static

Renames the specified asset asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the renameAssetSync() method.

Parameters
asset_pathPath to the asset to be renamed.
new_asset_nameNew asset name.
Returns
true if a new rename task for the specified asset is successfully added to the queue; otherwise, false.

◆ renameAssetSync()

static bool UnigineEditor::AssetManager::renameAssetSync ( const char *  asset_path,
const char *  new_asset_name 
)
static

Renames the specified asset synchronously. The function call will not return until the blocking operation is complete, unlike the renameAssetAsync() method.

Parameters
asset_pathPath to the asset to be renamed.
new_asset_nameNew asset name.
Returns
true if the specified asset is renamed successfully; otherwise, false.

◆ renameDirectoryAsync()

static bool UnigineEditor::AssetManager::renameDirectoryAsync ( const char *  directory_path,
const char *  new_directory_name 
)
static

Renames the specified directory asynchronously. The method is non-blocking and returns immediately, after calling it the operation is put in a queue, unlike the renameDirectorySync() method.

Parameters
directory_pathPath to the directory to be renamed.
new_directory_nameNew directory name.
Returns
true if the specified directory is renamed successfully; otherwise, false.

◆ renameDirectorySync()

static bool UnigineEditor::AssetManager::renameDirectorySync ( const char *  directory_path,
const char *  new_directory_name 
)
static

Renames the specified directory synchronously. The function call will not return until the blocking operation is complete, unlike the renameDirectoryAsync() method.

Parameters
directory_pathPath to the directory to be renamed.
new_directory_nameNew directory name.
Returns
true if the specified directory is renamed successfully; otherwise, false.

◆ unblockAutoRefresh()

static void UnigineEditor::AssetManager::unblockAutoRefresh ( )
static

Decrements an internal counter which is used to determine whether to allow automatic refreshing of the assets database (i.e. automatic reimporting of changed assets). When building your own Editor tools, you can use this method together with blockAutoRefresh() to prevent an auto-refreshing from happening during certain operations (e.g. if you are building a custom integration with a version control system). This method does not simply enable the auto-refresh feature. Instead, it decrements a counter, and only allows auto-refresh when the counter reaches zero. It is designed to be used to re-enable auto-refresh after a call to blockAutoRefresh() previously disabled it. This internal counter is used so that if your code executes multiple nested 'block' and 'unblock' pairs, the inner pairs do not accidentally re-enable auto-refresh too early. Instead, each pair increments and decrements the counter by one, and if your code is correctly nested, the final outer call to unblockAutoRefresh() sets the counter to zero.