| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#include "core/math/expression.h" |
| 34 |
#include "core/variant/typed_array.h" |
| 35 |
#include "gltf_accessor.h" |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
class GLTFObjectModelProperty : public RefCounted { |
| 41 |
GDCLASS(GLTFObjectModelProperty, RefCounted); |
| 42 |
|
| 43 |
public: |
| 44 |
enum GLTFObjectModelType { |
| 45 |
GLTF_OBJECT_MODEL_TYPE_UNKNOWN, |
| 46 |
GLTF_OBJECT_MODEL_TYPE_BOOL, |
| 47 |
GLTF_OBJECT_MODEL_TYPE_FLOAT, |
| 48 |
GLTF_OBJECT_MODEL_TYPE_FLOAT_ARRAY, |
| 49 |
GLTF_OBJECT_MODEL_TYPE_FLOAT2, |
| 50 |
GLTF_OBJECT_MODEL_TYPE_FLOAT3, |
| 51 |
GLTF_OBJECT_MODEL_TYPE_FLOAT4, |
| 52 |
GLTF_OBJECT_MODEL_TYPE_FLOAT2X2, |
| 53 |
GLTF_OBJECT_MODEL_TYPE_FLOAT3X3, |
| 54 |
GLTF_OBJECT_MODEL_TYPE_FLOAT4X4, |
| 55 |
GLTF_OBJECT_MODEL_TYPE_INT, |
| 56 |
}; |
| 57 |
|
| 58 |
private: |
| 59 |
Ref<Expression> gltf_to_godot_expr; |
| 60 |
Ref<Expression> godot_to_gltf_expr; |
| 61 |
TypedArray<NodePath> node_paths; |
| 62 |
GLTFObjectModelType object_model_type = GLTF_OBJECT_MODEL_TYPE_UNKNOWN; |
| 63 |
Vector<PackedStringArray> json_pointers; |
| 64 |
Variant::Type variant_type = Variant::NIL; |
| 65 |
|
| 66 |
protected: |
| 67 |
static void _bind_methods(); |
| 68 |
|
| 69 |
public: |
| 70 |
void append_node_path(const NodePath &p_node_path); |
| 71 |
void append_path_to_property(const NodePath &p_node_path, const StringName &p_prop_name); |
| 72 |
|
| 73 |
GLTFAccessor::GLTFAccessorType get_accessor_type() const; |
| 74 |
GLTFAccessor::GLTFComponentType get_component_type(const Vector<Variant> &p_values) const; |
| 75 |
|
| 76 |
Ref<Expression> get_gltf_to_godot_expression() const; |
| 77 |
void set_gltf_to_godot_expression(const Ref<Expression> &p_gltf_to_godot_expr); |
| 78 |
|
| 79 |
Ref<Expression> get_godot_to_gltf_expression() const; |
| 80 |
void set_godot_to_gltf_expression(const Ref<Expression> &p_godot_to_gltf_expr); |
| 81 |
|
| 82 |
TypedArray<NodePath> get_node_paths() const; |
| 83 |
bool has_node_paths() const; |
| 84 |
void set_node_paths(const TypedArray<NodePath> &p_node_paths); |
| 85 |
|
| 86 |
GLTFObjectModelType get_object_model_type() const; |
| 87 |
void set_object_model_type(GLTFObjectModelType p_type); |
| 88 |
|
| 89 |
Vector<PackedStringArray> get_json_pointers() const; |
| 90 |
bool has_json_pointers() const; |
| 91 |
void set_json_pointers(const Vector<PackedStringArray> &p_json_pointers); |
| 92 |
|
| 93 |
TypedArray<PackedStringArray> get_json_pointers_bind() const; |
| 94 |
void set_json_pointers_bind(const TypedArray<PackedStringArray> &p_json_pointers); |
| 95 |
|
| 96 |
Variant::Type get_variant_type() const; |
| 97 |
void set_variant_type(Variant::Type p_variant_type); |
| 98 |
|
| 99 |
void set_types(Variant::Type p_variant_type, GLTFObjectModelType p_obj_model_type); |
| 100 |
}; |
| 101 |
|
| 102 |
VARIANT_ENUM_CAST(GLTFObjectModelProperty::GLTFObjectModelType); |