[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

Re: [mod] Woolen Mesh Creator [wesh]

by entuland » Post

ChimneySwift wrote:This actually really cool. xD
Glad you like it :)

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

Does this mean I can for example do mini version of statues and everything, to create my own minetest nodes in-game? wow! so much possibilities! I imagine a subgame with a whole new crafting mechanic! craft your nodes in 3D in a 16*16*16 area and then have it in your inventory yay!
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:Does this mean I can for example do mini version of statues and everything, to create my own minetest nodes in-game? wow! so much possibilities! I imagine a subgame with a whole new crafting mechanic! craft your nodes in 3D in a 16*16*16 area and then have it in your inventory yay!
You can definitely make your own node shapes in game, yes, but only within the limits this mod implements.

Unfortunately it also needs a world restart to be able to use such newly created node types, and they're not really meant to be used in large amounts for building, just for decorative purposes I guess, cause the meshes are not optimized and have a lot of minifaces, so to say. Further than that, you cannot decide the recipe nor any of their properties / behaviour, unless you write your own mod using those meshes.

Hopefully the ability to create / alter node types while the world is running will be added to minetest in the future: when that will happen, yes, you'll be able to capture a build and have your miniature ready to be used straight away.

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

+1 Seems the future's brighter than I thought.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Phoenixflo44
Member
Posts: 639
Joined: Fri Jul 28, 2017 15:01
In-game: EvilPhoenix
Location: Behind my PC, in Germany

Re: [mod] Woolen Mesh Creator [wesh]

by Phoenixflo44 » Post

+1 The Mod is good. Maybe you could do it the same way that all vanilla blocks work.
Spoiler
I hate my life

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

Phoenixflo44 wrote:+1 The Mod is good. Maybe you could do it the same way that all vanilla blocks work.
Thanks :)

If you meant allowing the mod to capture vanilla blocks in addition to wool blocks, it's already doing that. You can even customize what color each block will use or whether to capture it or not (by setting it to Air) in the nodecolors.conf file. Even better, you can extend it adding any non-vanilla node names there to let it capture any kind of node.

If you meant making the miniature use the same textures as the original blocks that would be way down along the road, assuming I will ever code such a behavior.

User avatar
v-rob
Developer
Posts: 971
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

Could you add support for making pictures out of wool? So, it would be a 2x2, 4x4, 8x8, 16x16, or 32x32 image that you can place on the wall. To make pictures, you'd make a 1 unit thick version of the picture out of wool.

I'd prefer this to a plain one thick mesh because it would use less faces.
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

v-rob wrote:Could you add support for making pictures out of wool? So, it would be a 2x2, 4x4, 8x8, 16x16, or 32x32 image that you can place on the wall. To make pictures, you'd make a 1 unit thick version of the picture out of wool.

I'd prefer this to a plain one thick mesh because it would use less faces.
Yep, shouldn't be too hard to implement, I'll tackle that, thanks for the advice.

In the meantime, anybody willing to do so, just create a mod and move the meshes there along with copies of the textures (in the appropriate subfolders), putting something like this in init.lua:

Code: Select all

minetest.register_node("modulename:nodename", {
	drawtype = "mesh",
	tiles = { "wool-16.png" },
	mesh = "mesh-filename.obj",
	paramtype2 = "facedir",
	collision_box = {
		type = "fixed",
		fixed = {
			{ -0.5,   -0.5,  -0.5,   0.5,  -0.4, 0.5 },
		}
	},
	description = "description of the node",
})
And finally changing "modulename:nodename", "mesh-filename.obj" as needed and "wool-16.png" as well according to the desired variant.

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 changes to the repo on https://github.com/entuland/wesh
- 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)

Image

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

v-rob wrote:Could you add support for making pictures out of wool? So, it would be a 2x2, 4x4, 8x8, 16x16, or 32x32 image that you can place on the wall. To make pictures, you'd make a 1 unit thick version of the picture out of wool.

I'd prefer this to a plain one thick mesh because it would use less faces.
Unfortunately implementing it exactly as you stated it (as a really flat image) would have required far more work. The way I implemented it (see my previous post) is more flexible but gives pretty thick frames for the 2x2 and 4x4. The 8x8 version is already acceptable, and the 32x32 is very close to a thin wooden plaque.

The way I implemented it allows for creating decorations that don't take a full block but are still 3D (such as bowls and bottles).

Image

User avatar
v-rob
Developer
Posts: 971
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

So, from what I understand, they have smaller collision boxes then?
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

v-rob wrote:So, from what I understand, they have smaller collision boxes then?
Yes, now they have a collision box (and a selection box) that only covers the smallest possible cuboid wrapping the minivoxels. If it's a flat plane of minvoxels taking 1/16th of a node that's just what the node will collide with. If it's two voxels at opposite corners of a node, the whole node space will be used.

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

entuland wrote:
v-rob wrote:So, from what I understand, they have smaller collision boxes then?
Yes, now they have a collision box (and a selection box) that only covers the smallest possible cuboid wrapping the minivoxels. If it's a flat plane of minvoxels taking 1/16th of a node that's just what the node will collide with. If it's two voxels at opposite corners of a node, the whole node space will be used.
Forgot to tell that this only works for new captures. Old captures will still work but will still take the full node space. Just get rid of old meshes and recapture them.

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 changes to https://github.com/entuland/wesh - up to 8 collision boxes will be created to allow for stairs, stair corners and slopes (sort of, they'll still feel like stairs).

I'm not so sure if it's worth investing more time into optimizing such sub-collision-boxes and merge them into larger ones when possible. I'm not really sure how I would proceed to test them for "merge-ability", so to say. Any advice will be more than welcome.

User avatar
v-rob
Developer
Posts: 971
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

I think it would be unnecessary to merge collision boxes. I don't think it would make much of a difference.

By the way, I noticed that the generated meshes seem to have strange lighting. So, I looking in the code and found that you don't have these in the code for the generated wesh nodes:

Code: Select all

paramtype ="light",
sunlight_propagates = true
These would correct the lighting problems because it allows light to go through them.
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

v-rob wrote:I think it would be unnecessary to merge collision boxes. I don't think it would make much of a difference.

By the way, I noticed that the generated meshes seem to have strange lighting. So, I looking in the code and found that you don't have these in the code for the generated wesh nodes:

Code: Select all

paramtype ="light",
sunlight_propagates = true
These would correct the lighting problems because it allows light to go through them.
Thank you, added those two params as advised, they seem to behave properly now (that change applies to all existing captures).

Yep, I noticed that they behaved funky with lighting but couldn't wrap my mind around it.

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

> but couldn't wrap my mind around it.

It's normal, this is a common mistake about registering mech-based nodes. The API doesn't say much about it.
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:> but couldn't wrap my mind around it.

It's normal, this is a common mistake about registering mech-based nodes. The API doesn't say much about it.
Yep docs are good but lacking here and there.

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

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)

---

Updated first post accordingly. Captures with the largest canvas are likely to misbehave, there for testing purposes only in reality.

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

Merged some more contribs from TwistedGate and made canvases to use flat textures for the inventory slots (easier to read numbers).

Also reported this: https://github.com/minetest/minetest/issues/7416

As mentioned in the wesh repo and in the OP here, careful with the largest captures and use such heavy meshes sparsely in your world. Very large captures _will_ crash your game and spamming hundreds of those heavy meshes in the world may result in the game eating all your RAM and beyond - again thanks to TwistedGate for running such heavy tests, he likes literally blending stuff out :P

User avatar
TwistedGate
New member
Posts: 2
Joined: Mon May 29, 2017 12:26
In-game: RadeKaBrane or TwistedGate
Location: Germany

Re: [mod] Woolen Mesh Creator [wesh]

by TwistedGate » Post

entuland wrote:Merged some more contribs from TwistedGate and made canvases to use flat textures for the inventory slots (easier to read numbers).

Also reported this: https://github.com/minetest/minetest/issues/7416

As mentioned in the wesh repo and in the OP here, careful with the largest captures and use such heavy meshes sparsely in your world. Very large captures _will_ crash your game and spamming hundreds of those heavy meshes in the world may result in the game eating all your RAM and beyond - again thanks to TwistedGate for running such heavy tests, he likes literally blending stuff out :P
You're welcome lol
Error 404: Signature not found.

alxk
Member
Posts: 12
Joined: Fri Mar 30, 2018 16:00
GitHub: alex-unknown
In-game: unknown

Re: [mod] Woolen Mesh Creator [wesh]

by alxk » Post

Think registering thousands of nodes would kill some servers, but it would be great to use it to make an in-game 3D Map of Servers. Maybe it would be good to need a priv for create woolen meshes, a possibility to delete old unused meshes and a possibility to choose the wanted dessign before creating it with the help of a formspec.

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

alxk wrote:Think registering thousands of nodes would kill some servers, but it would be great to use it to make an in-game 3D Map of Servers. Maybe it would be good to need a priv for create woolen meshes, a possibility to delete old unused meshes and a possibility to choose the wanted dessign before creating it with the help of a formspec.
Oh the idea of grabbing captures of a city or town to make a 3D map of it is very neat!

Good suggestions. I'll add a priv to grab and place such meshes and I'll investigate how to implement the interface for deleting unwanted meshes without the need of manually deleting them from the models folder. That will still require a world restart though. Now that I am thinking about that, even the fact that nodecolors.conf gets used right away isn't okay, cause it would get overwritten when updating the mod, I'll rename that to default.nodecolors.conf and only copy it over as nodecolors.conf at startup if no such file exists.

Not sure I got the advice about designs correctly: do you refer to the fact that each mesh creates four versions by default? (plain colors, plain colors with a border and so forth) - if so, yes, I should be able to add such an option at capture time in the formspec.

Once I'm there I think I'll add a checkbox for grabbing the matrix file, it's just a waste of space until I code an importer for that so I would be better stopping the mod from grabbing it unless the user explicitly asks for 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

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

Image

User avatar
Phoenixflo44
Member
Posts: 639
Joined: Fri Jul 28, 2017 15:01
In-game: EvilPhoenix
Location: Behind my PC, in Germany

Re: [mod] Woolen Mesh Creator [wesh]

by Phoenixflo44 » Post

Spoiler
I hate my life

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests