AssetDB
AssetDb is persistent layer for CDB that support import/export of asset from fs, net etc...
Why
Because CDB is strictly memory-oriented we need some mechanism to load/save it.
We need mechanism for convert DCC assets like Texture/Meshes/Scene to CDB object that can be used inside engine.
We need support VCS systems like Git.
How it works
AssetDB map UUID to cdbobj if obj go thru it via save/load methods.
Asset is CDB object associated with name, folder and is load/save from fs, net etc.
Asset act like wrapper for real asset object that is store inside "asset" property.
Asset JSON base format
Assets are saved as valid JSON object. Filename is derived form asset name, CDB type and path by folder ex.: core/core_subfolder/foo_subcore.ct_foo_asset
has asset name foo_subcore
,CDB type ct_foo_asset
and is in folder core_subfolder
.
Reserved keyword begin with__
prefix and some with __
postfix after property name. Reference UUID is in format cdb_type_name:UUID
.
Keyword | Required | Description |
---|---|---|
| Yes | File format version in semver format |
| Only for top-level | UUID for asset wrapper not asset object |
| No and allowed only for top-level | Description for asset |
| Yes | CDB type name as string |
| Yes | UUID of asset object |
| No | If object is based on prototype must have this filed |
| No | This create subobject instance from prototype, and replace it in set. Valid only for |
| No | This remove subobject from set. Valid only for |
.ct_temp/assetdb_graph.d2
This file contain asset dependency graph.
.ex: for fixtures/test_asset/.ct_temp/assetdb_graph.d2