MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / append_from_buffer

Method append_from_buffer

modules/fbx/fbx_document.cpp:2175–2195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2173}
2174
2175Error FBXDocument::append_from_buffer(PackedByteArray p_bytes, String p_base_path, Ref<GLTFState> p_state, uint32_t p_flags) {
2176 Ref<FBXState> state = p_state;
2177 ERR_FAIL_COND_V(state.is_null(), ERR_INVALID_PARAMETER);
2178 ERR_FAIL_NULL_V(p_bytes.ptr(), ERR_INVALID_DATA);
2179 Error err = FAILED;
2180 state->use_named_skin_binds = p_flags & FBX_IMPORT_USE_NAMED_SKIN_BINDS;
2181 state->discard_meshes_and_materials = p_flags & FBX_IMPORT_DISCARD_MESHES_AND_MATERIALS;
2182
2183 Ref<FileAccessMemory> file_access;
2184 file_access.instantiate();
2185 file_access->open_custom(p_bytes.ptr(), p_bytes.size());
2186 state->base_path = p_base_path.get_base_dir();
2187 err = _parse(state, state->base_path, file_access);
2188 ERR_FAIL_COND_V(err != OK, err);
2189 for (Ref<GLTFDocumentExtension> ext : document_extensions) {
2190 ERR_CONTINUE(ext.is_null());
2191 err = ext->import_post_parse(state);
2192 ERR_FAIL_COND_V(err != OK, err);
2193 }
2194 return OK;
2195}
2196
2197Error FBXDocument::_parse_fbx_state(Ref<FBXState> p_state, const String &p_search_path) {
2198 Error err;

Callers 1

parse_gltf_documentMethod · 0.45

Calls 7

open_customMethod · 0.80
get_base_dirMethod · 0.80
import_post_parseMethod · 0.80
sizeMethod · 0.65
is_nullMethod · 0.45
ptrMethod · 0.45
instantiateMethod · 0.45

Tested by

no test coverage detected