[Mod] BlockExport [blockexport]

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

[Mod] BlockExport [blockexport]

by prestidigitator » Mon Aug 18, 2014 02:28

This mod defines a new chat command "/exportblock" which writes 3D node data of the player's current 80x80x80 node block to a file in Wavefront OBJ format.

This thread is for announcements and discussion. For more information about the mod itself please see the wiki page: http://wiki.minetest.net/Mods/BlockExport
Last edited by prestidigitator on Mon Aug 18, 2014 02:36, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] BlockExport [blockexport]

by prestidigitator » Mon Aug 18, 2014 02:31

This mod was inspired by the 3D printing for kids: modelling objects with Minetest General Discussion thread.
 

spin
Member
 
Posts: 25
Joined: Fri Aug 15, 2014 16:12

Re: [Mod] BlockExport [blockexport]

by spin » Mon Aug 18, 2014 12:37

Moving over from the 3d print thread.

viewtopic.php?f=3&t=9923&start=25#p151515
Did you generate that pyramid from the block exporter, or did you postprocess it (booleans, etc)?

Also, viewtopic.php?f=3&t=156&start=2450#p151540 it's alive :) Hopefully people can use exporters to make renders too!
 

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

Re: [Mod] BlockExport [blockexport]

by addi » Mon Aug 18, 2014 13:51

am i just too stupid or does it not work

downloaded, and installed the mod,
started a game,
typed /blockexport
//noticed that the correct command is /exportblock
typed /exportblock
waitet ca. 1 minute
opened blender
imported the block 0-0-0.obj file
and saw nothing only a grey screen
(i also saw no error message)
than i saw that the file is only 2Kb big. //dont know if that is correct.

i uploaded it here maybe someone can check it.
Attachments
block_0-0-0.zip
(767 Bytes) Downloaded 97 times
 

spin
Member
 
Posts: 25
Joined: Fri Aug 15, 2014 16:12

Re: [Mod] BlockExport [blockexport]

by spin » Mon Aug 18, 2014 15:34

addi wrote:am i just too stupid or does it not work


File works just fine. It's offset from the center of the axes by 50 units or so, so the mesh is offscreen. Scroll back a good few times and you'll see it.

edit: offset of geometry of your object from (x;y;z) 0;0;0 is exactly 29.0814; -40.38372; 4.16278.
With object selected, from bottom menu in Blender choose: Object>Transform>Geometry To Origin. It will end up in the center.

Also, thanks for the mesh man, I can test it now!

prestidigitator:
OMFG man it exports a lightweight mesh instead of cubes! :D My question answered, this is awesome!
Has a lot of non-manifold edges, but is OK otherwise. I have to test this more, I'll give you more input later!
Will have to test it with slicers too.
edit2:
Remesh modifier makes the geometry perfect on very low settings! :D I'm hyped up about this one, very good solution for printable mesh!
Do you keep the chunk size as a variable in code? That would be perfect for the little kids, selecting stuff in worldedit is powerful, but here they could do it by themselves!

I've GOT to find time to fiddle with this later this week! Wooooo! :D
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] BlockExport [blockexport]

by prestidigitator » Tue Aug 19, 2014 20:59

spin wrote:Moving over from the 3d print thread.

viewtopic.php?f=3&t=9923&start=25#p151515
Did you generate that pyramid from the block exporter, or did you postprocess it (booleans, etc)?

Zero post-processing. Just imported the OBJ file, switched to edit mode/face select, and turned on wireframe mode before taking the screenshot.

Also, viewtopic.php?f=3&t=156&start=2450#p151540 it's alive :) Hopefully people can use exporters to make renders too!

Excellent! Yeah, with this mod I exported one block a few times with different materials (dirt, stone, sand, water) and with the addition of a few simple Cycles materials, I can get a pretty decent looking render. Fun stuff to play with.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] BlockExport [blockexport]

by prestidigitator » Tue Aug 19, 2014 21:12

spin wrote:MFG man it exports a lightweight mesh instead of cubes! :D My question answered, this is awesome!
Has a lot of non-manifold edges, but is OK otherwise. I have to test this more, I'll give you more input later!
Will have to test it with slicers too.
edit2:
Remesh modifier makes the geometry perfect on very low settings! :D I'm hyped up about this one, very good solution for printable mesh!
Do you keep the chunk size as a variable in code? That would be perfect for the little kids, selecting stuff in worldedit is powerful, but here they could do it by themselves!

I've GOT to find time to fiddle with this later this week! Wooooo! :D

Glad it's working well. Yeah, the non-manifold edges gave me mixed feelings. On the one hand it creates rips in the mesh, but on the other it can reduce the amount of geometry a bit (as well as some of the export logic). It wouldn't be too hard to fix. How does that affect the 3D printing functionality and workflow? Maybe that should be the deciding factor, although if one simple operating in Blender can fix it perhaps that is good enough too.

The chunk size isn't variable at the moment; I just chose the same algorithm Minetest uses to break up the map for map generation, database storage, and loading. However, I did write the functions so that it will be very easy to make it configurable (they just take minimum and maximum x, y, and z coordinates). I'm thinking of enhancing it to either search neighboring blocks or allow the player to specify some kind of size/location data in the chat command.

One enhancement I think would be nice is to remove the ability to configure the exported materials in the mod itself, and instead export every block in the player's hotbar when they issue the command. That way you don't even have to know the names of the blocks.

Any thoughts on those enhancements?
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] BlockExport [blockexport]

by prestidigitator » Tue Aug 19, 2014 21:21

spin wrote:
addi wrote:am i just too stupid or does it not work

File works just fine. It's offset from the center of the axes by 50 units or so, so the mesh is offscreen. Scroll back a good few times and you'll see it.

edit: offset of geometry of your object from (x;y;z) 0;0;0 is exactly 29.0814; -40.38372; 4.16278.
With object selected, from bottom menu in Blender choose: Object>Transform>Geometry To Origin. It will end up in the center.

The mesh vertices will always be in the coordinate range [0, 80] in all three dimensions. This allows multiple blocks to be imported into Blender and aligned perfectly with each other: move each object's origin to the minimum coordinate location of the corresponding block in Minetest (multiples of 80.0 in each direction, as indicated by the exported file name). You can re-create whole sections of map this way.

One nice way to find everything in Blender, by the way, is to select all (A) and View Selected (Numpad .). I think you can even skip the selection step just after importing, as the imported object is included in the selection (but isn't made the active object apparently).
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: [Mod] BlockExport [blockexport]

by Inocudom » Mon Sep 15, 2014 18:09

Hmm... I think it would be neat if Minetest maps could be exported to the following game somehow:
http://tesseract.gg/
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests

cron