Exporting a mesh generated by SurfaceTool to be used in Blender

kis3lorikis3lori Posts: 7Member

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.

Answers

  • SIsilicon28SIsilicon28 Posts: 56Member

    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.

  • kis3lorikis3lori Posts: 7Member

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

  • wombatstampedewombatstampede Posts: 135Member

    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.

  • kis3lorikis3lori Posts: 7Member

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

    Thank you

  • SIsilicon28SIsilicon28 Posts: 56Member
    edited October 9

    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. ;)

  • wombatstampedewombatstampede Posts: 135Member

    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.)

  • wombatstampedewombatstampede Posts: 135Member

    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.)

  • MegalomaniakMegalomaniak Posts: 1,585Admin
    edited October 10

    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.

  • kis3lorikis3lori Posts: 7Member

    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 :)

  • wombatstampedewombatstampede Posts: 135Member
    edited October 11

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

  • MegalomaniakMegalomaniak Posts: 1,585Admin

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

  • wombatstampedewombatstampede Posts: 135Member

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

  • kis3lorikis3lori Posts: 7Member

    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.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file