[Mod] BlockExport [blockexport]

prestidigitator
Member
 
Posts: 640
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: 640
Joined: Thu Feb 21, 2013 23:54
 

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: 659
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

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 58 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: 640
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: 640
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: 640
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: 3080
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/
You can now find my videos at BitChute: https://www.bitchute.com/channel/some_cheeky_jinuskian/
 

User avatar
RSLRedstonier
Member
 
Posts: 451
Joined: Wed May 10, 2017 21:00
Location: some were in middle earth
GitHub: RSL-Redstonier
In-game: RSLRedstonier

Re: [Mod] BlockExport [blockexport]

by RSLRedstonier » Thu Feb 08, 2018 00:45

Super cool!

way better than a screen shot :P
"A programmer is just a tool which converts caffeine into code"

try out my skytest mod always being updated!
https://forum.minetest.net/viewtopic.php?f=9&t=17568
 

Marcus
New member
 
Posts: 4
Joined: Fri Jul 12, 2019 18:44

Re: [Mod] BlockExport [blockexport]

by Marcus » Fri Jul 12, 2019 18:57

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


Hello :-)

Thank you so much for this easy mod!
I'm sorry for the late post.

I just discovered Minetest today, and it works well on my old workshop-computers.
I'm having a 3D printing workshop with 1st-4th graders during the summer, and a few struggle with even the easier CAD tools (Tinke rcad, Mattercontrol, XYZMaker).

As many already know M*necraft, I'd love to use this approach for them to easily build houses, castles and such.
I added the other wool blocks so students can build with multiple colors, if they choose to do so.

I have a question/problem though:
While adding block types was very easy, I can't quite wrap my head around the 80 block export limit.

- Which parts of the init.lua do I have to change for a larger area?



[stroke] - Is it the nearest game chunk/area? The only way to get a fail-safe printing area for kids would be to make a saved world with markings or a 80 block grid. (Any way to make a world generator?)

- As standing at either side of a castle, it doesn't export the whole thing (despite it being smaller than 80x80).
[/stroke]
//Edit: Do'h, I figured that part out. I misread that it was a 80x80x80 area around the player. Image


Would it be possible to have the mod export a "radius" of 40 blocks around the player? Or even an optional command such as /exportblock 100?

Or is there a mod to place, say, torches in a grid?



Otherwise this solution is nearly perfect.
I've also seen the mt2obj/M3D solutions, but I really like the one-command solution of block-export :-)


As for making it easier for students, I added a few things to the .conf file and mods;

- wool in initial stuff, fly and fast privileges, time_speed=0, preset to flat and a preset seed.
- I also installed bedrock2, using bedrock.layer=8 to basically throw them into an easy sandbox for 3D modeling with a build-plate they can't mess up (e.g. digging holes when deleting blocks, then filling them with wool, creates uneven model bottom surfaces).


Thanks for your hard work! <3
Have a nice day!
 

Marcus
New member
 
Posts: 4
Joined: Fri Jul 12, 2019 18:44

Re: [Mod] BlockExport [blockexport]

by Marcus » Fri Jul 12, 2019 20:53

Sorry for being such a newbie :-)

I just solved it by preparing a world with markers, and the students launch a shortcut/batch-file.

This copies the draft world into a random directory, starts Minetest directly with that world, so students don't edit each other's world or mess with the settings.

Code: Select all
set nummer=%RANDOM%%RANDOM%%RANDOM%
Xcopy /E /I minetest-5.0.1-win64\__3ddraft minetest-5.0.1-win64\worlds\%nummer%
minetest-5.0.1-win64\bin\minetest.exe --go --worldname %nummer% --name Scholar



EDIT: Time stamp, might ad used name / custom name entry later


Code: Select all
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"

set "datestamp=%YYYY%%MM%%DD%" & set "timestamp=%HH%%Min%%Sec%"
set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"

 
Xcopy /E /I minetest-5.0.1-win64\__3dVorlage minetest-5.0.1-win64\worlds\%fullstamp%

start minetest-5.0.1-win64\worlds\%fullstamp%

timeout 3

minetest-5.0.1-win64\bin\minetest.exe --go --worldname %fullstamp% --name Scholar
Last edited by Marcus on Sat Sep 14, 2019 09:09, edited 1 time in total.
 

Marcus
New member
 
Posts: 4
Joined: Fri Jul 12, 2019 18:44

Re: [Mod] BlockExport [blockexport]

by Marcus » Sat Jul 20, 2019 13:29

Well, my 3D printing workshop is over :-)

Age 7-11. We used Mattercontrol 2, xyzMaker, and some Tinkercad when I got my mobile internet hotspot set up.
...and Minetest in the second week :-) Of course they also wanted to play multiplayer, use swords and blow up stuff with TNT... So the world is now flat again ;-)

Here are a few pictures I took, some non-minetest.

Image

The kids also printed a spaceship, block-thingy, etc., but I didn't get pictures of it all.


What I learned:

- I need a better camera and take more pictures :-)

- Minetest works slightly better on my old computers (E8500/4GB/nvs300@512GB) than Minecraft (BetterFPS, Optifine,...), at least when there are no trees and other things visible. Those computers are already "upgraded" with the NVS300 and that's the best I can get. (Payed around 30€ for each computer).

- Most kids are familiar with Minecraft on Tablets or phones these days. Especially the younger ones had more trouble than I thought (using mouse and keyboard at the same time, especially with left- and right-click). 6 Years ago, when I first used Minecraft with kids, this was no issue at all (Most people only had a computer at home, not a tablet). Changing the keys to the arrow-keys helped a bit.

- Kids always are a bit sad they can't print in colors. It would be nice if there's an easy way to export models with textured (not graphic texture, but surface texture / displacement maps texture

- Building together in multiplayer is much more fun, and easy to do. But we had a lot of kids trolling each other :-) An easy way to set zones for individual players would be nice, got to do some research. And some build zone map or markers perhaps as kids get easily disoriented.

- With bedrock2, blockexport, slightly modified conf and bat to throw them right into it, it's a great tool!

TL;DR: Thank you again for the mod!
 

Sokomine
Member
 
Posts: 3956
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] BlockExport [blockexport]

by Sokomine » Thu Jul 25, 2019 16:53

Marcus wrote:- Building together in multiplayer is much more fun, and easy to do. But we had a lot of kids trolling each other :-) An easy way to set zones for individual players would be nice, got to do some research. And some build zone map or markers perhaps as kids get easily disoriented.

There's the areas mod that works well for servers. Together with my markers mod (placable markers that mark the area that is to be protected) and my travelnet mod (phone cell to beam to other places; not only kids loose orientation in MT :-)), building on servers gets easier. In your case, the situation may be diffrent. The kids may decide to build together, but then there's no way to revert to a previous stage if the newly added player destroyed something. There's the rollback command, but that's for admins only and seldom used on servers.
A list of my mods can be found here.
 

Marcus
New member
 
Posts: 4
Joined: Fri Jul 12, 2019 18:44

Re: [Mod] BlockExport [blockexport]

by Marcus » Sat Jul 27, 2019 10:27

Thank you so much for taking the time to post all that information! That sounds exactly like what I'm looking for!

I've seen the rollback-command; I haven't tried yet (workshop's over, need to do some other stuff first); So far we played locally, one or two people hosting. I might set up a server though for all computers.
 


Return to WIP Mods



Who is online

Users browsing this forum: MSN [Bot] and 4 guests