A floor board generator

When I add a Boolean Modifier to get a round floor area, then UV-Mapping get’s destroyed.
Maybe a Blender Bug not a Script Bug. Maybe a mistake of myself, see here:


Blendfile:
floorgnerator_Test_04_210813.zip (352 KB)

Edit:
Sorry, the mistake is, that I did not place the Boolean Modifier on the top of the Stack.
Everything works fine now :wink:

Kind regards
Alain

Ok, here a first real test, but a WIP. :wink:


@floric: nice! (and interesting scene as well)

version 0.0.8 is available an documented (sort of :slight_smile:

It is fully parameterized and has the ui bugs fixed (thanks floric and alain). I added an extra operator so it is still possible to create a floor board via the add->mesh->floorboard without the need to convert an existing mesh object

There is also new functionality: apart form individual random rotations it is now also possible to add random curvature (both along and across the planks) and twist. This allows for a far more subtle ‘old’ look than just rotations.

So please experiment away, I really like the feedback. The next step I think will be to focus on bug and maybe some proper documentation in the Blender wiki. Some code cleanup wouldn’t hurt neither :slight_smile:

After that I would like to get started in Ace_Dragon’s proposed features (snap planks to another object)

PS> I know there is a bug: if there is any twist or curvature added, there should be a subsurf modifier but it doesn;t appear. I already know why, but I didn’t find it important enough to fix it immediately :slight_smile:

Thanks varkenvarken !

Actually it is Version 0.0.9 and not 0.0.8 if I should believe in what you write in the Script :wink:

I hope you don’t mind if I merge my UI improvements again, I hope you will keep them in the Script this time :wink:

Newest Version of 0.0.9 with UI improvement is here:
planks.zip (4.9 KB)

Kind regards
Alain

@alain: sorry mate, I corrected the spelling errors but managed to completely miss the labels & layout :-/ But I merged your additions again, did some code cleanup and made the display of offset field conditional (see below). The result is version 0.0.10. :slight_smile:

As discussed in a PM w. Alain it makes sense to make the offset input field just appear when the offset is not random. I implemented that but I noted that the current code in the planks() function still uses he offset value to initialize the c value. Seems harmless enough so I let it stand for now. I also changed the default for randomoffset to True as that is probably what most people want to use anyway.

cheers,

– Michel.

Thank you Michel !

Nice to see the Script crowing ! :slight_smile:

One Bug I forgot to mention:
When I assign a Material to the Floorgenerator Object and when I change Settings of the Floorgenerator Object later (for example adding one more row) then the Floorgenerator Object looses it’s Material and you have to reassign the Material.

Kind regards
Alain

the material is probably lost because each time something changes we create a new mesh and I think the material is linked to the mesh. I will verify that later and if true, there are two solutions: associating the material with the object (in Blender both is possible but most people assign a material to the mesh as that is the default) or we let the script retrieve the materials before creating a new mesh and reassign them afterwards. To make he script user proof there’s no escaping the second option I guess :slight_smile:

Just made a little UI Improvement.
Instead of disable the Offset Value Field when Random Offset is enabled I made it to gray out.

It’s more logic from my point of view :slight_smile:
Thanks to Michel for his patience while I was asking him questions about coding :slight_smile:

0.0.11 is here:
planks.zip (4.89 KB)

Edit:
I suggest to apply the “Floor Generator” Material automatically by default.
This way a new user can start playing with the random Material Values without building or downloading this pretty complex Material Setup first.

Kind regards
Alain

Nice cooperation :slight_smile: Great work.
For the Python nodes, i meant something like “geometry nodes” from Lukas Toenne :http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.67/Python_Nodes (see example 3).

@Alain: I don’t use this complex material because of its complexity. :wink:
I think it will render a lot longer then simple textures. I learned at work one helpful trick for random floors. Use a wood-texture with many details and make it x-tileable. Then add another layer and add a soft colorblending to a little bit brighter color. Then just unwrap it random and make sure that no UV-Face is on a seam at the y-axis. Thats the technique I used at the posted image above. So you get with small textures a lot of variation, but it still renders faster.
Take a look at this image. (just a basic texture from cgtextures.com)

EDIT: Deleted texture

version 0.0.11 incorporates Alain’s grey out code for offset input field (is indeed nicer because then the user nows that the input field still exists and the UI doesn’t change shape).

I also corrected a bug where the subsurf modifier wasn’t added if one of the distortion values (hollowness twist) became non zero

Biggest bug left now: if an individual plank happens to be smaller that the short gap, we get a plank with a negative length. That should be fairly simple to fix.

@matali: those geometric nodes are very interesting. Should have looked beyond material pynodes. Needless to say taht is a completely different design paradigm, so not for now, but certainly for some rainy afternoon experimenting. thanks!

@floric

It’s not complex, it’s easy and very flexible and fast and it contains no boring tasks :wink:

You just take a seamless Texture vom cgtextures.com and the rest does Blender for you :slight_smile:
You only have to adjust the marked Nodes (see Screenshot).
No preparation in Photoshop needed.

See example Screenshot here (the Texture at the bottom is the original from cgtextures.com):


Blend-File:
floorgnerator_Test_05_230813.zip (296 KB)

I hope I did not completely missunderstood you :slight_smile:

Kind regards
Alain

I agree and it could be really helpful.
Probably it could be good to have 2 radio button where choose from a new “floorgenerator” material and the list of scene material.
Or at least a message that say that a new material is assigned.
But this is not really important.

@Ailain: I absolutely understand the nodesetup. I’ve used the random output, since it’s available for a lot of variation things. But I personaly prefer the other method for the floor. :wink:

I can’t get the floorboard generator to work. I’ve added the script from the file, enabled it, and I can add the mesh, but I get no access to the parameters in the tools panel. There’s pretty much just the “Floorbards” tab with nothing under it.

Can someone point me to the error of my ways? I’m clueless here. Thanks in advance…

Here’s a screenshot:


PacificDoc, go over to the Modifier Panel, the Wrench tab; it’s right there.

Thanks, JWise - apparently, that was the one place I didn’t look.

one quick reminder: be careful, you cannot distribute files from cgtextures.com! (they are free to use for any purpose but you may not distribute them)

if we want to add a default wood material (which makes sense because it gives the user an immediate ‘feel’ for what is happening) I would opt for a simple procedural material (not osl based because that doesn’t work yet on GPUs). If someone can come up with a simple (say less than 10 nodes) material, I am happy to convert it to code and apply it as a default material. (remember, it should take uv coordinates and/or use the random vertex colors to add some variation to individual planks and it doesn’t have to be photorealistic but good enough for a convincing ‘wood experience’ :slight_smile: Anyone up for the challenge?

@varkenvarken
I can clearly understand what you suggest but if the material hasn’t got photorealistic eye-look I doubt that someone use it for any professional purpose. You are the coder, so it’s your time to spend on it, but from my POV it’s more interesting to offer a quick photorealistic solution that obviously use textures.
For example if you see the Arroway textures you can see different maps for different channels (diffuse, bump,specular) and like this many others.
So, from POV, I prefer to have, for example, a premaded node setup where I have at the beginning 3 texture map nodes already connected with each other.
Without the need to re-distribuited maps, for me it’s not a problem to have 3 empty slot to fill with my texture maps.
In this way, what you save it’s the time to make the nodes connections.
The time the user spend on find the right textures is not a “floor-generator” problem.

Anyway this is my suggestion.

Example of floor generator material UI:
[diffuse texture map slot]
[specular tex map slot] [ % of influence][ & fresnel influence]
[bump map slot] [ % influence]

I prefer to have texture map slots because I think it’s more simple to find the right wood than create with a procedural map.