#How to manage 3D assets references when building levels from Blender

5 messages · Page 1 of 1 (latest)

sage oriole
#

I'm doing my first 3D game and I'm facing some issues that I couldn't find the answer for.

The biggest one is asset management. Let's say I have rocks and tree assets. I want to build 2 levels. I have 2 ways.

First one is just using Godot editor to build the scene. No problem there.

Second one would be using Blender, it's more comfortable and allows me to do a lot more in less time. The issue with this approach and the reason of this post, are assets references. If I build two levels in two different .blend files, I want to use my current rock and trees gltf models. But I don't want to export their geometry again, in Godot it should be a reference to the asset I already have. But of course Blender doesn't know about resources. The advantage of being able to do this is that if I modify the original asset, the change will spread across all levels that reference said asset, which doesn't happen now.

This was a simplified example, but you get the idea. Does people just build their levels inside Godot editor to avoid this issue or am I missing something here?

lapis raven
#

Here is one way to do it

First, export your asset to godot and make it into a tscn file. Lets use a tree for example. Now you have tree1.tscn

Then make your level with blender. Use same tree. Let's say it is names tree1 and you have 5 duplicates of them, so tree1.001 tree1.002 and so on.

Then put the blend file inside your project folder so godot can import it

Last, write a post import script, and loop over all objects in the scene, replace object with "tree1" in name with tree1.tscn. assign this script to your blend file in import tab

You get the best of both worlds now

sage oriole
lapis raven
#

You can also just export the blend of level to glb and do the same with post import script

#

I personally choose blend because I can skip exporting to glb step. So just save in blender and tab to godot