-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Include all MeshInstances in scene when exporting MeshLibrary (and not just the direct children of the scene root) #3406
Comments
I don't think this should be made optional. Is there any reason you want non-direct children to be excluded from the conversion to MeshLibrary? As for including only visible nodes, I can't see a use case for that either. (It hasn't been described in the proposal text.) PS: You can create MeshLibrary resources manually by loading MeshResources directly in a newly created MeshLibrary resource, without going through the scene -> MeshLibrary conversion process. However, this requires you to have access to direct Mesh resources which is easier done with OBJ meshes compared to glTF scenes. |
"I don't think this should be made optional. Is there any reason you want non-direct children to be excluded from the conversion to MeshLibrary?" You misunderstand, I want non-direct children to be included. Currently, only direct children are included, and I want non-direct children to be part of MeshLibraries. "However, this requires you to have access to direct Mesh resources" Yes that's the problem. |
I was saying the new option you're proposing may not need to be made optional. We can make it the only behavior in 4.0 and later if there is no valid use case for the other behavior (including only direct children). |
I just tried something similar in Godot 4.0.2 and this ticket is spot on in its description of the desirable workflow and current limitations. My idea was the following: copy a bunch of Simple enough, excepted that indeed imported I see no way around this at this time except scripting a conversion to the proper scene structure, as described above. Manual reorganization of the scene is unpractical (101 assets, and for example " Edit: I ended up writing such a script, and it helped me successfully export to a MeshLibrary. I shared it here if it can be of any help (see source code comments for the complete workflow). |
Describe the project you are working on
A grid-based 3D turn-based-tactics game with large amounts of modular terrain.
Describe the problem or limitation you are having in your project
"Scene -> Convert To -> Meshlibrary..." only includes MeshInstance direct children of the scene root when creating the MeshLibrary.
When dragging a 3D model into the scene (in my case, a .glb file), it creates a scene instance consisting of a node (Spatial by default) with a MeshInstance child.
Each of these scene instances has to be "Make Local" and then the MeshInstance child reparented to the root. One by one. The MeshInstance child also needs renaming, as my 3D software (AssetForge) does not support naming meshes.
This is an extremely slow process for a game with hundreds of rapidly made terrain assets.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allow MeshLibrary export to include all MeshInstances in scene (including children inside other scenes) and not just MeshInstances which are direct children of the Scene Root.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
Import script that takes the mesh from the 3D file and gives the mesh the same name as the 3D file, then optionally deletes the 3D file.
Edit: My solution ended up being a Tool script that finds every MeshInstance in the scene, renames them, reparents them under the scene root, and then deletes the scenes they were taken out of.
Is there a reason why this should be core and not an add-on in the asset library?
The text was updated successfully, but these errors were encountered: