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.
// This example loads the data description definition of the given data type.

// 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 ;

DiagnosticOutput ( "Attribute \"@\" of type @. Default value: @" , ID, attributeDataType, defaultData); }

数据库

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:

延伸阅读

maxon
The maxon namespace contains all declarations of the MAXON API.
定义: c4d_basedocument.h:15
maxon::Tuple
定义: tuple.h:553
maxon::Data
定义: datatypebase.h:1143
maxon::Id
定义: apibaseid.h:250
iferr_return
#define iferr_return
定义: resultbase.h:1434
maxon::Data::Get
Result< typename std::conditional< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, T, typename ByValueParam< T >::type >::type > Get() const
定义: datatypebase.h:1352
DiagnosticOutput
#define DiagnosticOutput(formatString,...)
定义: debugdiagnostics.h:166
maxon::DATADESCRIPTION_CATEGORY_DATA
const Id DATADESCRIPTION_CATEGORY_DATA
定义: datadescriptiondatabase.h:17
maxon::LOADDESCRIPTIONMODE
LOADDESCRIPTIONMODE
定义: datadescriptiondefinitiondatabase.h:77
maxon::InternedId
定义: datatypelib.h:26
DEFAULTVALUE
@ DEFAULTVALUE
Dummy value for the default value GeData constructor.
定义: c4d_gedata.h:65
maxon::InternedId::Get
const Id & Get() const
定义: datatypelib.h:138
COMPLETE
COMPLETE
Complete.
定义: c4d_tools.h:2658
maxon::LiteralId::Get
const Id & Get() const
定义: apibaseid.h:183

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1