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

Godot 3.6 Beta 5 does not bake 3D models via merge_meshes #91988

Closed
SkanerSoft opened this issue May 15, 2024 · 5 comments
Closed

Godot 3.6 Beta 5 does not bake 3D models via merge_meshes #91988

SkanerSoft opened this issue May 15, 2024 · 5 comments

Comments

@SkanerSoft
Copy link

Tested versions

Godot 3.6 Beta 5

System information

Ubuntu 22.04

Issue description

Step 1. Export models from blender in glTF format
126
127

Step 2. Set the import settings so that the content ends up in *.mesh files
128
129

Step 3. Arrange the nodes as you see fit
132

Step 4. Bake in a tool script so that the models are combined into a single mesh
131

Result of this code in 3.5.3
132

And this is how it looks in 3.6 Beta 5
133

Steps to reproduce

Open MRP in Godot 3.6 Beta 5 and try it.

Minimal reproduction project (MRP)

GodotGames.zip

@lawnjelly
Copy link
Member

Ah this could be a regression from MergeGroups. I don't think it looks serious, just a check for CPU source mesh which doesn't make sense with the old method.

I should be able to fix this up soon.

@lawnjelly
Copy link
Member

I've done a PR to fix this, essentially the problem was just the new method defaults to creating meshes on CPU only and the MeshInstance::merge_meshes() should create GPU meshes for use in the editor and rendering.

There is one additional change to be aware of here since 3.5:

  • Mesh merging is now visibility aware, so if hidden meshes are merged, they will be merged to a hidden result.
  • This means that in your script you either need to hide the source meshes after merging, or unhide the result mesh after merging.

Also as the merging backend has changed it may be more stringent for requirements for merging (it checks hopefully absolutely everything, so if e.g. a margin is different, then it will not merge).

I'm hoping to add a verbose mode for merging that will print out reasons for not merging (as this could be annoying to work out manually) but this may have to wait till a point release as we are in feature freeze.

@SkanerSoft
Copy link
Author

Thank you very much! If you need testing it, let me know, I will help!

@lawnjelly
Copy link
Member

Thank you very much! If you need testing it, let me know, I will help!

Hopefully a lot of the jobs you previously did with MeshInstance::merge_meshes() can now be automated better with MergeGroup, as it essentially does what you were doing in your script, either at runtime or baked in the editor.

Any testing you can give would be greatly appreciated! 😀

https://docs.godotengine.org/en/3.6/tutorials/3d/merge_groups.html

@lawnjelly
Copy link
Member

Fixed by #92105.

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

2 participants