Asset API Databases

Access and manage asset databases that contain assets which are exposed by the Asset Browser.

Overview

Asset API assets are managed by databases and multiple asset databases can be connected to a running Cinema 4D instance. The databases are organized in and accessed through repositories, always containing at least the metadata for the assets stored in it. Assets within a database are being identified with an unique identifier. The primary data for an asset, e.g., the texture file for an texture asset, can either reside or inside or outside of the database. The asset API makes formally no distinction between such local and remote assets and hides away that difference with the Url of an asset. See Asset API Assets for details on the Asset API asset model. Asset databases also contain caches for their data like preview thumbnails, downloaded content and more things, but they usually do not have to be handled manually.

The logical interface for asset databases are asset repositories which provide access to assets stored within databases. Repositories can represent one or multiple databases and allow either read and write access or read access only. An asset repository can have multiple bases, which are references to other repositories, and thereby access content from these other repositories. There are three important repositories provided by Cinema 4D which bundle data up in such fashion: The builtin repository which contains the assets that are built into Cinema 4D, the application repository which contains all assets contained in the shipped databases and the preferences repository which contains all preferences databases. Each scene document can also have its own repository which is being loaded and stored with that scene file.

Technical Overview

An asset database is represented by an AssetDatabaseStruct which carries little information besides the Url of the database and if the database is active or not. An asset is handled on the database level as a StoreAssetStruct and as a FileAssetInterface. The former is required to store assets manually within an asset repository and the latter is the interface for a physical part of a database like a folder or file. See Asset API Assets for more information on asset representation and simplified asset creation.

The entry point to access databases is realized with the interface AssetDataBasesInterface, granting access to databases, repositories and caches that represent the current state of the asset databases attached to the running Cinema 4D instance. The important builtin, application and preferences repositories can be accessed through three static functions attached to AssetInterface. Note that the builtin and application repository are read only, while the preferences repository grants read and write access.

Repositories are represented by the interface AssetRepositoryInterface, providing means to read and write data, add versions to and access metadata for assets. See Asset API Metadata for details on asset metadata and versioning. Repositories also provide the ability to react to read, write and update events on the databases they do manage. This is realized through multiple MAXON_OBSERVABLE that are attached to AssetRepositoryInterface, allowing for actions on database events to be delegated to an arbitrary amount of user defined callback functions. See Observables for more information on the topic of observables.

Fig I: On the left a simplified physical view on an asset database: The database in this example is stored as a folder on the local machine. It contains an index folder and folders for each asset. Assets always contain files for their metadata, here illustrated as 'asset.meta'. Assets that store their primary data within the database will also contain a file with the primary data which is called 'asset.c4d'. This is however not mandatory and the primary data can also reside somewhere outside of the database. There are also other physical representations of asset databases like zip files and servers. Note that this is a simplified view, both the folder structure and the storage of metadata is more complex. The naming of files and folders is also not as shown here, but reflects the identifier hashes of the elements they represent. On the right a simplified logical view on an asset database: It aligns with how asset databases are abstracted in the Asset API. Most notably in the form that asset repositories can represent multiple databases.

Related Topics

Articles Asset API Provide content as reusable assets served with the Cinema 4D Asset Browser.
Interface Basics The interface system of the MAXON API is a toolset to define public APIs and to hide implementation details. It is the base for most components of the MAXON API.
Observables

An observable is a registry that can store references to multiple functions. These functions will be called if a certain event associated with the observable occurs.

API Entities AssetDataBasesInterface Provides helper functions to register asset repositories.
AssetDatabaseStruct
Not yet documented
AssetInterface Represents digital content which can be managed by an asset repository.
AssetManagerInterface Provides limited control over the Asset Manager.
AssetRepositoryInterface Provides access to a set of assets.
StoreAssetStruct
Not yet documented
UpdatableAssetRepositoryInterface
Not yet documented

SDK Plugins Asset API Basics

Showcases basic interactions with the Asset API to modify asset databases and their content.

Common Tasks Access User Databases Access the data structures that represent the user asset databases attached to the running Cinema 4D instance.
Create User Repositories Create repositories and their underlying databases from scratch or wrap with repositories around existing user databases.
Access Important Repositories Accesses the important built-in, app, preferences and active document repositories.
Add User Databases Add user databases to make their assets accessible both in the Asset Browser and the Asset API.
Remove User Databases Remove user databases to make their assets inaccessible both in the Asset Browser and the Asset API.
Activate User Databases Activate user databases to make their assets visible both in the Asset Browser and the Asset API.
Deactivate User Databases Deactivate user databases to make their assets invisible both in the Asset Browser and the Asset API.
Search for Assets Find assets in repositories and filter the results by their type, subtype or other properties.
React to Database Events
Not yet documented

Common Tasks

Access User Databases

Access the data structures that represent the user asset databases attached to the running Cinema 4D instance.

Will access and iterate over all AssetDatabaseStruct instances that represent user databases. AssetDatabaseStruct do only hold metadata about the databases they represent and not their content. Accessed will be the user databases, not the application databases with which Cinema does deliver its default assets. See Access Important Repositories for how to access the repositories of the application databases. This snippet can be found in a compileable context in the SDK plugin Asset API Basics.

maxon::Result<void> AccessDatabases()
{
// An error scope handling which is more verbose than a simple "iferr_scope;". If one of the
// calls below returns an error, the function will be exited through this block.
{
ApplicationOutput("Stopped AccessDatabases() execution with the error: @", err);
return err;
};
// Databases have to be loaded and we should wait for that as we otherwise will not find
// any databases or not all databases.
ApplicationOutput("Databases have been loaded: @", loaded);
if (!loaded)
{
ApplicationOutput("Could not load databases.");
return maxon::OK;
}
// Get the user databases which are represented by instances of AssetDatabaseStruct.
// Report how many databases were found.
ApplicationOutput("Found @ asset database(s)", databaseCollection.GetCount());
// And iterate over them to print out the their fields.
for (maxon::AssetDatabaseStruct& database : databaseCollection)
{
ApplicationOutput("Found asset database with the properties - url: @, active: @, builtin: @",
database._dbUrl, database._active, database._isBuiltin);
}
return maxon::OK;
}
Example Output
Databases have been loaded: true
Found 2 asset database(s)
Found asset database with the properties - url: file:///E:/temp/test_db, active: true, builtin: false
Found asset database with the properties - url: file:///E:/temp/test_db_2, active: true, builtin: false

Create User Repositories

Create repositories and their underlying databases from scratch or wrap with repositories around existing user databases.

The example will first create repository interfaces for all existing user databases and then open a file dialog to create a repository and its underlying database from scratch. After that it will iterate over these repositories and print out some basic information attached to them. See Access Important Repositories for how to access the application repositories. This snippet can be found in a compileable context in the SDK plugin Asset API Basics.

maxon::Result<void> CreateRepositories()
{
// An error scope handling which is more verbose than a simple "iferr_scope;". If one of the
// calls below returns an error, the function will be exited through this block.
{
ApplicationOutput("Stopped CreateRepositories() execution with the error: @", err);
return err;
};
// Databases have to be loaded and we should wait for that as we otherwise will not find
// any databases or not all databases.
ApplicationOutput("Databases have been loaded: @", loaded);
if (!loaded)
{
ApplicationOutput("Could not load databases.");
return maxon::OK;
}
// Get the user databases which are represented by instances of AssetDatabaseStruct.
// Iterate over the databases in order to get an AssetRepositoryRef for them with their Url.
for (maxon::AssetDatabaseStruct database : databaseCollection)
{
ApplicationOutput("Found asset database with the properties - url: @, active: @, builtin: @",
database._dbUrl, database._active, database._isBuiltin);
// Get the repository for the Url.
// Create an unique identifier for the database, we have to make sure this identifier is not
// being used by any bases of the repository. In this case we could get just any id, since our
// repository will not have any bases. But we are going to construct an id with the database
// Url as a prefix for demonstration purposes. To make this even nicer
const maxon::BaseArray<Char> path = database._dbUrl.GetPath().GetCString() iferr_return;
const maxon::Char* prefix = path.GetFirst();
// Create or get the bases for the repository. In this case we do not want any bases, i.e., we
// want the repository to only contain what is contained in this one database.
const maxon::Block<const maxon::AssetRepositoryRef> bases{};
// Create the repository reference for that database. If the third argument, database._dbUrl,
// would point to a directory where no database is being located, Cinema would create the
// necessary database structure.
maxon::UpdatableAssetRepositoryRef repository = maxon::AssetInterface::CreateRepositoryFromUrl(
uuid, bases, database._dbUrl, true, true, true) iferr_return;
// Print some information for the new created repository reference.
maxon::Id id = repository.GetId();
maxon::String name = repository.GetRepositoryName(
maxon::Resource::GetDefaultLanguage()) iferr_return;
maxon::Bool isWriteable = repository.IsWritable();
ApplicationOutput("Build repository with the properties - name: @, id: @, isWriteable: @",
name, id, isWriteable);
}
return maxon::OK;
}
Example Output
Databases have been loaded: true
Found asset database with the properties - url: file:///E:/temp/test_db, active: true, builtin: false
Build repository with the properties - name: E:/temp/test_db@0a1be32f129b4a2899d0b6f79173dd72, id: E:/temp/test_db@0a1be32f129b4a2899d0b6f79173dd72, isWriteable: true
Found asset database with the properties - url: file:///E:/temp/test_db_2, active: true, builtin: false
Build repository with the properties - name: E:/temp/test_db_2@74ff1757d52e47959039eef49b4f6762, id: E:/temp/test_db_2@74ff1757d52e47959039eef49b4f6762, isWriteable: true
Found asset database with the properties - url: file:///E:/temp/test_db_3, active: true, builtin: false
Build repository with the properties - name: E:/temp/test_db_3@f1598a3e62954d918b4bf59a25c295c2, id: E:/temp/test_db_3@f1598a3e62954d918b4bf59a25c295c2, isWriteable: true

Access Important Repositories

Accesses the important built-in, app, preferences and active document repositories.

This snippet can be found in a compileable context in the SDK plugin Asset API Basics.

maxon::Result<void> AccessImportantRepositories()
{
// An error scope handling which is more verbose than a simple "iferr_scope;". If one of the
// calls below returns an error, the function will be exited through this block.
{
ApplicationOutput("Stopped AccessImportantRepositories() execution with the error: @", err);
return err;
};
// We will append the these four common repositories to this BaseArray.
// The non-writable built-in repository of Cinema 4D, this will contain almost nothing.
// The non-writable application repository based on the built-in repository of Cinema 4D, it
// will contain assets like nodes.
// The writable user preferences repository, it will contain the shipped asset database and
// the user databases attached to the running instance.
// The repository that is associated with the active document, passing true to
// GetSceneRepository() means that it will be created if there is none.
maxon::AssetRepositoryRef documentRepository = doc->GetSceneRepository(true) iferr_return;
importantRepositories.Append(documentRepository) iferr_return;
// Print some information for all three repositories.
for (maxon::AssetRepositoryRef repository : importantRepositories)
{
maxon::Id id = repository.GetId();
maxon::String name = repository.GetRepositoryName(
maxon::Bool isWriteable = repository.IsWritable();
ApplicationOutput("Repository with the properties - name: @, id: @, isWriteable: @",
name, id, isWriteable);
}
return maxon::OK;
}
Example Output
Repository with the properties - name: Builtin, id: net.maxon.repository.builtin, isWriteable: false
Repository with the properties - name: Application, id: net.maxon.repository.application, isWriteable: false
Repository with the properties - name: Preferences, id: net.maxon.repository.userprefs, isWriteable: true
Repository with the properties - name: Scene (Untitled 1), id: net.maxon.repository.scene, isWriteable: true

Add User Databases

Add user databases to make their assets accessible both in the Asset Browser and the Asset API.

This example will open a directory selection dialog to let the user select a database location. If the selected directory already does contain an asset database, Cinema will wrap around that data. If it does not, Cinema will create the necessary data representing a new database within this directory. It aligns closely with what is being done in the database field of the Asset Browser section of the Preferences dialog of Cinema 4D. This snippet can be found in a compileable context in the SDK plugin Asset API Basics.

maxon::Result<void> AddDatabase()
{
// An error scope handling which is more verbose than a simple "iferr_scope;". If one of the
// calls below returns an error, the function will be exited through this block.
{
ApplicationOutput("Stopped AddDatabase() execution with the error: @", err);
return err;
};
// Open a directory selection dialog to pick the new database location.
Filename filename;
"Select database directory"_s);
if (!res)
return maxon::OK;
// Create a new unique id for the database.
// Convert the classic API file location into a maxon::Url.
maxon::Url databaseUrl = MaxonConvert(filename, MAXONCONVERTMODE::WRITE);
// Databases have to be loaded and we should wait for that as we otherwise will not find
// any databases or not all databases.
maxon::Bool loaded = maxon::AssetDataBasesInterface::WaitForDatabaseLoading();
ApplicationOutput("Databases have been loaded: @", loaded);
if (!loaded)
{
ApplicationOutput("Could not load databases.");
return maxon::OK;
}
// Get the user asset databases.
maxon::BaseArray<maxon::AssetDatabaseStruct> databaseCollcetion;
maxon::AssetDataBasesInterface::GetDatabases(databaseCollcetion) iferr_return;
// Iterate over the existing databases to check if a database with that Url has already been
// added.
Bool shouldAddDatabase = true;
for (maxon::AssetDatabaseStruct& database : databaseCollcetion)
{
// We found a database with the same Url as the one specified by the folder selection dialog.
if (database._dbUrl == databaseUrl)
{
// The existing database is also already active.
if (database._active)
{
ApplicationOutput("The database with the url '@' is already active.", databaseUrl);
return maxon::OK;
}
// Activate an already added but inactive database.
database._active = true;
shouldAddDatabase = false;
}
}
// The database should be added and we append a AssetDatabaseStruct.
if (shouldAddDatabase)
{
// Pack the database information into a AssetDatabaseStruct, passing the field values _dbUrl,
// _active and _exportOnSaveProject. Could also be shortened to:
//
// databaseCollcetion.Append({ databaseUrl, true, true }) iferr_return;
maxon::AssetDatabaseStruct newDatabase { databaseUrl, true, true };
databaseCollcetion.Append(newDatabase) iferr_return;
ApplicationOutput("Added new database with the url: @", databaseUrl);
}
// Write the AssetDatabaseStruct BaseArray back into Cinema 4D. It is important that the new
// database is being added to the BaseArray of AssetDatabaseStruct retrieved from GetDatabases().
// If just a BaseArray of the to be added databases would be passed, all other user databases
// would be unmounted.
// An event has to be invoked, so that the GUI of Cinema can catch up.
return maxon::OK;
}
Example Output
Databases have been loaded: true
Added new database with the url: file:///E:/temp/test_db

Remove User Databases

Remove user databases to make their assets inaccessible both in the Asset Browser and the Asset API.

This example will remove the first user database from the running Cinema 4D instance and will cause all assets contained in the database to become inaccessible. It aligns closely with what is being done in the database field of the Asset Browser section of the Preferences dialog of Cinema 4D. This snippet can be found in a compileable context in the SDK plugin Asset API Basics.

maxon::Result<void> RemoveDatabase()
{
// An error scope handling which is more verbose than a simple "iferr_scope;". If one of the
// calls below returns an error, the function will be exited through this block.
{
ApplicationOutput("Stopped RemoveDatabase() execution with the error: @", err);
return err;
};
// Databases have to be loaded and we should wait for that as we otherwise will not find
// any databases or not all databases.
ApplicationOutput("Databases have been loaded: @", loaded);
if (!loaded)
{
ApplicationOutput("Could not load databases.");
return maxon::OK;
}
// Get the user databases which are represented by instances of AssetDatabaseStruct.
// There are no databases which could be removed.
if (databaseCollection.GetCount() == 0)
{
ApplicationOutput("Did not find any user databases which could be removed.");
}
// Remove the first database.
else
{
// Report which database we are going to remove.
maxon::AssetDatabaseStruct removeMe = databaseCollection[0];
ApplicationOutput("Removing database with the url: @", removeMe._dbUrl);
// Remove the first AssetDatabaseStruct representing a database. This will not erase the
// physical database, but only remove the item representing it.
databaseCollection.Erase(0) iferr_return;
// Write the modified database collection back.
// An event has to be invoked, so that the GUI of Cinema can catch up.
}
return maxon::OK;
}
Example Output
Databases have been loaded: true
Removing database with the url: file:///E:/temp/test_db

Activate User Databases

Activate user databases to make their assets visible both in the Asset Browser and the Asset API.

The example will activate the first user database that is mounted an inactive. Activated databases will appear as checked in the database selection of the Asset Browser section of the Cinema 4D Preferences dialog. This snippet can be found in a compileable context in the SDK plugin Asset API Basics.

maxon::Result<void> ActivateDatabase()
{
// An error scope handling which is more verbose than a simple "iferr_scope;". If one of the
// calls below returns an error, the function will be exited through this block.
{
ApplicationOutput("Stopped ActivateDatabase() execution with the error: @", err);
return err;
};
// Databases have to be loaded and we should wait for that as we otherwise will not find
// any databases or not all databases.
ApplicationOutput("Databases have been loaded: @", loaded);
if (!loaded)
{
ApplicationOutput("Could not load databases.");
return maxon::OK;
}
// Get the user databases which are represented by instances of AssetDatabaseStruct.
// And iterate over them to find the first database that is inactive.
for (maxon::AssetDatabaseStruct& database : databaseCollection)
{
// The current database is inactive.
if (!database._active)
{
// Activate the database.
database._active = true;
// Write the modified database collection back.
// An event has to be invoked, so that the GUI of Cinema can catch up.
ApplicationOutput("Activated database with the url: @", database._dbUrl);
return maxon::OK;
}
}
ApplicationOutput("No inactive database found.");
return maxon::OK;
}
Example Output
Databases have been loaded: true
Activated databses with the url: file:///E:/temp/test_db

Deactivate User Databases

Deactivate user databases to make their assets invisible both in the Asset Browser and the Asset API.

The example will deactivate the first user database that is mounted an active. Deactivated databases will appear as unchecked in the database selection of the Asset Browser section of the Cinema 4D Preferences dialog. This snippet can be found in a compileable context in the SDK plugin Asset API Basics.

maxon::Result<void> DeactivateDatabase()
{
// An error scope handling which is more verbose than a simple "iferr_scope;". If one of the
// calls below returns an error, the function will be exited through this block.
{
ApplicationOutput("Stopped DeactivateDatabase() execution with the error: @", err);
return err;
};
// Databases have to be loaded and we should wait for that as we otherwise will not find
// any databases or not all databases.
ApplicationOutput("Databases have been loaded: @", loaded);
if (!loaded)
{
ApplicationOutput("Could not load databases.");
return maxon::OK;
}
// Get the user databases which are represented by instances of AssetDatabaseStruct.
// Report how many databases were found.
ApplicationOutput("Found @ asset database(s).", databaseCollection.GetCount());
// And iterate over them to find the first database that is active.
for (maxon::AssetDatabaseStruct& database : databaseCollection)
{
// The current database is active.
if (database._active)
{
// Deactivate the database.
database._active = false;
// Write the modified database collection back.
// An event has to be invoked, so that the GUI of Cinema can catch up.
ApplicationOutput("Deactivated databse with the url: @", database._dbUrl);
return maxon::OK;
}
}
ApplicationOutput("No active database found.");
return maxon::OK;
}
Example Output
Databases have been loaded: true
Found 3 asset database(s).
Deactivated database with the url: file:///E:/temp/test_db

Search for Assets

Search for assets in repositories and filter the results by their type, subtype or other properties.

The example iterates over the first ten object assets in the user preferences repository and prints out their name, id and the id of the repository they are contained in. This snippet can be found in a compileable context in the SDK plugin Asset API Basics.

static Int32 g_max_object_to_find = 10;
maxon::Result<void> FindAssets()
{
// An error scope handling which is more verbose than a simple "iferr_scope;". If one of the
// calls below returns an error, the function will be exited through this block.
{
ApplicationOutput("Stopped FindAssets() execution with the error: @", err);
return err;
};
// Get the user preferences repository. For retrieving specific user database repositories, see
// CreateRepositories() in asset_api_basics_databases.cpp.
const maxon::AssetRepositoryRef& repository = maxon::AssetInterface::GetUserPrefsRepository();
// Now we are preparing some arguments for the call to find assets.
// The asset type we are looking for. Asset types are declared in the maxxon::AssetTypes
// namespace.
const maxon::AssetType assetType = maxon::AssetTypes::File();
// The id of the asset we are looking for, passing an empty id will return assets with any id.
const maxon::Id assetFindId = {};
// The version of the asset we are looking for, passing an empty id will return assets with any
// version.
const maxon::Id assetVersion = {};
// A maxon::BaseArray where we will store all found asset descriptions.
// There are multiple methods attached to AssetRepositoryInterface to find assets in an
// repository. We use here FindAsset() which allows us to define the verion types we want
// to retrieve. In this case we pass ASSET_FIND_MODE::LATEST to only find the latest version of
// each asset. But we could for example also pass ASSET_FIND_MODE::ALL to find all version of an
// asset.
repository.FindAssets(assetType, assetFindId, assetVersion, maxon::ASSET_FIND_MODE::LATEST,
results) iferr_return;
ApplicationOutput("Total number of file-type assets found: @", results.GetCount());
maxon::Int counter = 0;
// Iterate over the results and print out some data for the first ten object assets.
for (maxon::AssetDescription assetDescription : results)
{
// Exit when we encountered ten object assets.
if (counter == g_max_object_to_find)
break;
// We retrieve the subtype of the subtype asset. See the topic Asset API - Metadata for more
// details on asset metadata.
maxon::AssetMetaData metadata = assetDescription.GetMetaData();
maxon::Id subTypeId = metadata.Get(maxon::ASSETMETADATA::SubType) iferr_return;
// This asset is of subtype object.
if (subTypeId == maxon::ASSETMETADATA::SubType_ENUM_Object)
{
// Now we collect some data to print out.
// The id of the asset itself.
maxon::Id assetId = assetDescription.GetId();
// Rather pointless here, because we know the repository in this case already, but an
// AssetDescription has a the id of the repository attached it is contained in.
maxon::Id repositoryId = assetDescription.GetRepositoryId();
// The storage Url of the asset.
const maxon::Url& assetUrl = assetDescription.GetUrl() iferr_return;
// The name of the asset.
maxon::String assetName = assetDescription.GetMetaString(maxon::OBJECT::BASE::NAME,
maxon::LanguageRef()) iferr_return;
ApplicationOutput("Found object asset with the id: @", assetId);
ApplicationOutput("\tRepository: @", repositoryId);
ApplicationOutput("\tLocation: @", assetUrl);
ApplicationOutput("\tName: @", assetName);
counter++;
}
}
return maxon::OK;
}
Example Output
Total number of file-type assets found:: 7147
Found object asset with the id: file_7718c218832735aa
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_7718c218832735aa/1/asset.c4d
Name: Clutch 02
Found object asset with the id: file_20a6c746ef94a927
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_20a6c746ef94a927/1/asset.c4d
Name: Casual 10 - Walk
Found object asset with the id: file_59b5d3ad4e0de46b
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_59b5d3ad4e0de46b/1/asset.c4d
Name: Record & Sleeve
Found object asset with the id: file_16ca4d0046ad7480
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_16ca4d0046ad7480/1/asset.c4d
Name: Swaying - Concert - Mirror - Loop
Found object asset with the id: file_4f3fdca3b084a1bf
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_4f3fdca3b084a1bf/1/asset.c4d
Name: Disc
Found object asset with the id: file_967f6a882d4e9b40
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_967f6a882d4e9b40/1/asset.c4d
Name: Coffee Table 02
Found object asset with the id: file_73480d678c8c14e8
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_73480d678c8c14e8/1/asset.c4d
Name: Female - Clothed - Rigged
Found object asset with the id: file_7c63c331d4a880c8
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_7c63c331d4a880c8/1/asset.c4d
Name: Glass 17 - Wine
Found object asset with the id: file_2b182f240a28aa8c
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_2b182f240a28aa8c/1/asset.c4d
Name: Glass 09
Found object asset with the id: file_8999d44516390c37
Repository: database@U1pOb6rnHdar41NpWahfnn
Location: ramdisk://0C4FD460-4860-4DE1-ADAF-BD732FFD76A6/file_8999d44516390c37/1/asset.c4d
Name: Bedside Table 05

React to Database Events

Not yet documented
FILESELECT::DIRECTORY
@ DIRECTORY
Folder selection dialog.
maxon::AssetDatabaseStruct::_dbUrl
Url _dbUrl
Definition: asset_databases.h:18
GetActiveDocument
BaseDocument * GetActiveDocument(void)
maxon::AssetInterface::GetUserPrefsRepository
static const MAXON_METHOD UpdatableAssetRepositoryRef & GetUserPrefsRepository()
maxon::Resource::GetDefaultLanguage
static MAXON_METHOD LanguageRef GetDefaultLanguage()
maxon
The maxon namespace contains all declarations of the MAXON API.
Definition: c4d_basedocument.h:15
maxon::AssetDataBasesInterface::WaitForDatabaseLoading
static MAXON_METHOD Bool WaitForDatabaseLoading()
maxon::AssetInterface::CreateRepositoryFromUrl
static MAXON_METHOD Result< UpdatableAssetRepositoryRef > CreateRepositoryFromUrl(const Id &rid, const Block< const AssetRepositoryRef > &bases, const Url &url, Bool writable, Bool derivedInPrefs, Bool tempRepository)
maxon::String
Definition: string.h:1213
maxon::AssetInterface::GetBuiltinRepository
static const MAXON_METHOD AssetRepositoryRef & GetBuiltinRepository()
Filename
Manages file and path names.
Definition: c4d_file.h:93
maxon::OK
return OK
Definition: apibase.h:2546
maxon::Bool
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:179
WRITE
WRITE
Problems writing the file.
Definition: ge_prepass.h:3360
FILESELECTTYPE::ANYTHING
@ ANYTHING
Any file.
maxon::Id
Definition: apibaseid.h:250
maxon::BaseArray::GetFirst
const MAXON_ATTRIBUTE_FORCE_INLINE T * GetFirst() const
Definition: basearray.h:1034
maxon::AssetInterface::GetApplicationRepository
static const MAXON_METHOD AssetRepositoryRef & GetApplicationRepository()
iferr_return
#define iferr_return
Definition: resultbase.h:1465
maxon::BaseArray
Definition: basearray.h:366
maxon::AssetInterface::MakeUuid
static MAXON_METHOD Result< Id > MakeUuid(const Char *prefix, Bool compact)
maxon::AssetDataBasesInterface::GetDatabases
static MAXON_METHOD Result< void > GetDatabases(const ValueReceiver< const AssetDatabaseStruct & > &entry)
maxon::Url
Definition: url.h:855
MaxonConvert
maxon::Url MaxonConvert(const Filename &fn, MAXONCONVERTMODE convertMode)
String
Definition: c4d_string.h:38
maxon::Result< void >
OK
OK
Ok.
Definition: ge_prepass.h:2
maxon::BaseArray::GetCount
MAXON_ATTRIBUTE_FORCE_INLINE Int GetCount() const
Definition: basearray.h:527
maxon::BaseArray::Append
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append()
Definition: basearray.h:569
MAXONCONVERTMODE
MAXONCONVERTMODE
Definition: c4d_file.h:1978
maxon::Int
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:186
iferr_scope_handler
#define iferr_scope_handler
Definition: resultbase.h:1392
Int32
maxon::Int32 Int32
Definition: ge_sys_math.h:60
ApplicationOutput
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:208
BaseDocument::GetSceneRepository
maxon::Result< const maxon::UpdatableAssetRepositoryRef & > GetSceneRepository(Bool create)
maxon::Char
char Char
signed 8 bit character
Definition: apibase.h:182
EventAdd
void EventAdd(EVENT eventflag=EVENT::NONE)
maxon::AssetDatabaseStruct
Definition: asset_databases.h:16
maxon::AssetDataBasesInterface::SetDatabases
static MAXON_METHOD Result< void > SetDatabases(const Block< AssetDatabaseStruct > &newDataBases)
maxon::BaseArray::Erase
ResultPtr< T > Erase(Int position, Int eraseCnt=1)
Definition: basearray.h:865
Bool
maxon::Bool Bool
Definition: ge_sys_math.h:55
BaseDocument
Definition: c4d_basedocument.h:490
maxon::ASSET_FIND_MODE::LATEST
@ LATEST
Set this flag to obtain only the latest version of the asset.
Filename::FileSelect
Bool FileSelect(FILESELECTTYPE type, FILESELECT flags, const maxon::String &title, const maxon::String &force_suffix=maxon::String())
maxon::LiteralId::Get
const Id & Get() const
Definition: apibaseid.h:183