Implement naming version system for FBX and Blend importers like glTF #107352
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on the request here #106537 (comment)
This is the same as the system introduced in PR #84271 and is important for preserving compatibility due to changes introduced in PR #104184, PR #106537, and PR #80270.
This PR implements the same naming version system found in glTF in the UFBX, FBX2glTF, and Blend editor scene format importers, with UFBX getting a new
_naming_versionfield, and FBX2glTF/Blend forwarding this to GLTFDocument.This should make FBX and Blender files imported in Godot <= 4.4 behave the same in Godot 4.5 and later, because they will automatically have this naming version set for compatibility. This only applies to files imported in older Godot versions with existing
.importfiles. Any brand new files without.importfiles will be given the latest version.In FBXDocument, I am using the same naming version numbers as glTF. There is no behavior difference between version 0 (Godot 4.0 and 4.1) and version 1 (Godot 4.2 to 4.4). For version 2, there is one difference in a call to SkinTool introduced by PR #104184, which will collapse non-joint leaf bones with version 0 or 1, and not collapse them in version 2 or later. There will also be a difference with PR #106537 when it is updated to use this option.
For both UFBX and FBX2glTF, we are forced to pick just one name for both, so I went with
fbx/naming_version, even though FBX2glTF's one is better described asgltf/naming_version. It doesn't really matter, though.