GltfObjectModelProperty
Describes how to access a property as defined in the glTF object model.
Describes how to access a property as defined in the glTF object model.
GLTFObjectModelProperty defines a mapping between a property in the glTF object model and a EntityPath in the Reckfell scene tree. This can be used to animate properties in a glTF file using the KHR_animation_pointer extension, or to access them through an engine-agnostic script such as a behavior graph as defined by the KHR_interactivity extension.
The glTF property is identified by JSON pointer(s) stored in GltfObjectModelProperty.JsonPointers, while the Reckfell property it maps to is defined by GltfObjectModelProperty.EntityPaths. In most cases GltfObjectModelProperty.JsonPointers and GltfObjectModelProperty.EntityPaths will each only have one item, but in some cases a single glTF JSON pointer will map to multiple Reckfell properties, or a single Reckfell property will be mapped to multiple glTF JSON pointers, or it might be a many-to-many relationship.
Expression objects can be used to define conversions between the data, such as when glTF defines an angle in radians and Reckfell uses degrees. The GltfObjectModelProperty.ObjectModelType property defines the type of data stored in the glTF file as defined by the object model, see GltfObjectModelProperty.GltfObjectModelType for possible values.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
GltfObjectModelPropertyConstructor
public GltfObjectModelProperty();Properties6
EntityPathsProperty
public Reckfell.Collections.Array<EntityPath> EntityPaths { get; set; }An array of EntityPaths that point to a property, or multiple properties, in the Reckfell scene tree. On import, this will either be set by GltfDocument, or by a GltfDocumentExtension class. For simple cases, use GltfObjectModelProperty.AppendPathToProperty to add properties to this array.
In most cases GltfObjectModelProperty.EntityPaths will only have one item, but in some cases a single glTF JSON pointer will map to multiple Reckfell properties. For example, a GltfCamera or GltfLight used on multiple glTF nodes will be represented by multiple Reckfell nodes.
GltfToReckfellExpressionProperty
public Expression GltfToReckfellExpression { get; set; }If set, this Expression will be used to convert the property value from the glTF object model to the value expected by the Reckfell property. This is useful when the glTF object model uses a different unit system, or when the data needs to be transformed in some way. If null, the value will be copied as-is.
JsonPointersProperty
public Reckfell.Collections.Array<string[]> JsonPointers { get; set; }The glTF object model JSON pointers used to identify the property in the glTF object model. In most cases, there will be only one item in this array, but specific cases may require multiple pointers. The items are themselves arrays which represent the JSON pointer split into its components.
ObjectModelTypeProperty
public GltfObjectModelProperty.GltfObjectModelType ObjectModelType { get; set; }The type of data stored in the glTF file as defined by the object model. This is a superset of the available accessor types, and determines the accessor type.
ReckfellToGltfExpressionProperty
public Expression ReckfellToGltfExpression { get; set; }If set, this Expression will be used to convert the property value from the Reckfell property to the value expected by the glTF object model. This is useful when the glTF object model uses a different unit system, or when the data needs to be transformed in some way. If null, the value will be copied as-is.
VariantTypeProperty
public Variant.Type VariantType { get; set; }The type of data stored in the Reckfell property. This is the type of the property that the GltfObjectModelProperty.EntityPaths point to.
Methods18
AppendEntityPathvoid
public void AppendEntityPath(EntityPath entityPath);Appends a EntityPath to GltfObjectModelProperty.EntityPaths. This can be used by GltfDocumentExtension classes to define how a glTF object model property maps to a Reckfell property, or multiple Reckfell properties. Prefer using GltfObjectModelProperty.AppendPathToProperty for simple cases. Be sure to also call GltfObjectModelProperty.SetTypes once (the order does not matter).
| Name | Type | Default |
|---|---|---|
entityPath | EntityPath | — |
AppendPathToPropertyvoid
public void AppendPathToProperty(EntityPath entityPath, StringName propName);High-level wrapper over GltfObjectModelProperty.AppendEntityPath that handles the most common cases. It constructs a new EntityPath using entity_path as a base and appends prop_name to the subpath. Be sure to also call GltfObjectModelProperty.SetTypes once (the order does not matter).
| Name | Type | Default |
|---|---|---|
entityPath | EntityPath | — |
propName | StringName | — |
GetAccessorTypeGltfAccessor.GltfAccessorType
public GltfAccessor.GltfAccessorType GetAccessorType();The GLTF accessor type associated with this property's GltfObjectModelProperty.ObjectModelType. See GltfAccessor.AccessorType for possible values, and see GltfObjectModelProperty.GltfObjectModelType for how the object model type maps to accessor types.
GltfAccessor.GltfAccessorTypeGetEntityPathsReckfell.Collections.Array<EntityPath>
public Reckfell.Collections.Array<EntityPath> GetEntityPaths();Reckfell.Collections.Array<EntityPath>GetGltfToReckfellExpressionExpression
public Expression GetGltfToReckfellExpression();ExpressionGetJsonPointersReckfell.Collections.Array<string[]>
public Reckfell.Collections.Array<string[]> GetJsonPointers();Reckfell.Collections.Array<string[]>GetObjectModelTypeGltfObjectModelProperty.GltfObjectModelType
public GltfObjectModelProperty.GltfObjectModelType GetObjectModelType();GltfObjectModelProperty.GltfObjectModelTypeGetReckfellToGltfExpressionExpression
public Expression GetReckfellToGltfExpression();ExpressionGetVariantTypeVariant.Type
public Variant.Type GetVariantType();Variant.TypeHasEntityPathsbool
public bool HasEntityPaths();Returns true if GltfObjectModelProperty.EntityPaths is not empty. This is used during import to determine if a GltfObjectModelProperty can handle converting a glTF object model property to a Reckfell property.
boolHasJsonPointersbool
public bool HasJsonPointers();Returns true if GltfObjectModelProperty.JsonPointers is not empty. This is used during export to determine if a GltfObjectModelProperty can handle converting a Reckfell property to a glTF object model property.
boolSetEntityPathsvoid
public void SetEntityPaths(Reckfell.Collections.Array<EntityPath> entityPaths);| Name | Type | Default |
|---|---|---|
entityPaths | Reckfell.Collections.Array<EntityPath> | — |
SetGltfToReckfellExpressionvoid
public void SetGltfToReckfellExpression(Expression gltfToReckfellExpr);| Name | Type | Default |
|---|---|---|
gltfToReckfellExpr | Expression | — |
SetJsonPointersvoid
public void SetJsonPointers(Reckfell.Collections.Array<string[]> jsonPointers);| Name | Type | Default |
|---|---|---|
jsonPointers | Reckfell.Collections.Array<string[]> | — |
SetObjectModelTypevoid
public void SetObjectModelType(GltfObjectModelProperty.GltfObjectModelType type);| Name | Type | Default |
|---|---|---|
type | GltfObjectModelProperty.GltfObjectModelType | — |
SetReckfellToGltfExpressionvoid
public void SetReckfellToGltfExpression(Expression reckfellToGltfExpr);| Name | Type | Default |
|---|---|---|
reckfellToGltfExpr | Expression | — |
SetTypesvoid
public void SetTypes(Variant.Type variantType, GltfObjectModelProperty.GltfObjectModelType objModelType);Sets the GltfObjectModelProperty.VariantType and GltfObjectModelProperty.ObjectModelType properties. This is a convenience method to set both properties at once, since they are almost always known at the same time. This method should be called once. Calling it again with the same values will have no effect.
| Name | Type | Default |
|---|---|---|
variantType | Variant.Type | — |
objModelType | GltfObjectModelProperty.GltfObjectModelType | — |
SetVariantTypevoid
public void SetVariantType(Variant.Type variantType);| Name | Type | Default |
|---|---|---|
variantType | Variant.Type | — |
GltfObjectModelProperty.GltfObjectModelType
| Value | Description |
|---|---|
Bool = 1 | Object model type "bool". Represented in the glTF JSON as a boolean, and encoded in a |
Float = 2 | Object model type "float". Represented in the glTF JSON as a number, and encoded in a |
Float2 = 4 | Object model type "float2". Represented in the glTF JSON as an array of two numbers, and encoded in a |
Float2X2 = 7 | Object model type "float2x2". Represented in the glTF JSON as an array of four numbers, and encoded in a |
Float3 = 5 | Object model type "float3". Represented in the glTF JSON as an array of three numbers, and encoded in a |
Float3X3 = 8 | Object model type "float3x3". Represented in the glTF JSON as an array of nine numbers, and encoded in a |
Float4 = 6 | Object model type "float4". Represented in the glTF JSON as an array of four numbers, and encoded in a |
Float4X4 = 9 | Object model type "float4x4". Represented in the glTF JSON as an array of sixteen numbers, and encoded in a |
FloatArray = 3 | Object model type "float |
Int = 10 | Object model type "int". Represented in the glTF JSON as a number, and encoded in a |
Unknown = 0 | Unknown or not set object model type. If the object model type is set to this value, the real type still needs to be determined. |