Create assets and presets for scene elements to be stored in an asset database.
Assets come as the asset types of scenes, objects, materials, media files, nodes and presets for the user in the Asset Browser. But there are also more assets types like categories, keywords, files, plugins and other types which are less obviously assets from the user view. An asset can conceptually be split into its primary data, for example the polygonal geometry for a polygon object asset, and its metadata which describe that asset. The primary data for classic API objects, tags and scenes is internally being wrapped as a document containing all asset dependencies when an asset is being stored and other asset types are being stored as resources.
Assets can also define presets of parameter values or sets of parameter values; e.g., the value of a gradient parameter or all the parameters that make up an instance of a Cube object. Such preset asset can then be loaded from the Asset Browser into any scene element that also contains that type of parameter or set of parameters. Assets can also be versioned, capturing multiple expressions of one piece of content, e.g., different development stages of a texture, mesh or material.
With the built-in asset types it is currently not possible to create an asset that wraps only a BaseTag or BaseShader. Because the former requires a BaseObject instance and the latter a BaseMaterial instance to be stored in a document. But due to the collection of asset dependencies, it is possible to store a BaseObject with its tags or a BaseMaterial with its shaders as a single asset. Assets for the maxon Nodes API are not limited by such restrictions.
Assets are represented as asset descriptions by AssetDescriptionInterface references when interacting with asset databases in the Asset API. The interface can access the AssetInterface reference for an asset, holds the Url of an asset and can read and write descriptive metadata into for its asset. See Asset API Metadata for details on the asset model of the Asset API. The logical interface to an asset is represented by the interfaces AssetInterface and AssetTypeInterface. The former provides a view on a single asset in an asset database, primarily in form of its identifier, asset type and metadata. The latter generalizes a certain type of asset and provides among other functionalities the ability to load a reference to an AsstInterface and store assets with an AssetDescription reference.
The namespace AssetTypes contains the asset type declarations provided by Cinema 4D like for example the asset types AssetTypes::File or AssetTypes::Keyword. Object, Material, Scene assets are saved as a FileAsset and do not have their own assets type. The subtype of this FileAsset is specified by attributes in the ASSETMETADATA namespace. The metadata of such a FileAsset declare via its sub-type property if the asset is an image, movie, object, material or scene asset. In many use cases all this complexity can be hidden away by using the AssetCreationInterface which provides convenience methods for creating assets. Specific asset types also have their own AssetTypeInterface, providing asset type related functionalities as static functions. The SubTypeAssetInterface allows for example to set the subtype of a SubType asset and the CategoryAssetInterface to get and set the category of a CategoryAsset.
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. | |
API Entities | AssetTypes | Contains the declarations of asset types. |
ASSETMETADATA | Contains the declarations of asset metadata attributes. | |
AssetDependencyStruct | Not yet documented | |
AssetDescriptionInterface | Represents an asset as its administrative metadata and provides access to its descriptive metadata. | |
AssetInterface | Represents digital content which can be managed by an asset repository. | |
AssetTypeInterface | Provides the methods needed by an asset repository to handle a specific type of assets. | |
BasePresetAssetInterface | Allows to implement details for preset assets. | |
BasePresetAssetTypeInterface | Defines a new preset type and is the connector to BasePresetAssetInterface. | |
CategoryAssetInterface | Not yet documented | |
ColorCategoryAssetInterface | Not yet documented | |
DatabaseAssetInterface | Not yet documented | |
DataDescriptionPresetStorageInterface | Not yet documented | |
FileAssetInterface | Represents a file asset, so a plain file (or directory) stored in an asset repository. | |
KeywordAssetInterface | Not yet documented | |
NodeSpaceAssetInterface | Not yet documented | |
PluginAssetInterface | Not yet documented | |
SmartSearchAssetInterface | Not yet documented | |
StoreAssetStruct | Not yet documented | |
SubTypeAssetInterface | Not yet documented | |
UpdatableAssetInterface | Represents an asset which supports the update of its updateable references to other assets to newer versions. | |
UrlAssetRepositoryInterface | Not yet documented
| |
SDK Plugins | Asset API Basics | Showcases basic interactions with the Asset API to modify asset databases and their content. |
Asset Type Implementation | Not yet documented | |
Preset Asset Type Implementation | Not yet documented
| |
Common Tasks | Create Object Assets | Create assets for classic API objects that can be stored in asset databases. |
Create Material Assets | Create assets for classic API materials that can be stored in asset databases. | |
Create Scenes Assets | Create assets for classic API scenes that can be stored in asset databases. | |
Create File Assets | Not yet documented | |
Create Node Setup Assets | Not yet documented | |
Create Category Assets | Not yet documented | |
Create Keyword Assets | Not yet documented | |
Create Parameter Preset Assets | Not yet documented | |
Create Scene Element Preset Assets | Not yet documented |
Create assets for classic API objects that can be stored in asset databases.
This snippet can be found in a compileable context in the SDK plugin Asset API Basics.
Create assets for classic API materials that can be stored in asset databases.
This snippet can be found in a compileable context in the SDK plugin Asset API Basics.
Create assets for classic API scenes that can be stored in asset databases.
This snippet can be found in a compileable context in the SDK plugin Asset API Basics.