• 3D
  • Exporting a mesh generated by SurfaceTool to be used in Blender

As the title implies, I was curious if there is a way to export a mesh generated by SurfaceTool to be used in Blender (or any other 3D editing software for that matter). I was unable to find anything about this in the docs.

I don't think that type of functionality is built into the engine yet. However it is still possible to export your mesh with a little ambitious gdscript coding. You can look into the documentations of, let's say .obj, and make an exporter for that file format.

Thank you, I think I'll try that. Maybe implement it as a feature in godot. Depends on how complicated it is.

Should be doable in GDScript. The Wavefront OBJ format looks tempting simple. The most complicated part might be setting the materials correctly and copying the source-textures (not the ones in .import).

https://en.wikipedia.org/wiki/Wavefront_.obj_file

A plugin might be helpful when wanting to interactively export meshes/mesharrays stored in e.g. MeshInstance nodes.

Oh, it looks a lot simpler than I thought. Might give this a try first in GDScript and see how it goes.

Thank you

Ok great! And when you do, consider helping the community out by releasing it as a plug-in. Who knows who else might find this useful. ;)

Here's an excerpt of a plugin I made. (see the attached zip which contains a gdscript.) It may contain errors and many things you might not need or better do differently. But it perhaps gives a general idea how SurfaceTool can be used to generate meshes by code.

(As it is only part of the plugin, the script will not be directly runnable.)

Here's an excerpt of a plugin I made. It may contain errors and many things you might not need or better do differently. But it perhaps gives a general idea how SurfaceTool can be used to generate meshes by code.

(As it is only part of the plugin, the script will not be directly runnable.)

Which post to keep? Also seems there's recently been an issue attaching .zip files, so might be best to host on something external, like github or google drive or such.

I can't see any attached zip (which is probably caused by the issue mentioned above) but thanks. I already did part of the generation by myself but any reference or help would be much appreciated!

Thank you :)

Sorry, I wasn't aware that the post went out. As soon as the zip upload actually works, I'll post it here...

Just testing file upload, just a random attachment coming through. Hope you don't mind...

Another try, here we go with the little plugin/addon which "procedurally" generates fences. Nothing fancy though ;-)

Thank you, will definitely check it out. Right now I moved on to another part of the generation but will get back to the export after that.

2 years later

I have made terrain with the surface tool and am now looking to export it somehow, without any need to export materials. I'd like to bump this older thread to ask if there's been any changes.

I’m not sure on its current status, but I believe there is a GLTF importer/exporter coming in a future version of Godot (4.0?) that will allow exporting GLTF files in code, which should allow for exporting surfacetool generated meshes.

I think there may have been a blog post on it. I’ll go look and will link to it if I find it. Edit: found it! Here’s the blog post https://godotengine.org/article/introducing-the-godot-gltf-2-0-scene-exporter Unfortunately it’s for Godot 4.0, so for Godot 3.x it won’t work.

I almost missed your responses, is there a way to "follow" a thread so that notifications will pop up when there's been a change? This might be what I need to finally graduate thankyou guys.