diff options
Diffstat (limited to 'modules/gltf/gltf_document.h')
-rw-r--r-- | modules/gltf/gltf_document.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h index f2e36a0457..7e378fe94d 100644 --- a/modules/gltf/gltf_document.h +++ b/modules/gltf/gltf_document.h @@ -40,9 +40,6 @@ class GLTFDocument : public Resource { static Vector<Ref<GLTFDocumentExtension>> all_document_extensions; Vector<Ref<GLTFDocumentExtension>> document_extensions; -private: - const float BAKE_FPS = 30.0f; - public: const int32_t JOINT_GROUP_SIZE = 4; @@ -68,6 +65,19 @@ public: TEXTURE_TYPE_GENERIC = 0, TEXTURE_TYPE_NORMAL = 1, }; + enum RootNodeMode { + ROOT_NODE_MODE_SINGLE_ROOT, + ROOT_NODE_MODE_KEEP_ROOT, + ROOT_NODE_MODE_MULTI_ROOT, + }; + +private: + const float BAKE_FPS = 30.0f; + int _naming_version = 1; + String _image_format = "PNG"; + float _lossy_quality = 0.75f; + Ref<GLTFDocumentExtension> _image_save_extension; + RootNodeMode _root_node_mode = RootNodeMode::ROOT_NODE_MODE_SINGLE_ROOT; protected: static void _bind_methods(); @@ -77,6 +87,15 @@ public: static void unregister_gltf_document_extension(Ref<GLTFDocumentExtension> p_extension); static void unregister_all_gltf_document_extensions(); + void set_naming_version(int p_version); + int get_naming_version() const; + void set_image_format(const String &p_image_format); + String get_image_format() const; + void set_lossy_quality(float p_lossy_quality); + float get_lossy_quality() const; + void set_root_node_mode(RootNodeMode p_root_node_mode); + RootNodeMode get_root_node_mode() const; + private: void _build_parent_hierachy(Ref<GLTFState> p_state); double _filter_number(double p_float); @@ -306,7 +325,8 @@ public: Error _parse_gltf_state(Ref<GLTFState> p_state, const String &p_search_path); Error _parse_asset_header(Ref<GLTFState> p_state); Error _parse_gltf_extensions(Ref<GLTFState> p_state); - void _process_mesh_instances(Ref<GLTFState> p_state, Node *p_scene_root); + void _process_mesh_instances(Ref<GLTFState> p_state); + Node *_generate_scene_node_tree(Ref<GLTFState> p_state); void _generate_scene_node(Ref<GLTFState> p_state, const GLTFNodeIndex p_node_index, Node *p_scene_parent, Node *p_scene_root); void _generate_skeleton_bone_node(Ref<GLTFState> p_state, const GLTFNodeIndex p_node_index, Node *p_scene_parent, Node *p_scene_root); void _import_animation(Ref<GLTFState> p_state, AnimationPlayer *p_animation_player, @@ -370,4 +390,6 @@ public: Error _parse(Ref<GLTFState> p_state, String p_path, Ref<FileAccess> p_file); }; +VARIANT_ENUM_CAST(GLTFDocument::RootNodeMode); + #endif // GLTF_DOCUMENT_H |