|
@@ -38,13 +38,15 @@ void GLTFDocumentExtension::_bind_methods() {
|
|
|
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");
|
|
|
+ GDVIRTUAL_BIND(_import_pre_generate, "state");
|
|
|
+ GDVIRTUAL_BIND(_generate_scene_node, "state", "gltf_node", "scene_parent");
|
|
|
GDVIRTUAL_BIND(_import_node, "state", "gltf_node", "json", "node");
|
|
|
GDVIRTUAL_BIND(_import_post, "state", "root");
|
|
|
// Export process.
|
|
|
GDVIRTUAL_BIND(_export_preflight, "state", "root");
|
|
|
GDVIRTUAL_BIND(_convert_scene_node, "state", "gltf_node", "scene_node");
|
|
|
+ GDVIRTUAL_BIND(_export_post_convert, "state", "root");
|
|
|
GDVIRTUAL_BIND(_export_preserialize, "state");
|
|
|
GDVIRTUAL_BIND(_get_saveable_image_formats);
|
|
|
GDVIRTUAL_BIND(_serialize_image_to_bytes, "state", "image", "image_dict", "image_format", "lossy_quality");
|
|
@@ -98,6 +100,20 @@ Error GLTFDocumentExtension::parse_texture_json(Ref<GLTFState> p_state, const Di
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
+Error GLTFDocumentExtension::import_post_parse(Ref<GLTFState> p_state) {
|
|
|
+ ERR_FAIL_COND_V(p_state.is_null(), ERR_INVALID_PARAMETER);
|
|
|
+ Error err = OK;
|
|
|
+ GDVIRTUAL_CALL(_import_post_parse, p_state, err);
|
|
|
+ return err;
|
|
|
+}
|
|
|
+
|
|
|
+Error GLTFDocumentExtension::import_pre_generate(Ref<GLTFState> p_state) {
|
|
|
+ ERR_FAIL_COND_V(p_state.is_null(), ERR_INVALID_PARAMETER);
|
|
|
+ Error err = OK;
|
|
|
+ GDVIRTUAL_CALL(_import_pre_generate, p_state, err);
|
|
|
+ return err;
|
|
|
+}
|
|
|
+
|
|
|
Node3D *GLTFDocumentExtension::generate_scene_node(Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node, Node *p_scene_parent) {
|
|
|
ERR_FAIL_COND_V(p_state.is_null(), nullptr);
|
|
|
ERR_FAIL_COND_V(p_gltf_node.is_null(), nullptr);
|
|
@@ -106,13 +122,6 @@ Node3D *GLTFDocumentExtension::generate_scene_node(Ref<GLTFState> p_state, Ref<G
|
|
|
return ret_node;
|
|
|
}
|
|
|
|
|
|
-Error GLTFDocumentExtension::import_post_parse(Ref<GLTFState> p_state) {
|
|
|
- ERR_FAIL_COND_V(p_state.is_null(), ERR_INVALID_PARAMETER);
|
|
|
- Error err = OK;
|
|
|
- GDVIRTUAL_CALL(_import_post_parse, p_state, err);
|
|
|
- return err;
|
|
|
-}
|
|
|
-
|
|
|
Error GLTFDocumentExtension::import_node(Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node, Dictionary &r_dict, Node *p_node) {
|
|
|
ERR_FAIL_COND_V(p_state.is_null(), ERR_INVALID_PARAMETER);
|
|
|
ERR_FAIL_COND_V(p_gltf_node.is_null(), ERR_INVALID_PARAMETER);
|
|
@@ -145,6 +154,14 @@ void GLTFDocumentExtension::convert_scene_node(Ref<GLTFState> p_state, Ref<GLTFN
|
|
|
GDVIRTUAL_CALL(_convert_scene_node, p_state, p_gltf_node, p_scene_node);
|
|
|
}
|
|
|
|
|
|
+Error GLTFDocumentExtension::export_post_convert(Ref<GLTFState> p_state, Node *p_root) {
|
|
|
+ ERR_FAIL_COND_V(p_state.is_null(), ERR_INVALID_PARAMETER);
|
|
|
+ ERR_FAIL_NULL_V(p_root, ERR_INVALID_PARAMETER);
|
|
|
+ Error err = OK;
|
|
|
+ GDVIRTUAL_CALL(_export_post_convert, p_state, p_root, err);
|
|
|
+ return err;
|
|
|
+}
|
|
|
+
|
|
|
Error GLTFDocumentExtension::export_preserialize(Ref<GLTFState> p_state) {
|
|
|
ERR_FAIL_COND_V(p_state.is_null(), ERR_INVALID_PARAMETER);
|
|
|
Error err = OK;
|