Metadatas are one of the basic entities in Atoms. They wrap basic data types and inherit the basic object AtomsCore.Metadata.
The basic Metadata class has functions to clone, copy, serialize etc.
These are the basic metadata type that can be used inside Atoms:
- BoolMetadata
- BoolArrayMetadata
- IntMetadata
- IntArrayMetadata
- DoubleMetadata
- DoubleArrayMetadata
- Vector3Metadata
- Vector3ArrayMetadata
- EulerMetadata
- EulerArrayMetadata
- QuaternionMetadata
- QuaternionArrayMetadata
- MatrixMetadata
- MatrixArrayMetadata
- CurveMetadata
- CurveArrayetadata
- MeshMetadata
- MeshArrayMetadata
- ImageMetadata
- PoseMetadata
- SkeletonMetadata
These are container metadata types:
- MapMetadata
- ArrayMetadata
Creating metadatas
You can create metadatas using the constructor of each type or you can use the metadata factory. Every metadata type has a unique typeId, it's used to register the metadata inside the metadata factory. Since the serialization code relies on this factory.
import AtomsCore intMeta = AtomsCore.IntMetadata(5) doubleMeta = AtomsCore.DoubleMetadata(654.4) factory = AtomsCore.MetadataFactory.instance() data = factory.createMetadata(AtomsCore.Vector3Metadata.staticTypeId())
MapMetada
The MapMetadata is a map container for metadatas. It can store different metadata types at the same time. It uses strings as keys.
To insert data inside a MapMetadata:
import AtomsCore mapMeta = AtomsCore.MapMetadata() #Insert element cloning the data mapMeta["myKey1"] = AtomsCore.IntMetadata(4)
To get an entry from the map:
vecData = mapMeta["myKey3"] intData = mapMeta["myKey1"]
ArrayMetadata
The array metadata is similar to the MapMetadata but it stores metadata in a vector rather than a map.