Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic mesh upgrade tool renames nodes and restructures scene inherited from .glb file #84179

Closed
lemilonkh opened this issue Oct 30, 2023 · 3 comments

Comments

@lemilonkh
Copy link
Contributor

lemilonkh commented Oct 30, 2023

Godot version

4.2.beta3

System information

Godot v4.2.beta3 - EndeavourOS # 1 SMP PREEMPT_DYNAMIC Thu, 19 Oct 2023 22:52:14 +0000 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (nvidia) - Intel(R) Core(TM) i7-10700KF CPU @ 3.80GHz (16 Threads)

Issue description

After allowing the mesh upgrade tool to re-save all scenes, some scenes were corrupted (and lead to a runtime crash in the game, as the nodes in the scene don't have the expected names or hierarchy anymore).

It seems the tool used the node paths as their names, instead of creating the proper hierarchy.

Also the mesh upgrade tool pops up for me each time I open the editor, so something isn't saving properly.

Screenshot of the scene hierarchy after the upgrade process (scene in my game project):
image

Screenshot before the mesh upgrade in Godot 4.1.2 (MRP):
image

Screenshot after the mesh upgrade in Godot 4.2.beta3 (MRP):
image

Steps to reproduce

  • Create scene inheriting from .glb file in Godot 4.1 or 4.0
  • Add new nodes as children of inherited nodes (e.g. the mesh from the glb, which has the node name marked in yellow)
  • Open project in Godot 4.2.beta3
  • Open scene with mesh in it
  • Select "Upgrade and re-save" in the mesh upgrade dialog that pops up
  • If necessary, close and re-open the scene
  • Scene will have different node names (long paths instead of the previously assigned name) and a flat structure as all hierarchy is removed

Minimal reproduction project

MeshUpgradeMRP.zip

This is the Godot 4.1.2 project, which needs to be imported into Godot 4.2.beta3 to trigger the bug as described in the reproduction steps.

@lemilonkh
Copy link
Contributor Author

I just noticed that this might be related to #83429, since the mesh node has been renamed after the upgrade. So the nodes that were previously parented to it probably don't have a parent anymore.

In such cases, the mesh upgrade tool should probably detect the rename (if possible) and re-parent the nodes, instead of putting the full node path into the node name.

@clayjohn
Copy link
Member

I think this might be a duplicate of #83991

Indeed #83429 is closely related

The issue is extremely strange as all the mesh upgrade tool does is load and save scenes, it doesn't interact with the scene at all, nor does it manipulate scene contents in any way.

I should have a new version up soon that will hopefully avoid this issue

@clayjohn
Copy link
Member

Testing locally. I am able to reproduce this issue all the way back to dev 5. Needless to say, that's long before the mesh upgrade tool was merged. I can reproduce this issue by loading the MRP in 4.1.1, then reopening in 4.2-dev5 or higher and reimporting the mesh.

The mesh upgrade tool triggers the same bug because it reimports the mesh.

Accordingly, this is a duplicate of #83429.

@github-project-automation github-project-automation bot moved this from Pending Decision to Done in 4.x Release Blockers Oct 30, 2023
@clayjohn clayjohn removed this from the 4.2 milestone Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants