A floor board generator

I honestly thought the Masonry addon didn’t exist anymore for current Blender versions, I didn’t know it was moved.


Anyway, the ‘blocky’ and ‘smooth’ option is like this.

Blocky - The slope is followed in a way where the planks/tiles/stones remain in an upright orientation in all locations on the slope so as to essentially create steps as they go up and down.

Smooth - The planks/tiles/stones remain aligned with each other and are oriented in an attempt to be as aligned as possible with the slope (sort of like what you see with sidewalks or park paths going up and down hills).

I think your addon can do this already by changing UI variables, if it can generate hexagons.

Attachments


@varkenvarken
Your script is coming better release after release.
Today I’ve downloaded your last version and I found a typo error…or I suppose it’s.
Into the “rotations” section you have “X Rotataion: …” but probably it should be “X Rotation: …”
Is it correct??

At first, thanks for the great addon. I discovered the popular floor generator in Max and was so surprised to see something similar in Blender. :slight_smile:
To get some randomization, I added a Disp-Modifier with a simple noisetexture and only at the Z-Axis. So I got some variation of the height. This might be a better to option to change this value later after applying the floor.

Or in other words:
Blocky = Keep planks oriented to the world z-axe
Smooth = Orient local z-axe of the plank to the normals of a surface on which the planks are distributed

Right ? :slight_smile:

Kind regards
Alain

Another thing, I thought about. Maybe you know the Jamb-Generator in this forum. How did the developer got the parametric options even after moving and rotating or duplicating the object? Maybe we could add this to the floorgenerator, too? This would be perfect to change the plank size later for example.

I agree to that.

In the Floor Generator for 3DS Max you can pick up the settings from a Floor Generator Object.
This makes it possible to change the settings of a floor later.

@varkenvarken
I don’t know if it’s possible to store Settings into an Object in Blender ?

Kind regards
Alain

I’m currently try to understand and use the relevant part from the Jamb-Generator. It seems that he stores the local values connected with the object and every time you change some values it draws the object new. But I’m not sure about that…

@varkenvarken

Here is my suggestion for the UI to make it easier to use and understand:


The yellow markers are orthographic improvements.

If you can store Settings to an Object in Blender then the “Add Modifiera” option would not make sence anymore.

Kind regards
Alain

Yes I can confirm that the Jamb Generator stores the values and you can change them later.
This means this should be possible for the Floor Generator as well.

VarkenVarken is the Scripting secialist, I guess he can answer us if he can store the Settings into the Floor Generator Object.

Kind regards
Alain

for everyone that asking how to use floorgenerator with a non square floor, I can confirm that using booleans give you good result.
In my tests I removed the modifiers (solidify and bevel), used the boolean and after I’ve re-applied the modifiers.
It worked well.

As indicated by some it is indeed possible to store information as part of an object and even better I think it is saved along with the object (blenders internal data organization aka RNA is very cleverly designed) but I have to double check if it still works the way I think it does (because sometimes things change in the API :slight_smile: I also need to research how to do this in such a way that adding new options will automatically lead to custom data (if that is possible. I think it is, either by subclassing the xxxProperty classes or introspecting the FloorBoard operator class on registration. Fun python stuff to look into :slight_smile:

@Alain + Mercatore: I’ll update the next version with your UI enhancements / bugfixes.

@floric: the next version will also feature additional randomization options to ‘warp’ individual planks, I.e. to curve and twist planks (intended for old floors)

@ace_dragon: i think both blocky and smooth snapping to an object is perfectly doable but we also have to think a bit about ui/workflow. The simplest way I think would be just to snap it to the faces of the active object but we would then at least need rotation and location options to position the floor.

Ok, after some hours of trial-and-error I got it working. Thanks to DragonLEE great code.
Heres my parametric version, which should work with DragonLEEs parametric addons, too.
Please check the changes for bugs. There seems to be a bug in combination with Bevel.

http://www.pasteall.org/44980/python

EDIT: Just add a cube, go to the modifiersection and convert to a parametric floorobject.

Wow, now you guys are really stepping this up. Just tried the latest Pasteall upload and love what I’m playing with, not sure if I should go crazy making floors, create normals for simple floors that just look amazing or start begging for a roofing generator, maybe fencing???

@floric: works like a charm! Will definitely merge this, thanks! (And DragonLEE of course)

This is very clean and I am tempted to adopt this for my other addons (especially Gears and maybe SpaceTree) but there are some issues I would like to discuss:

  • converting from an existing object might not feel all that intuitive to a person, but of course we could add an ultrasimple extra operator to the add mesh menu that creates an object and invokes the parametric converter,

  • some addons really will benefit from a useful set of presets. (FloorBoard maybe not so much but for example Gears and Space Tree very much so). Just recently I learned that it is possible to distribute presets along with the addon and with operators this means that without changing any code we can create presets that might be bundled, which saves a bunch on code maintenance :slight_smile:

Now for an Operator it is simple enough to tack ‘PRESET’ to bl_options, but the Panel class doesn’t support that although I see some possibilities to create an enum property that on selection locates a preset and a creating some sort of button that saves a preset that feels clunky. Wild idea: maybe it is possible to let floorboard multiple inherit from both Panel and Operator…

Cool floric, nice to see crowing something useful :wink:

Kind regards
Alain

Good idea !
To convert any mesh into Floor Generator is a complete nonsence :wink:
You only make people think that they are stupid that way because they can not understand the objectively logic behind this workflow :wink:

Kind regards
Alain

Wouldn’t it be possible to use python node for it ? It would make the changes appear in realtime.

@matali: I am not quite sure what you mean but python nodes are for shaders/compositor operations and this addon is a script that creates real geometry. Of course we could implement a shader that creates the illusion of planks but that would not add real geometry. (And i probably would use OSL instead of Python because for shading Python is probably too slow)

Just made a little update of the Script for a more logic and userfriendly UI (see post above).

Planks.zip (3.62 KB)

Kind regards
Alain