DataDescriptionDefinition Manual
A DataDescriptionDefinition represents the "raw" description of data attributes. Such a definition is stored e.g. in a static file and loaded by Cinema 4D . The description definition is the base for the final, "resolved" data description, see DataDescription Manual .
General information ( maxon::DESCRIPTION::DATA::INFO ) is accessed with:
The various attribute descriptions in the definition are stored as DataDictionaries (using the alias maxon::DataDescriptionEntry ):
Usable observables are:
ObservableDescriptionChanged:
Is fired on any change of the definition.
// data type ID const maxon::IdAndVersion dataType = { "net.maxonexample.class.descriptionElement" , maxon::Id () };
// load data description definition const maxon::Id category = maxon::DATADESCRIPTION_CATEGORY_DATA ; const maxon::LanguageRef language = maxon::LanguageRef::Create() iferr_return ; const maxon :: LOADDESCRIPTIONMODE mode = maxon :: LOADDESCRIPTIONMODE :: COMPLETE ; maxon ::DataDescriptionDefinition definition = maxon ::DataDescriptionDefinitionDatabaseInterface::LoadDescription(mode, category, language, dataType) iferr_return ;
// get all attributes const auto attributes = definition.GetEntries() iferr_return ;
// list all attributes for (auto& attribute : attributes) { const maxon::InternedId ID = attribute. Get (maxon::DESCRIPTION::BASE::IDENTIFIER) iferr_return ; const maxon::Id attributeDataType = attribute. Get (maxon::DESCRIPTION::DATA::BASE::DATATYPE) iferr_return ; const maxon::Data defaultData = attribute. Get ( maxon::DESCRIPTION::DATA::BASE::DEFAULTVALUE ) iferr_return ;
DataDescriptionDefinitions are stored in databases. These databases are managed with maxon::DataDescriptionDefinitionDatabaseInterface .
Description definition databases can be stored in JSON files. These files are loaded with RegisterDatabaseWithUrl().
The databases are accessed with:
For an example see Loading Data Descriptions .
The descriptions stored in the databases are accessed with:
A stored description definition can be updated with:
It is possible to directly access attributes stored in the description definitions:
A callback function can be registered: