Documentation
¶
Overview ¶
GLTFObjectModelProperty defines a mapping between a property in the glTF object model and a NodePath in the Godot 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 Instance.JsonPointers, while the Godot property it maps to is defined by Instance.NodePaths. In most cases Instance.JsonPointers and Instance.NodePaths will each only have one item, but in some cases a single glTF JSON pointer will map to multiple Godot properties, or a single Godot property will be mapped to multiple glTF JSON pointers, or it might be a many-to-many relationship.
graphics.gd/classdb/Expression objects can be used to define conversions between the data, such as when glTF defines an angle in radians and Godot uses degrees. The Instance.ObjectModelType property defines the type of data stored in the glTF file as defined by the object model, see GLTFObjectModelType for possible values.
Index ¶
- type Advanced
- type Any
- type Extension
- type GLTFObjectModelType
- type ID
- type Instance
- func (self Instance) AppendNodePath(node_path string)
- func (self Instance) AppendPathToProperty(node_path string, prop_name string)
- func (self Instance) AsGLTFObjectModelProperty() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) GetAccessorType() GLTFAccessor.GLTFAccessorType
- func (self Instance) GltfToGodotExpression() Expression.Instance
- func (self Instance) GodotToGltfExpression() Expression.Instance
- func (self Instance) HasJsonPointers() bool
- func (self Instance) HasNodePaths() bool
- func (self Instance) ID() ID
- func (self Instance) JsonPointers() [][]string
- func (self Instance) NodePaths() []string
- func (self Instance) ObjectModelType() GLTFObjectModelType
- func (self Instance) SetGltfToGodotExpression(value Expression.Instance)
- func (self Instance) SetGodotToGltfExpression(value Expression.Instance)
- func (self Instance) SetJsonPointers(value [][]string)
- func (self Instance) SetNodePaths(value []string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetObjectModelType(value GLTFObjectModelType)
- func (self Instance) SetTypes(variant_type variant.Type, obj_model_type GLTFObjectModelType)
- func (self Instance) SetVariantType(value variant.Type)
- func (self Instance) VariantType() variant.Type
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsGLTFObjectModelProperty ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
type GLTFObjectModelType ¶
type GLTFObjectModelType int //gd:GLTFObjectModelProperty.GLTFObjectModelType
const ( // 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. GltfObjectModelTypeUnknown GLTFObjectModelType = 0 // Object model type "bool". Represented in the glTF JSON as a boolean, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "SCALAR". When encoded in an accessor, a value of 0 is false, and any other value is true. GltfObjectModelTypeBool GLTFObjectModelType = 1 // Object model type "float". Represented in the glTF JSON as a number, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "SCALAR". GltfObjectModelTypeFloat GLTFObjectModelType = 2 // Object model type "float[]". Represented in the glTF JSON as an array of numbers, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "SCALAR". GltfObjectModelTypeFloatArray GLTFObjectModelType = 3 // Object model type "float2". Represented in the glTF JSON as an array of two numbers, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "VEC2". GltfObjectModelTypeFloat2 GLTFObjectModelType = 4 // Object model type "float3". Represented in the glTF JSON as an array of three numbers, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "VEC3". GltfObjectModelTypeFloat3 GLTFObjectModelType = 5 // Object model type "float4". Represented in the glTF JSON as an array of four numbers, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "VEC4". GltfObjectModelTypeFloat4 GLTFObjectModelType = 6 // Object model type "float2x2". Represented in the glTF JSON as an array of four numbers, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "MAT2". GltfObjectModelTypeFloat2x2 GLTFObjectModelType = 7 // Object model type "float3x3". Represented in the glTF JSON as an array of nine numbers, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "MAT3". GltfObjectModelTypeFloat3x3 GLTFObjectModelType = 8 // Object model type "float4x4". Represented in the glTF JSON as an array of sixteen numbers, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "MAT4". GltfObjectModelTypeFloat4x4 GLTFObjectModelType = 9 // Object model type "int". Represented in the glTF JSON as a number, and encoded in a [graphics.gd/classdb/GLTFAccessor] as "SCALAR". The range of values is limited to signed integers. For KHR_interactivity, only 32-bit integers are supported. GltfObjectModelTypeInt GLTFObjectModelType = 10 )
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.GLTFObjectModelProperty
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AppendNodePath ¶
Appends a node path to Instance.NodePaths. This can be used by graphics.gd/classdb/GLTFDocumentExtension classes to define how a glTF object model property maps to a Godot property, or multiple Godot properties. Prefer using Instance.AppendPathToProperty for simple cases. Be sure to also call Instance.SetTypes once (the order does not matter).
func (Instance) AppendPathToProperty ¶
High-level wrapper over Instance.AppendNodePath that handles the most common cases. It constructs a new node path using 'node_path' as a base and appends 'prop_name' to the subpath. Be sure to also call Instance.SetTypes once (the order does not matter).
func (Instance) AsGLTFObjectModelProperty ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) GetAccessorType ¶
func (self Instance) GetAccessorType() GLTFAccessor.GLTFAccessorType
The GLTF accessor type associated with this property's Instance.ObjectModelType. See graphics.gd/classdb/GLTFAccessor.Instance.AccessorType for possible values, and see GLTFObjectModelType for how the object model type maps to accessor types.
func (Instance) GltfToGodotExpression ¶
func (self Instance) GltfToGodotExpression() Expression.Instance
func (Instance) GodotToGltfExpression ¶
func (self Instance) GodotToGltfExpression() Expression.Instance
func (Instance) HasJsonPointers ¶
Returns true if Instance.JsonPointers is not empty. This is used during export to determine if a graphics.gd/classdb/GLTFObjectModelProperty can handle converting a Godot property to a glTF object model property.
func (Instance) HasNodePaths ¶
Returns true if Instance.NodePaths is not empty. This is used during import to determine if a graphics.gd/classdb/GLTFObjectModelProperty can handle converting a glTF object model property to a Godot property.
func (Instance) JsonPointers ¶
func (Instance) ObjectModelType ¶
func (self Instance) ObjectModelType() GLTFObjectModelType
func (Instance) SetGltfToGodotExpression ¶
func (self Instance) SetGltfToGodotExpression(value Expression.Instance)
func (Instance) SetGodotToGltfExpression ¶
func (self Instance) SetGodotToGltfExpression(value Expression.Instance)
func (Instance) SetJsonPointers ¶
func (Instance) SetNodePaths ¶
func (Instance) SetObjectModelType ¶
func (self Instance) SetObjectModelType(value GLTFObjectModelType)
func (Instance) SetTypes ¶
func (self Instance) SetTypes(variant_type variant.Type, obj_model_type GLTFObjectModelType)
Sets the Instance.VariantType and Instance.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.