Godot Version
Godot 4.3
Question
I’m working with a designer who is making our game map in a software called sketchup - which is basically a software for architects - because our maps will be flats, offices etc.
He has installed a plugin in it that lets him export his work as gLTF 2.0 (.glb) files. The problem is, he already has the whole map with everything in place, instead of each object exported to an individual file.
Since he has already done all the heavy lifting, I want to take advantage of that whole map (with object’s coordinates and all) instead of making him export everything to individual files to, then, rebuild the map on the Godot editor. The problem is, my game logic has to interact individually with some of these objects: some walls will have their opacity changed on-the-fly, some objects like doors will have two or more models depending on if they’re open or closed, etc.
Is there a way to import this single map and then interact with each individual elements in it, like by checking the “editable children” property? Or a way to import these as individual objects, but to use the coordinates he has set in the original file? Any help/suggestions appreciated.
Yes you can right click the .glb
and create a New Inherited Scene. Hopefully that helps, though it sounds like you’ll have to script for mostly MeshInstance3Ds
1 Like
Something you can do with the loaded glb file, is you can right click on an object part of it, and ‘save branch as’. You might have to save the loaded glb as a tscn first so you can edit.
1 Like
What does the New Inherited Scene option do? What I can tell is that the editor opens a new Scene and shows its children, but all children names are yellow, I can edit their isibility and add nodes as their children, but can’t anything else in them.
Oh I’ve never noticed that option. However, whenever I click it, the editor alerts:
Can’t save a branch which is part of an inherited scene.
To save this branch into its own scene, open the original scene, right click on this branch, and select “Save Branch as Scene”.
I don’t know what it means by “open the original scene”. When I right-click the glb file in the FIleSystem tab and select “Open Scene”, it opens the map in the “Advanced Import Settings” interface, which is probably not what I want; when I select “New Inherited Scene”, it opens a new Scene but still doesn’t let me “Save Branch as Scene” any of its children.
In godot 4.3 you might be have to drag the glb scene into another open scene, like a tscn scene. Then you can click on the open scene button. Select open anyways. With that done, save that glb scene as a tscn. Then you delete the glb from your dragged in scene. Open the new tscn and see if you it will let you save branch as.
The new scene “Inherits” the selected one, all of the original components are added in a non-destructive, no-copy way. Any changes to the original scene afterwards are also inherited. You can add resources like scripts, and edit most properties, but since the yellow objects aren’t copied you cannot outright delete them.
It might help to know more about what you are trying to exactly achieve and what exact hurdles you are getting snagged on.
Since you are trying to work on a model directly I mention you will have to attach scripts to many MeshInstance3D parts, rather than make instantiatable scenes out of the prop models like normal.
Your tscn file made from the original, can have parts of it deleted. You can save branches from it.