[mod] Woolen Mesh Creator (not only wool!) [wesh]

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

[mod] Woolen Mesh Creator (not only wool!) [wesh]

by entuland » Post

Update 2019/01/12: released v1.1 allowing RGB captures in the style of minetest mapper: https://github.com/entuland/wesh/issues/6 - thanks @benrob0329 for the nice idea

Hello there,
I've just published my second mod, it allows for capturing builds made out of most of the default minetest_game nodes and create small reproduction of such builds (one-block sized) made out of "mini-voxels", so to say. Only wool colors available but many more nodes will be captured.

Allows for rebuilding captures immediately either as wool blocks or with the original nodes, rotated at will.

Repo: https://github.com/entuland/wesh

Download link:
V.1.0 https://github.com/entuland/wesh/archive/1.0.zip
V.1.1 https://github.com/entuland/wesh/archive/1.1.zip (v1.1 allows for capturing with arbitrary RGB palettes)

Dependencies: [matrix]

Code License: MIT

Media License: CC0

Important: this mod started with only capturing wool blocks, this isn't the case anymore! You don't need to rebuild your creations with wool in order to capture them cause the mod is able to capture any kind of block (this can be customized in the nodecolors.conf file).

Canvases available in sizes of 2, 4, 8, 16 and 32 (side of the captured cube). Added size 64 as well, which can potentially produce invisible meshes. Invisible meshes will not happen though, cause there is an optional cap in the number of faces (you can change that for each capture if you want to push the limits).

The readme file there has all instructions and screenshots, here I'll post just a few.

You start from something like this...
Image

...and you end up with something like this:
Image

or like this:
Image

Sample of natural terrain capture:
Image

Sample of non-full nodes (automatic collision box):
Image
Image

Since new nodes / meshes can't be picked up while the world is running, you'll need a world restart in order to see and use the blocks you'll create. Once the world gets restarded you can obtain new meshes from the "Giveme Meshes" button in the capture interface.

Finally, when you save a capture the mod also saves a copy of the build (if so you wish). Only nodes and their orientation will be stored, no metadata.

As usual, all comments, bug reports and feature requests will be more than welcome, hope you'll enjoy this second contribution of mine.

And, hopefully, we'll get some more eyes on the code for allowing us to register new nodes or to alter existing ones while a world is running (short of that, this mod of mine will _always_ require a world reboot in order to use the new captures).

In the meantime, have fun :)

Update 16/05/2018
Meshes were all looking funky cause my code failed to specify normals for each vertex in each face definition, now the final result looks way better. Existing meshes can be fixed importing them in Blender, flipping normals and exporting them again - or simply deleting them and capturing them again.

Bonus update, same day, additional canvas sizes :P

Update 17/05/2018
Added support for capturing and customizing colors of most of the default minetest_game nodes.

Update 02/06/2018
- implemented automatic collision box as simple cuboids so you cannot create stairs (but you can create slabs, frames, carpets and so forth)
- added ability to specify custom node properties to be passed to register_node() from .obj.dat structure (details in https://github.com/entuland/wesh#specif ... properties)

Update 03/06/2018
Split collision box into up to 8 sub boxes to allow for stairs, stair corners and slopes (sort of, they'll feel like stairs).

Update 05/06/2018
Added a canvas of size 64
Added facilities to merge collision boxes together when fitting
Merged contributions from TwistedGate (new canvas meshes and textures)

Update 08/06/2018
Added separated privileges to limit ability to capture meshes, place meshes and delete meshes
Added ability to omit backup matrices at capture time
Added ability to choose variants at capture time
Added ability to obtain/delete meshes from the capture interface
Capped number of faces to avoid crashes and invisible meshes

Update 09/06/2018
Added importing and vacuuming features that allow to import matrix files and use them as temporary / permanent blueprints
Some minor tweaks here and there

Update 10/06/2018
Added transformations to allow canvases to work properly with any rotation (capture your house, place the canvas up in the air, rotate it upside down and reimport the house :P)

Added invert / mononode modes to import matrices (you can rebuild a matrix out of cobblestone, or carve its negative with air inside the ground and so forth)

Update 06/07/2018
Added support for colorfacedir nodes.
Published version 1.0 release
Last edited by entuland on Sat Jan 12, 2019 19:02, edited 20 times in total.

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [mod] Woolen Mesh Creator [wesh]

by Chem871 » Post

That is adorable.
What is SCP-055?

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

Chem871 wrote:That is adorable.
Glad you like it :)

I look forward for seeing what other people could do with it, I suck at building :)

One could also build stuff larger than 16 cubed by capturing separate sections and joining the resulting small blocks :P

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

Pushed new commit to the repo to fix the missing normals that made meshes look funky. Details in the "Update" section at the bottom of the first post, updated screenshots.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [mod] Woolen Mesh Creator [wesh]

by twoelk » Post

ooooh, love this

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

twoelk wrote:ooooh, love this
Glad you like it :)

I pushed yet another commit: adding the vertex normals wasn't really enough, cause I had horizontal faces darker than vertical ones... seems like the rendering uses both vertex normals _and_ face normals computed according to the rotation used to define them... I switched from counter-clockwise to clockwise and now everything look correct.

As above, fixing existing meshes require flipping the normals from Blender or something, or to delete and capture them again.

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

New update, added canvases of sizes 2, 4, 8 and 32, tweaked some stuff here and there: https://github.com/entuland/wesh

User avatar
LegoLogger
Member
Posts: 39
Joined: Thu Sep 01, 2016 16:08
GitHub: BakerPrime
IRC: BakerPrime
In-game: BakerPrime
Location: Somewhere on mars.....
Contact:

Re: [mod] Woolen Mesh Creator [wesh]

by LegoLogger » Post

Thanks so much for this mod! I was thinking about something like this the other day, and wanted a mod that did it. Now I have a mod. Haven't tested it yet, I probably will tomorrow.
~~BakerPrime
For those who complain about radiation, I should remind you that every time you leave your house, you step into
the worlds largest radiation beam. (Why else do you think us programmers hide in basements? ;P )

if you need to speak to me, you can catch me on #VE-Minetest-Servers, #RRH-Servers, ##Minetestwithunk, or #Minetest

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

LegoLogger wrote:Thanks so much for this mod! I was thinking about something like this the other day, and wanted a mod that did it. Now I have a mod. Haven't tested it yet, I probably will tomorrow.
~~BakerPrime
You're welcome, let me know if you stumble on any problems.

Upcoming stuff: I'm mapping minetest_game blocks to colors in order to let canvases capture any kind of build made with them. The result will be pretty simpler than the original builds / landscapes of course, but I'll make such mapping available as a separate file in order to tweak or extend it.

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

Updated the repo with the new feature for capturing and customizing colors of the default minetest_game nodes, screenshot and link in the updated first post.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [mod] Woolen Mesh Creator [wesh]

by TechNolaByte » Post

this makes building small structures much easier than micronode or its variants because their building is a little finicky
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
v-rob
Developer
Posts: 970
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: [mod] Woolen Mesh Creator [wesh]

by v-rob » Post

And done without a single entity. Simply awesome.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

RSLRedstonier wrote:this makes building small structures much easier than micronode or its variants because their building is a little finicky
Glad you like it :)
v-rob wrote:And done without a single entity. Simply awesome.
Thanks :) Main point of not using them is that I wasn't even aware of them probably, inspecting the worldedit mod I've seen how they're used to create area markers, and I think I'll need them for the next version.

The next version will be more likely a separate mod, probably with a different name, or I'll mark this version as a release on github and I'll start working on a new release allowing for a single canvas with customizable capture sizes (non-cubic) and eventually also splitting a capture in multiple meshes. This is where I'll most likely need entities to visually mark the extent of the captures and the splits in the world. The reason for a different name or a different major release is that I'll most likely have to break the compatibility with the current export of the matrix data (right now I'm saving only computed colors, the plan for the new version would be saving actual node names with their orientation, eventually with their metas as well). Another thing that would be nice to have is automatically computing the collision and target boundaries of the resulting nodes, allowing for creating, say, frames or carpets or small decorations to be put on or on top of a chest, stuff you can walk on or that in any case don't get in the way of aiming at nearby nodes.

Not really sure about any of the above, that's just a gathering of ideas that popped out speaking about this mod here and there.

Unfortunately I'll have to postpone all of this a bit cause of work (well, lack thereof... I need to find one and preparing my coding portfolio requires me to fix an old and pretty large PHP project of mine).

cybervision
Member
Posts: 31
Joined: Wed Jan 10, 2018 05:45
GitHub: tonsb
In-game: cybervision

Re: [mod] Woolen Mesh Creator [wesh]

by cybervision » Post

wow i tried this and i already love it

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

cybervision wrote:wow i tried this and i already love it
Glad you like it :)

By the way, if anyone has any cool miniature to show off please do so! A friend on discord shown me sort of an industrial crane made out of about a dozen miniatures of side 8, it's pretty neat.

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [mod] Woolen Mesh Creator [wesh]

by Lone_Wolf » Post

entuland wrote:
cybervision wrote:wow i tried this and i already love it
Glad you like it :)

By the way, if anyone has any cool miniature to show off please do so! A friend on discord shown me sort of an industrial crane made out of about a dozen miniatures of side 8, it's pretty neat.
You have Discord? You may be interested in this Minetest Discord server (Unofficial but hopefully that will change soon)
https://discord.gg/Wr6eXU3
Awesome mod btw
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

Lone_Wolf wrote:
entuland wrote:
cybervision wrote:wow i tried this and i already love it
Glad you like it :)

By the way, if anyone has any cool miniature to show off please do so! A friend on discord shown me sort of an industrial crane made out of about a dozen miniatures of side 8, it's pretty neat.
You have Discord? You may be interested in this Minetest Discord server (Unofficial but hopefully that will change soon)
https://discord.gg/Wr6eXU3
Awesome mod btw
Thank you for the link! Just joined :)

Glad you like the mod :)

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [mod] Woolen Mesh Creator [wesh]

by TechNolaByte » Post

wait this doesn't use ANY entities? how tf did you get it to work without a quintillion nodeboxes? are you registering a new node everytime a player creates a small model?
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [mod] Woolen Mesh Creator [wesh]

by Lone_Wolf » Post

RSLRedstonier wrote:wait this doesn't use ANY entities? how tf did you get it to work without a quintillion nodeboxes? are you registering a new node everytime a player creates a small model?
Try looking at the code https://github.com/entuland/wesh
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [mod] Woolen Mesh Creator [wesh]

by LMD » Post

Apparently, you are creating OBJS(so this works pretty similar like my Model Creator)
Are you removing unnecessary faces+merging faces ? (Some features of my Model Creator)
EDIT : I looked and your code and assume the answer is no.
My stuff: Projects - Mods - Website

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

LMD wrote:Apparently, you are creating OBJS(so this works pretty similar like my Model Creator)
Are you removing unnecessary faces+merging faces ? (Some features of my Model Creator)
EDIT : I looked and your code and assume the answer is no.
Yep, I'm creating .obj files but I didn't have a chance to inspect your code or test your Model Creator - in all honesty I came to know about it just here cause you mentioned it, there is an incredible amount of contributions around, I simply can't cope with them all :)

As for your question: yes, I'm somewhat optimizing the resulting meshes by removing unneded faces, but only to the point of checking whether a specific face is against an occupied position (in which case it doesn't get added to the mesh). Creating a filled cube would result in a mesh with only external faces, whereas a hollow one would result in the internal faces as well, even though they can't be normally seen in the game (working out whether a face is visible through a hole or something requires far more checks).

I thought about merging faces but there, as well, it requires quite a bit of additional work to optimize it depending on the convex / concave shape of a set of co-planar faces (not to speak about the fact that being able to have such merged faces "pretend" to be mini-voxels would require custom textures, whereas my approach makes them work with a default one).

As with everything, this mod can be improved as well. In all honesty though I'm not really sure it would be really worth taking the extra effort of merging faces and creating custom textures for each created model, also because that would make it way more complex for end users to swap the texture with a different one and obtain different version of them - my approach lets you create a new texture with custom colors or custom patterns and apply it to any of the created meshes by simply adding a line to their .dat file.

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [mod] Woolen Mesh Creator [wesh]

by LMD » Post

ok
My stuff: Projects - Mods - Website

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [mod] Woolen Mesh Creator [wesh]

by azekill_DIABLO » Post

This is so cute. And so well made.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

entuland
Member
Posts: 123
Joined: Wed May 09, 2018 15:47
GitHub: entuland
IRC: entuland
In-game: entuland

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

azekill_DIABLO wrote:This is so cute. And so well made.
Thank you, too kind :)

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: [mod] Woolen Mesh Creator [wesh]

by ChimneySwift » Post

This actually really cool. xD
A spoon is basically a tiny bowl with a stick on it

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests