1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Implement naming version system for FBX and Blend importers like glTF

This commit is contained in:
Aaron Franke
2025-06-10 00:41:33 -07:00
parent db57f282fa
commit a56b3a93d3
7 changed files with 55 additions and 2 deletions

View File

@@ -2217,7 +2217,11 @@ Error FBXDocument::_parse_fbx_state(Ref<FBXState> p_state, const String &p_searc
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
/* DETERMINE SKELETONS */
err = SkinTool::_determine_skeletons(p_state->skins, p_state->nodes, p_state->skeletons, p_state->get_import_as_skeleton_bones() ? p_state->root_nodes : Vector<GLTFNodeIndex>());
if (p_state->get_import_as_skeleton_bones()) {
err = SkinTool::_determine_skeletons(p_state->skins, p_state->nodes, p_state->skeletons, p_state->root_nodes, true);
} else {
err = SkinTool::_determine_skeletons(p_state->skins, p_state->nodes, p_state->skeletons, Vector<GLTFNodeIndex>(), _naming_version < 2);
}
ERR_FAIL_COND_V(err != OK, ERR_PARSE_ERROR);
/* CREATE SKELETONS */
@@ -2490,6 +2494,14 @@ Error FBXDocument::append_from_scene(Node *p_node, Ref<GLTFState> p_state, uint3
return ERR_UNAVAILABLE;
}
void FBXDocument::set_naming_version(int p_version) {
_naming_version = p_version;
}
int FBXDocument::get_naming_version() const {
return _naming_version;
}
Vector3 FBXDocument::_as_vec3(const ufbx_vec3 &p_vector) {
return Vector3(real_t(p_vector.x), real_t(p_vector.y), real_t(p_vector.z));
}