X Tutup
Skip to content

Add MeshInstance3D upgrade code#112607

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
KoBeWi:what_could_have_gone_wrong🤷‍♂️
Nov 18, 2025

Hidden character warning

The head ref may contain hidden characters: "what_could_have_gone_wrong\ud83e\udd37\u200d\u2642\ufe0f"
Merged

Add MeshInstance3D upgrade code#112607
Repiteo merged 1 commit intogodotengine:masterfrom
KoBeWi:what_could_have_gone_wrong🤷‍♂️

Conversation

@KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Nov 10, 2025

Follow-up to #112267
Supersedes #112605

Bugsquad edit:

Forcing no skeleton path has caused problems as expected, so this PR takes a bit different approach.

  • When opening a project created before 4.6 (based on features setting), default_parent_skeleton_in_mesh_instance_3d is set to true
  • Running the project upgrade tool will set the setting to false and fix the scenes

This takes away some advantages of #112267, as users need to be aware of the compat option to make use of it (unless they create a new project). I added a note in the docs and we should probably make a prominent note in the update blog post for next version.

Please test and provide a reproduction project if there are still problems. I got some weird results when testing this (although it seems to fix the problem).

@KoBeWi KoBeWi added this to the 4.6 milestone Nov 10, 2025
@KoBeWi KoBeWi requested a review from a team as a code owner November 10, 2025 12:28
@KoBeWi KoBeWi requested a review from a team November 10, 2025 12:28
@KoBeWi KoBeWi requested a review from a team as a code owner November 10, 2025 12:28
@KoBeWi KoBeWi added the bug label Nov 10, 2025
@KoBeWi KoBeWi requested a review from a team as a code owner November 10, 2025 12:28
@akien-mga
Copy link
Member

My main gripe with this approach is that new projects, or upgraded projects, will have this setting explicitly written in project.godot to set it to false forever. It's not a problem technically but it's a bit annoying to have remnants of a 4.6 compat change carried along in all Godot project (even ones not using skeletons at all) until we release 5.0.

@KoBeWi KoBeWi force-pushed the what_could_have_gone_wrong branch from 34b22aa to 708e173 Compare November 10, 2025 13:30
@KoBeWi
Copy link
Member Author

KoBeWi commented Nov 10, 2025

Ok, I did the opposite. The setting still defaults to false, but its automatically set to true when opening an older project.

@KoBeWi KoBeWi force-pushed the what_could_have_gone_wrong branch from 708e173 to bd0b9d9 Compare November 10, 2025 13:31
Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test the demos involving Skeleton3D with this PR to ensure nothing goes wrong again.

@KoBeWi KoBeWi force-pushed the what_could_have_gone_wrong branch from bd0b9d9 to f8a938d Compare November 12, 2025 23:03
@KoBeWi KoBeWi force-pushed the what_could_have_gone_wrong branch from f8a938d to 251746a Compare November 13, 2025 12:43
@akien-mga
Copy link
Member

akien-mga commented Nov 15, 2025

Code changes look fine to me.

I'm trying to first reproduce the issue to validate the PR, but it seems I get it in 4.6-dev3 and dev4 official builds, but not with my local dev build from master (ef34c3d). Any clue as to why?

Edit: Seems like the symptoms on the TPS demo were fixed somehow between 4.6-dev4 (bd2ca13) and master (ef34c3d). Bisecting.

Edit 2: So I bisected the change to afd12e3, but... nevermind, this is just a change to how animations are imported, so my .godot imported from master was just incompatible with dev4.

Edit 3: So my testing confusion comes from the fact that the glTF importer will set the skeleton path based on the information in the glTF. For the player in the TPS demo, it happens to be a structure with MeshInstance3Ds under the Skeleton3D, so when you import with 4.6-dev2 or earlier (before the compat breakage), it doesn't save the value for skeleton_path since it's default. Then when you open the pre-imported scene in 4.6-dev3 or later, it's broken as the skeleton path is empty. Reimporting the glTF fixes it.

But we still need to restore compatibility for manually created Skeleton/MeshInstance hierarchies, which can't be solved by simply re-importing.

@KoBeWi
Copy link
Member Author

KoBeWi commented Nov 16, 2025

So uh, do I need to change anything? How to test it?
The upgrade tool runs imports, so it can patch stuff when importing.

@akien-mga
Copy link
Member

No change needed for now, I just got a better understanding of what cases should be tested.

The gltf import probably doesn't need any compat in the end, as the skeleton is looked up in the gltf nodes directly so the hierarchy is defined by the spec (I believe).

So it's mostly for Godot authored Skeleton/MeshInstance scenes that we need compat, and not ones imported from gltf. We should check that the compat doesn't break the latter but I don't expect it to.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with a couple projects and I confirm that it fixes the issues:

  • MRP from #112655 (which this PR thus fixes), which has an imported gltf scene converted to a Godot scene, so just reimporting the glb wouldn't fix the paths. This PR fixes it.
  • TPS demo (only imported glb, but with this PR it's no longer needed to reimport the glb to fix the issue).

@Repiteo Repiteo merged commit b15a13e into godotengine:master Nov 18, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 18, 2025

Thanks!

@KoBeWi KoBeWi deleted the what_could_have_gone_wrong🤷‍♂️ branch November 18, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

animations body is not compatible with skeleton MeshInstance3D is not automatically assigned to a Skeleton3D after 4.6 dev3

5 participants

X Tutup