bw logo

Chapter 8. Meta Data

Meta Data can be used to define arbitrary properties for existing objects. With meta data, you can add extra properties to models, particle systems or any objects in chunk. Those properties are listed along other properties and can be edited in the same way.

Currently we have two kinds of meta data:

  • Asset meta data: They are extra properties added to individual asset like model, particle system, etc. They are saved with the asset.

  • Instance meta data: They are extra properties added to the instance of an asset in the space. They are saved to chunk file by World Editor.

Meta Data

Above is the Properties panel of World Editor, it shows properties of a selected model. The properties listed under "asset metadata" (surrounded by the red rectangle) are the meta data properties of the model itself (asset meta data). The properties marked by a prefix red bar are the meta data properties of this chunk model instance (instance meta data).

Note: Asset meta data is read-only in World Editor.

Meta data properties are defined by XML files. Currently we only support three kind of meta data, they are:

  • Meta data for models: its definition file is defined in section editor/metaDataConfig/model of resources.xml, the default value is helpers/meta_data/model.xml

  • Meta data for particles: its definition file is defined in section editor/metaDataConfig/metaParticleSystem of resources.xml, the default value is helpers/meta_data/meta_particle_system.xml

  • Meta data for chunk items: its definition file is defined in section editor/metaDataConfig/chunkItem of resources.xml, the default value is helpers/meta_data/chunk_item.xml

Each section in the files defines a property. Its format is:

<PropertyName>
    <description> optional description </description>
    <type> TYPE </type>
</PropertyName>

Currently, the types we support are STRING, INT, FLOAT, COMMENT and DATETIME. If description section is not presented, we will use. For example, if you want to add a new property named "girth index", which is the index into a girth array to describe the model's girth. As "girth index" cannot be used as XML section name, a description must be provided. This property could be defined as follow:

<girth_index>
    <description> girth index </description>
    <type> INT </type>
</girth_index>

In addition to the properties defined in the XML files, each object with meta data also has some default properties. They are defined in the engine. Currently we only have 6 default properties: "created by", "created on", "modified by", "modified on", "comments" and "description".

"created by" and "created on" are automatically filled when the object linked to this meta data is first created, i.e. when a model is exported by the exporter, a meta particle system is created in Particle Editor or an object placed/cloned inside World Editor. "modified by" and "modified on" are automatically filled when there is any modification made to the object. All those fields are generated by the system and are read-only to the user.

"description" is a single string field used to add a simple description to the object while "comments" can have multiple entries under it. Besides the text, each comment also records the user who creates the comment and the time the comment is created.

If one of the definition files does not exist, the corresponding objects will still get their default properties.