glTF import and export scene handling #6588
Closed
emperorofmars
started this conversation in
3D
Replies: 1 comment
-
This is solved as of Godot 4.2 and later with the With GODOT_single_root, if you export and re-import, you will no longer end up with an ever deepening tree of root nodes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Based on Godot 4.0.1
If i import a glTF file (with multiple or just a single scene), the root nodes of those scenes will be parented to the root node of the Godot scene. That Godot root node has the name of the imported glTF file.
On export, the Godot scene becomes one single glTF scene. The root node of the Godot scene, which represented the entire glTF file, becomes a root node of the new unnamed default glTF scene.
If i import and export the glTF multiple times, its actual content will be parented to an ever deepening tree of the same duplicated root node.
Perhaps this can be handled better?
Should be easy if there is only one scene in the glTF file:
The glTF scene could become the Godot root node, and be marked as such in the metadata perhaps.
On export it would be used for the glTF scene object, instead of becoming a node within a scene. The exported file will be the same as the imported one.
For glTF files with multiple scenes, this would be slightly more complex. Maybe this behaviour could be influenced by settings in the import settings window. Some options that i could think of:
a) The glTF root nodes of the different scenes would be parented to the same Godot scene root node (just like now), but retain information from which glTF scene they originate, so the original glTF structure can be exported.
b) The glTF scenes would become Godot nodes parented to the scene root with information on them that they were glTF scenes originally, so that can be handled correctly on export.
c) The glTF scenes other than the default one would become their own Godot scenes, saved into a user defined location in the project.
Beta Was this translation helpful? Give feedback.
All reactions