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...

#include <UnigineAssetManager.h>

Static Public Member Functions

static int isInitialized ()
 Returns a value indicating if Asset Manager is initialized. More...
 
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 to 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 to 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 to 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 to 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 to 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 to 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 (excluding contents of 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 > getAssetPaths ()
 Returns the list of paths for all assets in the root project directory (excluding contents of subdirectories). More...
 
static Unigine::Vector< Unigine::UGUID > getAssetGUIDsForDirectory (const char *directory_path)
 Returns the list of GUIDs for all assets in the specified directory (excluding contents of 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 (excluding contents of 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 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 to 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 to 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 to 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 to 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 Unigine::Vector< Unigine::String > getDirectoryPaths (const char *directory_path)
 Returns 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 to 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 void * addAssetAddedCallback (Unigine::CallbackBase1< const char * > *func)
 Adds a callback function to be called when a new asset is added. The signature of the callback function must be as follows:
void callback_function_name(const char *asset_path); More...
 
static bool removeAssetAddedCallback (void *id)
 Removes the specified callback from the list of AssetAdded callbacks. These callbacks are fired when a new asset is added. More...
 
static void * addAssetBeforeRemoveCallback (Unigine::CallbackBase1< const char * > *func)
 Adds a callback function to be called before deleting an asset. Please note, that the asset file may already be deleted at the moment of callback execution (e.g. deleted by user manually via a file manager). The signature of the callback function must be as follows:
void callback_function_name(const char *asset_path); More...
 
static bool removeAssetBeforeRemoveCallback (void *id)
 Removes the specified callback from the list of AssetBeforeRemove callbacks. These callbacks are fired when an asset is about to be deleted. More...
 
static void * addAssetRemovedCallback (Unigine::CallbackBase1< const char * > *func)
 Adds a callback function to be called when an asset is deleted. The signature of the callback function must be as follows:
void callback_function_name(const char *asset_path); More...
 
static bool removeAssetRemovedCallback (void *id)
 Removes the specified callback from the list of AssetRemoved callbacks. These callbacks are fired when an asset is deleted. More...
 
static void * addAssetChangedCallback (Unigine::CallbackBase1< const char * > *func)
 Adds a callback function to be called when an asset is modified or its import parameters have changed (reimport). The signature of the callback function must be as follows:
void callback_function_name(const char *asset_path); More...
 
static bool removeAssetChangedCallback (void *id)
 Removes the specified callback from the list of AssetChanged callbacks. These callbacks are fired when an asset is modified or its import parameters have changed (reimport). More...
 
static void * addAssetMovedCallback (Unigine::CallbackBase2< const char *, const char * > *func)
 Adds a callback function to be called when an asset is moved to another directory or renamed. The signature of the callback function must be as follows:
void callback_function_name(const char *path_from, const char *path_to); More...
 
static bool removeAssetMovedCallback (void *id)
 Removes the specified callback from the list of AssetMoved callbacks. These callbacks are fired when an asset is moved to another directory or renamed. More...
 
static void * addDirectoryAddedCallback (Unigine::CallbackBase1< const char * > *func)
 Adds a callback function to be called when a new directory is added. The signature of the callback function must be as follows:
void callback_function_name(const char *directory_path); More...
 
static bool removeDirectoryAddedCallback (void *id)
 Removes the specified callback from the list of DirectoryAdded callbacks. These callbacks are fired when a new directory is added. More...
 
static void * addDirectoryBeforeRemoveCallback (Unigine::CallbackBase1< const char * > *func)
 Adds a callback function to be called before deleting a directory. Please note, that the directory may already be deleted at the moment of callback execution (e.g. deleted by user manually via a file manager). The signature of the callback function must be as follows:
void callback_function_name(const char *directory_path); More...
 
static bool removeDirectoryBeforeRemoveCallback (void *id)
 Removes the specified callback from the list of DirectoryBeforeRemove callbacks. These callbacks are fired when a directory is about to be deleted. More...
 
static void * addDirectoryRemovedCallback (Unigine::CallbackBase1< const char * > *func)
 Adds a callback function to be called when a directory is deleted. The signature of the callback function must be as follows:
void callback_function_name(const char *directory_path); More...
 
static bool removeDirectoryRemovedCallback (void *id)
 Removes the specified callback from the list of DirectoryRemoved callbacks. These callbacks are fired when a directory is deleted. More...
 
static void * addDirectoryMovedCallback (Unigine::CallbackBase2< const char *, const char * > *func)
 Adds a callback function to be called when a directory is moved to another location or renamed. The signature of the callback function must be as follows:
void callback_function_name(const char *path_from, const char *path_to); More...
 
static bool removeDirectoryMovedCallback (void *id)
 Removes the specified callback from the list of DirectoryMoved callbacks. These callbacks are fired when a directory is moved to another location or renamed. More...
 
static void * addProcessBeginCallback (Unigine::CallbackBase *func)
 Adds a callback function to be called when Asset Manager begins asynchronous asset processing (e.g., validation, import, reimport, removal, copying, conversion, migration etc.). The signature of the callback function must be as follows:
void callback_function_name(); More...
 
static bool removeProcessBeginCallback (void *id)
 Removes the specified callback from the list of ProcessBegin callbacks. These callbacks are fired when Asset Manager begins asynchronous asset processing (e.g., validation, import, reimport, removal, copying, conversion, migration etc.). More...
 
static void * addProcessEndCallback (Unigine::CallbackBase *func)
 Adds a callback function to be called when asynchronous asset processing (e.g., validation, import, reimport, removal, copying, conversion, migration etc.) by the Asset Manager is completed. The signature of the callback function must be as follows:
void callback_function_name(); More...
 
static bool removeProcessEndCallback (void *id)
 Removes the specified callback from the list of ProcessEnd callbacks. These callbacks are fired on completion of asynchronous asset processing by the Asset Manager (e.g., validation, import, reimport, removal, copying, conversion, migration etc.). 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

◆ addAssetAddedCallback()

static void* UnigineEditor::AssetManager::addAssetAddedCallback ( Unigine::CallbackBase1< const char * > *  func)
static

Adds a callback function to be called when a new asset is added. The signature of the callback function must be as follows:
void callback_function_name(const char *asset_path);

Parameters
funcCallback function to be fired on adding a new asset.
Returns
ID of the last added AssetAdded callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeAssetAddedCallback).

◆ addAssetBeforeRemoveCallback()

static void* UnigineEditor::AssetManager::addAssetBeforeRemoveCallback ( Unigine::CallbackBase1< const char * > *  func)
static

Adds a callback function to be called before deleting an asset. Please note, that the asset file may already be deleted at the moment of callback execution (e.g. deleted by user manually via a file manager). The signature of the callback function must be as follows:
void callback_function_name(const char *asset_path);

Parameters
funcCallback function to be fired when an asset is about to be deleted.
Returns
ID of the last added AssetBeforeRemove callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeAssetBeforeRemoveCallback).

◆ addAssetChangedCallback()

static void* UnigineEditor::AssetManager::addAssetChangedCallback ( Unigine::CallbackBase1< const char * > *  func)
static

Adds a callback function to be called when an asset is modified or its import parameters have changed (reimport). The signature of the callback function must be as follows:
void callback_function_name(const char *asset_path);

Parameters
funcCallback function to be fired on changing an asset or its import parameters (reimport).
Returns
ID of the last added AssetChanged callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeAssetChangedCallback).

◆ addAssetMovedCallback()

static void* UnigineEditor::AssetManager::addAssetMovedCallback ( Unigine::CallbackBase2< const char *, const char * > *  func)
static

Adds a callback function to be called when an asset is moved to another directory or renamed. The signature of the callback function must be as follows:
void callback_function_name(const char *path_from, const char *path_to);

Parameters
funcCallback function to be fired on moving an asset to another directory or renamint it.
Returns
ID of the last added AssetMoved callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeAssetMovedCallback).

◆ addAssetRemovedCallback()

static void* UnigineEditor::AssetManager::addAssetRemovedCallback ( Unigine::CallbackBase1< const char * > *  func)
static

Adds a callback function to be called when an asset is deleted. The signature of the callback function must be as follows:
void callback_function_name(const char *asset_path);

Parameters
funcCallback function to be fired on deleting an asset.
Returns
ID of the last added AssetRemoved callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeAssetRemovedCallback).

◆ addDirectoryAddedCallback()

static void* UnigineEditor::AssetManager::addDirectoryAddedCallback ( Unigine::CallbackBase1< const char * > *  func)
static

Adds a callback function to be called when a new directory is added. The signature of the callback function must be as follows:
void callback_function_name(const char *directory_path);

Parameters
funcCallback function to be fired on adding a new directory.
Returns
ID of the last added DirectoryAdded callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeDirectoryAddedCallback).

◆ addDirectoryBeforeRemoveCallback()

static void* UnigineEditor::AssetManager::addDirectoryBeforeRemoveCallback ( Unigine::CallbackBase1< const char * > *  func)
static

Adds a callback function to be called before deleting a directory. Please note, that the directory may already be deleted at the moment of callback execution (e.g. deleted by user manually via a file manager). The signature of the callback function must be as follows:
void callback_function_name(const char *directory_path);

Parameters
funcCallback function to be fired when a directory is about to be deleted.
Returns
ID of the last added DirectoryBeforeRemove callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeDirectoryBeforeRemoveCallback).

◆ addDirectoryMovedCallback()

static void* UnigineEditor::AssetManager::addDirectoryMovedCallback ( Unigine::CallbackBase2< const char *, const char * > *  func)
static

Adds a callback function to be called when a directory is moved to another location or renamed. The signature of the callback function must be as follows:
void callback_function_name(const char *path_from, const char *path_to);

Parameters
funcCallback function to be fired on moving a directory to another location or renaming it.
Returns
ID of the last added DirectoryMoved callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeDirectoryMovedCallback).

◆ addDirectoryRemovedCallback()

static void* UnigineEditor::AssetManager::addDirectoryRemovedCallback ( Unigine::CallbackBase1< const char * > *  func)
static

Adds a callback function to be called when a directory is deleted. The signature of the callback function must be as follows:
void callback_function_name(const char *directory_path);

Parameters
funcCallback function to be fired on deleting a directory.
Returns
ID of the last added DirectoryRemoved callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeDirectoryRemovedCallback).

◆ addProcessBeginCallback()

static void* UnigineEditor::AssetManager::addProcessBeginCallback ( Unigine::CallbackBase *  func)
static

Adds a callback function to be called when Asset Manager begins asynchronous asset processing (e.g., validation, import, reimport, removal, copying, conversion, migration etc.). The signature of the callback function must be as follows:
void callback_function_name();

Parameters
funcCallback function to be fired when Asset Manager begins asynchronous asset processing.
Returns
ID of the last added ProcessBegin callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeProcessBeginCallback).

◆ addProcessEndCallback()

static void* UnigineEditor::AssetManager::addProcessEndCallback ( Unigine::CallbackBase *  func)
static

Adds a callback function to be called when asynchronous asset processing (e.g., validation, import, reimport, removal, copying, conversion, migration etc.) by the Asset Manager is completed. The signature of the callback function must be as follows:
void callback_function_name();

Parameters
funcCallback function to be fired on completion of asynchronous asset processing by the Asset Manager.
Returns
ID of the last added ProcessEnd callback, if it was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary (see removeProcessEndCallback).

◆ 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 to 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 to 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.

◆ getAssetGUIDs()

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

Returns the list of GUIDs for all assets in the root project directory (excluding contents of 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.

◆ getAssetGUIDsForDirectory()

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 (excluding contents of 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.

◆ 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; otherwise, 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.

◆ getAssetPaths()

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

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

◆ getAssetPathsForDirectory()

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 (excluding contents of subdirectories).

Parameters
directory_pathDirectory path for which all asset paths are to be retrieved.

◆ getDirectoryPaths()

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.

◆ getDirectoryPathsAll()

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

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

◆ 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.

◆ getRuntimeGUIDs()

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.

◆ 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 to 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ isInitialized()

static int UnigineEditor::AssetManager::isInitialized ( )
static

Returns a value indicating if Asset Manager is initialized.

Returns
true if Asset Manager is initialized; 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.

◆ 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.

◆ 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 to 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 to 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 to 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 to 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.

◆ removeAssetAddedCallback()

static bool UnigineEditor::AssetManager::removeAssetAddedCallback ( void *  id)
static

Removes the specified callback from the list of AssetAdded callbacks. These callbacks are fired when a new asset is added.

Parameters
idCallback ID obtained when adding it via a call to addAssetAddedCallback().
Returns
true if the AssetAdded callback with the given ID was removed 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 to 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.

◆ removeAssetBeforeRemoveCallback()

static bool UnigineEditor::AssetManager::removeAssetBeforeRemoveCallback ( void *  id)
static

Removes the specified callback from the list of AssetBeforeRemove callbacks. These callbacks are fired when an asset is about to be deleted.

Parameters
idCallback ID obtained when adding it via a call to addAssetBeforeRemoveCallback().
Returns
true if the AssetBeforeRemove callback with the given ID was removed successfully; otherwise, false.

◆ removeAssetChangedCallback()

static bool UnigineEditor::AssetManager::removeAssetChangedCallback ( void *  id)
static

Removes the specified callback from the list of AssetChanged callbacks. These callbacks are fired when an asset is modified or its import parameters have changed (reimport).

Parameters
idCallback ID obtained when adding it via a call to addAssetChangedCallback().
Returns
true if the AssetChanged callback with the given ID was removed successfully; otherwise, false.

◆ removeAssetMovedCallback()

static bool UnigineEditor::AssetManager::removeAssetMovedCallback ( void *  id)
static

Removes the specified callback from the list of AssetMoved callbacks. These callbacks are fired when an asset is moved to another directory or renamed.

Parameters
idCallback ID obtained when adding it via a call to addAssetMovedCallback().
Returns
true if the AssetMoved callback with the given ID was removed successfully; otherwise, false.

◆ removeAssetRemovedCallback()

static bool UnigineEditor::AssetManager::removeAssetRemovedCallback ( void *  id)
static

Removes the specified callback from the list of AssetRemoved callbacks. These callbacks are fired when an asset is deleted.

Parameters
idCallback ID obtained when adding it via a call to addAssetRemovedCallback().
Returns
true if the AssetRemoved callback with the given ID was removed successfully; 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.

◆ removeDirectoryAddedCallback()

static bool UnigineEditor::AssetManager::removeDirectoryAddedCallback ( void *  id)
static

Removes the specified callback from the list of DirectoryAdded callbacks. These callbacks are fired when a new directory is added.

Parameters
idCallback ID obtained when adding it via a call to addDirectoryAddedCallback().
Returns
true if the DirectoryAdded callback with the given ID was 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 to a queue, unlike the removeDirectorySync() method.

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

◆ removeDirectoryBeforeRemoveCallback()

static bool UnigineEditor::AssetManager::removeDirectoryBeforeRemoveCallback ( void *  id)
static

Removes the specified callback from the list of DirectoryBeforeRemove callbacks. These callbacks are fired when a directory is about to be deleted.

Parameters
idCallback ID obtained when adding it via a call to addDirectoryBeforeRemoveCallback().
Returns
true if the DirectoryBeforeRemove callback with the given ID was removed successfully; otherwise, false.

◆ removeDirectoryMovedCallback()

static bool UnigineEditor::AssetManager::removeDirectoryMovedCallback ( void *  id)
static

Removes the specified callback from the list of DirectoryMoved callbacks. These callbacks are fired when a directory is moved to another location or renamed.

Parameters
idCallback ID obtained when adding it via a call to addDirectoryMovedCallback().
Returns
true if the DirectoryMoved callback with the given ID was removed successfully; otherwise, false.

◆ removeDirectoryRemovedCallback()

static bool UnigineEditor::AssetManager::removeDirectoryRemovedCallback ( void *  id)
static

Removes the specified callback from the list of DirectoryRemoved callbacks. These callbacks are fired when a directory is deleted.

Parameters
idCallback ID obtained when adding it via a call to addDirectoryRemovedCallback().
Returns
true if the DirectoryRemoved callback with the given ID was 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.

◆ removeProcessBeginCallback()

static bool UnigineEditor::AssetManager::removeProcessBeginCallback ( void *  id)
static

Removes the specified callback from the list of ProcessBegin callbacks. These callbacks are fired when Asset Manager begins asynchronous asset processing (e.g., validation, import, reimport, removal, copying, conversion, migration etc.).

Parameters
idCallback ID obtained when adding it via a call to addProcessBeginCallback().
Returns
true if the ProcessBegin callback with the given ID was removed successfully; otherwise, false.

◆ removeProcessEndCallback()

static bool UnigineEditor::AssetManager::removeProcessEndCallback ( void *  id)
static

Removes the specified callback from the list of ProcessEnd callbacks. These callbacks are fired on completion of asynchronous asset processing by the Asset Manager (e.g., validation, import, reimport, removal, copying, conversion, migration etc.).

Parameters
idCallback ID obtained when adding it via a call to addProcessEndCallback().
Returns
true if the ProcessEnd callback with the given ID was 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 to 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 to 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.