Open Search
    DataDescriptionDefinition Manual

    About

    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.

    Description

    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::LanguageRef language = maxon::LanguageRef::Create() iferr_return;
    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;
    DiagnosticOutput("Attribute \"@\" of type @. Default value: @", ID, attributeDataType, defaultData);
    }
    @ DEFAULTVALUE
    Dummy value for the default value GeData constructor.
    Definition: c4d_gedata.h:65
    COMPLETE
    Complete.
    Definition: c4d_tools.h:4
    Definition: datatypebase.h:1199
    Result< typename std::conditional< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, T, typename ByValueParam< T >::type >::type > Get() const
    Definition: datatypebase.h:1404
    Definition: apibaseid.h:253
    Definition: datatypelib.h:31
    const Id & Get() const
    Definition: datatypelib.h:164
    const Id & Get() const
    Definition: apibaseid.h:185
    const wchar_t * mode
    Definition: fileutils.h:96
    for(i=0;i< length;i++)
    Definition: unicodeobject.h:61
    static auto Create(ARGS &&... args)
    Definition: apibase.h:2773
    #define DiagnosticOutput(formatString,...)
    Definition: debugdiagnostics.h:176
    The maxon namespace contains all declarations of the MAXON API.
    Definition: autoweight.h:14
    const Id DATADESCRIPTION_CATEGORY_DATA
    Definition: datadescriptiondatabase.h:15
    LOADDESCRIPTIONMODE
    Definition: datadescriptiondefinitiondatabase.h:79
    #define iferr_return
    Definition: resultbase.h:1519

    Database

    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:

    Further Reading