1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-04 17:04:49 +00:00

GLTF: Preserve the original bytes when importing a texture

This commit is contained in:
Aaron Franke
2023-07-15 22:23:43 -05:00
parent 725beaa7af
commit 2d13a9651c
7 changed files with 44 additions and 10 deletions

View File

@@ -36,6 +36,7 @@ void GLTFDocumentExtension::_bind_methods() {
GDVIRTUAL_BIND(_get_supported_extensions);
GDVIRTUAL_BIND(_parse_node_extensions, "state", "gltf_node", "extensions");
GDVIRTUAL_BIND(_parse_image_data, "state", "image_data", "mime_type", "ret_image");
GDVIRTUAL_BIND(_get_image_file_extension);
GDVIRTUAL_BIND(_parse_texture_json, "state", "texture_json", "ret_gltf_texture");
GDVIRTUAL_BIND(_generate_scene_node, "state", "gltf_node", "scene_parent");
GDVIRTUAL_BIND(_import_post_parse, "state");
@@ -78,6 +79,12 @@ Error GLTFDocumentExtension::parse_image_data(Ref<GLTFState> p_state, const Pack
return err;
}
String GLTFDocumentExtension::get_image_file_extension() {
String ret;
GDVIRTUAL_CALL(_get_image_file_extension, ret);
return ret;
}
Error GLTFDocumentExtension::parse_texture_json(Ref<GLTFState> p_state, const Dictionary &p_texture_json, Ref<GLTFTexture> r_gltf_texture) {
ERR_FAIL_NULL_V(p_state, ERR_INVALID_PARAMETER);
ERR_FAIL_NULL_V(r_gltf_texture, ERR_INVALID_PARAMETER);