this post was submitted on 21 Sep 2023
13 points (93.3% liked)

Godot

5855 readers
43 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

!roguelikedev@programming.dev

Credits

founded 1 year ago
MODERATORS
 

Hey guys I've recently been looking at Godot since Unity has set itself on fire. I'm liking it so far but I've run into a small issue that disrupts my usual workflow. I like to store multiple meshes as separate objects in a single .blend file for meshes that are very related to each other like pieces of a build kit. I was able to split the meshes into separate scenes by opening the .blend scene, right clicking and allowing children to be editable, then exporting each branch to a new scene. This works as expected with one problem. The exported branches don't update their mesh when I save changes to the blend file. Is there a fix for this?

If not I can always split the blend into multiple files. Its just less convenient. Perhaps exporting to colladae would work too? I didn't try that yet but ideally I would like to keep using blend files only to avoid exporting every time I make a change.

top 6 comments
sorted by: hot top controversial new old
[–] Rodeo@lemmy.ca 3 points 1 year ago (1 children)

I haven't worked with 3d models in a year or so, but gltf was the way to go for me at the time.

The reason the saved scenes done get updated is because you're actually saving them as a physically separate file when you export the branch to a new scene. There is no workaround for that since you're making a physical copy of the data and storing it in a different place on the hard drive.

[–] Toasteh@lemmy.world 2 points 1 year ago (1 children)

What about modifying the importer to automatically export each branch to a new scene?

[–] Rodeo@lemmy.ca 1 points 1 year ago (1 children)

A few things to note there:

  1. That importer is probably part of the engine code, probably in C++, and if it is it will require recompiling the engine and using your custom build for your game.

  2. From the docs on 3D importing:

.blend (Blender). This works by calling Blender to export to glTF in a transparent manner (requires Blender to be installed).

So it looks like the blender importer is already using the (recommended) gltf format anyway.

  1. There is the Godot Blender Exporter which you may find useful instead.

  2. You can write a tool script that extends EditorPostImport and do things with the scene on import without having to modify engine code. I've used this to great effect on gltf files.

[–] Toasteh@lemmy.world 2 points 1 year ago

EditorPostImport sounds promising. Hopefully I can make it save the branches or update them if they already exist. Thanks!

[–] AdmiralShat@programming.dev 1 points 1 year ago* (last edited 1 year ago) (1 children)

When you export each section as a new scene, you're saving it as it's own individual object, no longer connected to the .blend file.

There is are two work arounds, both are a bit cumbersome

  1. You can keep the .blend file saved in a scene, click the mesh node, copy the value, then paste the value onto the instantiated/local mesh node. This doesn't update each file automatically, but it's easy enough to keep everything stored locally and move things around as necessary.

  2. Use the Linked library addon in Blender to be able to have a main blender file, but you'll still need to save each individual object as a .blend and import it into Godot. The benefit of this is that you can edit the files rather quickly, without needing to manually open each file. It's an Addon that needs to be enabled, then you need to go to file>Link>collections and add your objects from there. The only real benefit of this, again, is having one .blend file you focus on in blender.

I use a mix of both depending on what I'm doing but predominantly use method 2. This updates each object automatically in Godot

You can also write a tool script to automatically replace the mesh when it's updated, I haven't done this but it's technically possible

[–] Toasteh@lemmy.world 2 points 1 year ago

Thanks I think I should be able to work something out with EditorPostImport to export the branches/update them if they exist.