GLTFState is also in the build now.

This commit is contained in:
Relintai 2022-08-08 00:23:19 +02:00
parent 435a59947a
commit 2f9608aa65
3 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,8 @@ env_gltf = env_modules.Clone()
# Godot source files
env_gltf.add_source_files(env.modules_sources, "register_types.cpp")
env_gltf.add_source_files(env.modules_sources, "gltf_state.cpp")
#env_gltf.add_source_files(env.modules_sources, "*.cpp")
env_gltf.add_source_files(env.modules_sources, "extensions/*.cpp")

View File

@ -86,7 +86,7 @@ void GLTFState::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "json"), "set_json", "get_json"); // Dictionary
ADD_PROPERTY(PropertyInfo(Variant::INT, "major_version"), "set_major_version", "get_major_version"); // int
ADD_PROPERTY(PropertyInfo(Variant::INT, "minor_version"), "set_minor_version", "get_minor_version"); // int
ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "glb_data"), "set_glb_data", "get_glb_data"); // Vector<uint8_t>
ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "glb_data"), "set_glb_data", "get_glb_data"); // Vector<uint8_t>
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_named_skin_binds"), "set_use_named_skin_binds", "get_use_named_skin_binds"); // bool
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "nodes", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_nodes", "get_nodes"); // Vector<Ref<GLTFNode>>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "buffers"), "set_buffers", "get_buffers"); // Vector<Vector<uint8_t>

View File

@ -45,6 +45,8 @@
#include "extensions/gltf_light.h"
#include "extensions/gltf_spec_gloss.h"
#include "gltf_state.h"
void register_gltf_types() {
ClassDB::register_class<GLTFAccessor>();
ClassDB::register_class<GLTFAnimation>();
@ -62,7 +64,7 @@ void register_gltf_types() {
//ClassDB::register_class<GLTFDocument>();
//ClassDB::register_class<GLTFDocumentExtension>();
//ClassDB::register_class<GLTFDocumentExtensionConvertImporterMesh>();
//ClassDB::register_class<GLTFState>();
ClassDB::register_class<GLTFState>();
}
void unregister_gltf_types() {
@ -73,7 +75,7 @@ void unregister_gltf_types() {
#include "gltf_document.h"
#include "gltf_document_extension.h"
#include "gltf_document_extension_convert_importer_mesh.h"
#include "gltf_state.h"
#ifdef TOOLS_ENABLED