From BlenderWiki

Jump to: navigation, search

Add Masonry Wall

  • note script is now called add_mesh_walls

The Masonry Add-On for Blender, in general, is used to create a "wall" with rows of "blocks". It is easy to create a "castle-like" wall using the Masonry Add-On. It's easy to do a lot of things in Blender - Hopefully this will help you do them quicker/better.

in progress Inprogress75.jpg 75%
 Development and Documentation in-progress for 2.5x.


to do
 Script: fix bugs, finalize UI, get approval to include with Blender (trunk). Wiki: wait for feedback...


Masonry Block Wall
Create a Block Wall at current 3D cursor
UI location Group: Add Mesh
Version v0.58 Author(s) Dudecon (origin and 2.5x mods), Jambay (some 2.5x mods)
Blender 2.54 r32261 thru 2.56 r33949 License GPL


Executable information
File name
Current version download https://svn.blender.org/svnroot/bf-extensions/contrib/py/scripts/addons/add_mesh_walls/



General

Preparation

See Using Add-ons to install/enable the script (standard procedure).

Making a wall is based on the default Blender project; results, as described here, are simple and should work well with any custom setup are using. You may need to adjust camera, lights, and other environment settings to get a decent render result.

Use "a" A to deselect all objects. At least for now, script is not using [applied to] existing objects.

This object offsets (centers) at the current 3D cursor. Set your 3D cursor to the origin/center point [⇧ ShiftC to position at 0,0,0].

Optionally set your view to "Front Ortho" - 1 NumPad. Additionally use 5 NumPad to set Ortho view if your current view is "Perspective". If you don't have a "Numpad" on your keyboard use the "3D View" window, "View" menu, to set the desired view.

Notes

When Blender is started, or script is enabled, check the "console" to see which version you are using and ensure there are no load errors.

After adding an object, "mouse-over" the property values in Blender UI for general usage information.

Variance properties [optional], "rand(+-)" functions, are used to affect the sizes of blocks = "Your results will vary." You may need to "try again" to get the desired results (use any property to rebuild). These are intended to create a more "realistic" result; set to 0 if you want something more consistent like bricks.

There is only one wall object per "Add". Every time you change a property it replaces the current wall object; no undo.

No "Save/Load" properties (yet); all settings must be entered/modified manually.

Since this script uses the "Toolbox" panel to provide a UI, if you perform an action that changes the object status you will NOT be able to access the object properties for further modification. You may move the cursor, save file, and various other operations that will not "close/replace" the current properties display. You have to do all the wall edits before modifying with Blender; you can't get back to the properties if you change mode (i.e. edit) or add another object.

Disclaimer

No Guarantees that the user experience for Blender, UI, features, or screen-shots are the same as this documentation since they are still in development as of this writing. However, every effort will be made to keep it current and working through the 2.5x release process.

Basics

Create a Wall

Add>>Mesh>>Masonry>>Wall - create the default wall.

Default Wall

The "wall" can be modified using the properties, or, as with any object, using built-in Blender functions. However, once you "complete" the wall you cannot return to the properties. Completion, in this case, means changing mode, adding another object, etc.
You can move the cursor, or select other objects, just don't perform any "actions". You must complete the object modifications before using any built-in Blender tools.

Properties

There are a lot of properties, options, that can be applied to the "wall". These are displayed in the Toolbox.

Standard Settings


Construct: Every time you change a property the [current] wall will regenerate unless this option is off. When off, no object will appear.

The "Wall Area": "Start" - Left (X), "End" - Right (X max), "Bottom" - Lower (Z), "Top" - Upper (Z max), define the "space" for the wall. It is offset from the current cursor position. If you move the 3D cursor the [next] wall will generate at the selected cursor location. "Edging" determines staggering on sides of wall.

Block Sizing: Defines the [block] columns (width), rows (height), and thickness (depth) of the wall. Merge Blocks will create "larger" blocks (converge) when the blocks are "very close"; does not apply if Variance is zero (0) for Block Sizing.

Grout: "Thickness" determines the "space" between blocks, and is indented from the block face by "Depth". Currently does not create verts/faces so only Thickness is applicable.

Extended Settings


Wall Shape: The wall may be directly modified as a circle (Radial, bottom is center, a disc) or sloped (Curved along y-axis with top as origin). If both options are used a "dome" is created (bottom becomes top).

Openings: Create gaps in the blocks that can be used as doors or windows. The width (X+), height (Z+), indent (X), and Bottom (Z) define the area for the "hole". Arches "extend" the hole based on curve; if curve is less than half of width it will be smooth, else pointed.

Slots: Narrow openings, additional gaps, vertical (pointed) and/or horizontal.

Crenelation: Gaps on top of wall.

Shelf: Protrusion in defined area. Uses block sizing values for rows and block widths.

Steps: Extruded decremental levels (steps) in defined area; left or right oriented.

Masonry Options

Making use of the properties available for the wall.

The default wall is not suitable for more than basic results; some modifications are required. Defaults are intended for "simple use" and "ease of viewing", not necessarily a final product.

Options, when disabled, will collapse to simplify the user interface. You will need to "select" some options in order to modify the properties. Turning off an option will preserve any changes made, displaying last input if enabled again.

Variance and Minimum are common options available for many properties. The variance value applies a "random (+-)" difference to create an uneven appearance to the blocks; hopefully creating a more realistic result. Minimum is a lower limit that the variation can result in, max limit is wall area.

Blender3D FreeTip.gif
Fast usage

You may want to turn off "Construct" so you aren't disappointed by intermediate results - each time you change a property the wall will regenerate.

Use the ⇆ Tab [Tab] key to confirm an entry and move to next property for modification.


Construct

Enables/Disables the regeneration of the object. When off, no object will appear, preventing calculations each time a property is changed.

When "experimenting" keep this option on, but, if you have a complex object, or plan to change several properties, turn it off until you are ready to view the results.

Using this as a toggle will "reprocess" properties and present a different result if variance options are used.

Wall Area

The "Wall Area" values define the limits of the wall, they are zero (0) based, relative to the current 3D cursor location. If you move the 3D cursor the [next] wall will generate at the selected cursor location.

"Start" (X): x-origin: +-100; Horizontal wall origin: Left (X), 0 based from cursor, cannot exceed the wall end (resets to 0).

"End" (X max): x-limit: 0 - 100; Horizontal wall end, restricts right limit: Right (X max), 0 based from cursor, cannot be negative.

"Bottom" (Z): y-origin: +-100; Sets vertical (base) origin for wall: Lower (Z), does not prevent overlapping other options, may cause unexpected results.

"Top" (Z max): y-limit: 0 - 100; High limit for wall: Upper (Z max), cannot be negative.

Edging: side stagger: 0 - 100; Stagger blocks [alternately] on sides of wall: Siding, cannot be negative, stagger alternates to "mesh" rows when joined, set to 0 for "flat" sides.

Advanced Wall:

You can make the wall "disappear" by setting "Start and End to 0" [defaults may apply but still not display wall]. This allows viewing wall "extnsions" only; such as [opening] arches, steps, and shelves.

When warping wall, use 370 degrees to match overlap, when edging is 1/2 of block width; if you're edging is something else, you'll need a different "circle".

Multiple wall edge matching, "corners", can be difficult to make a smooth "mesh" when duplicating. Use 0 for "Edging", or "Block Size Height Variance", so rows/edges/ends match. Except when "openings" affect row sizing, this should work. Duplicate the wall, relocate new wall horizontal or perpendicular (rotate -90) to original wall and match at edge/corner to connect. Locate at inner stagger for extruded corners; best if Block Width is more than Edging (so blocks don't look like they'll fall off).

Set Edging greater than "Block Depth" for extruded corners

Block Sizing

Defines the the [block] columns (width), rows (height), and thickness (depth), of the wall for distribution of blocks in the wall area.

Merge Blocks will create "larger" blocks (converge)[vertically] when the blocks are "very close"; as a modifier to general wall block sizing. Does not apply if Variance is zero (0) for Block Sizing.

"Width" (X): horizontal division (column) over area: 0.01 - 100; Horizontal block size: range (~X).

"Height" (Y): vertical division (row) over area, 0.01 - 100. Vertical block size: range (~Y).

"Depth" (Z): Thickness of wall, 0.01 - 100. Tangential block size: range (~Z).

Each "size" setting has a Variance (randomization) and a Minimum (lower limit randomization).

If Variance is 0 blocks will be consistent (same size) over area. Except: top and bottom rows are usually tallest by design; openings may "force" some rows to be a different size.

"Variance" (~): randomize block size in direction: 0 - 100; Variable block size: range (~n).

"Minimum" (~): [least variation] block size, 0.01 - 100. minimal block size: range (~).

Advanced Blocks:

If Variance is 0 blocks will be consistent (same size) over area. Except: top and bottom rows are usually taller by design; openings may "force" some rows to be a different size.

Change the block size - even if you plan to scale it later - yes, you should make them smaller to add "detail" to the general appearance, but big blocks, randomized, make a great result too.

Set Variance to more than main property value, interesting effects, especially with Depth; "Big Blocks" effect for all directions.

Extensions to the wall, steps or shelves, use block sizing to fill the area; though steps fix height to "riser" setting. Extensions may be obscured by wall blocks if the depth is greater than extension sizing.

Grout

Spacing between blocks.

"Thickness" (~): The "space" between blocks: Distance between blocks: +-10; Block spacing: range (~).

Depth indents from the "face", Currently does not create vertexes, so only Thickness is applicable.

Variance (randomization) changes [affects] the sizing of blocks based on grout and affects "Merge Blocks" operation.

Wall Shape

Make wall circular (a disc), or curved (sloped); if both options are enabled a dome shape is created (bottom becomes top as per "Radial" operation).

"Radial": Make wall circular, flat, a disc. The bottom is used as the center of the circle, with the top as the outer edge.

"Curved": Curve wall along y-axis, with top as origin; bottom will be offset from cursor.

Advanced Wall Shape:

Create a tunnel by duplicating [or mirroring] a curved wall. Top view 7 NumPad, duplicate the wall ⇧ ShiftD, rotate 180 R; you now have a tunnel.

Openings

Gaps in masonry for use as doors or windows.

"Width" (X+): Horizontal size of opening: 0.01 - 100; Center offset from Indent.

"Height" (Z+): Vertical size of opening: 0.01 - 100; Center offset from Bottom.

"Indent" (X): Horizontal center of opening: +-100; Works with repeat to space openings over wall area.

"Bottom" (Z): Vertical center of opening: +-100; Set to Wall Area Bottom plus half of Opening Height for a door (no blocks across lower part of opening).

"Bevel": Taper blocks surrounding opening: +-10; Use negative values to taper "back side" of blocks.

Bevel will create a "tapered" stone effect by reducing the interior edge according to setting. If Bevel exceeds block size (height, width, or arch thickness) odd results may occur.

"Repeat": Distribute openings across the Wall Area, centered to wall area, based on Opening Width and Indent. Set Indent greater than Width to separate openings when using repeat.

"Arches": Leave arches off for square openings, or set Curve to 0.

Use Top or Bottom arch to set the curvature of the opening.

"Curve": Set the curvature for the opening: 0 - 100

A Curve under half the opening Width will be smooth/flattened, otherwise it is "pointed".

"Thickness": Sets the "girth" of the arch stones: 0 - 100; Works with Bevel.

Advanced Openings:

Create circular openings by setting the "curve" for top and bottom arches to half the width and set height to 0.

Slots

Narrow slits (default settings); meant for view/arrow ports. However, properties can be modified to replicate similar results to standard "Openings".

"Indent" (X): Horizontal center of opening: +-100; Works with repeat to space openings over wall area.

"Opening": Width (X+) for Vertical, Height (Z+) for Horizontal slots: 0.01 - 100.

"Repeat": Distribute openings across the Wall Area, centered to wall area, based on Opening Width and Indent. Set Indent greater than "Opening" to separate slots when using repeat.

"Vertical": Vertical slots are arched, based on the "Opening" (X+) and Height (Z+). Arches are (extended) outside of opening.

"Height" (Z+): Vertical size of opening: 0.10 - 100.

"Bottom" (Z): Base for vertical opening: +-100.

"Horizontal": Square openings.

"Width" (X+): Horizontal size of opening: 0.10 - 100.

"Bottom" (Z): Vertical position for horizontal opening: +-100.

Advanced Slots:

Bug/feature: overlapping openings create "blocks" in common (overlapped) area. For slots this appears to be a problem, when using both Vertical and Horizontal, but, when you match (overlap) slots to "standard openings" you get an inverse block creation that you may like.

Crenels

Crenelation, gaps along top of wall, are openings based on a percentage of the wall area (nominal) height and width. Sizing is a "ratio" of wall area, 1 = 100%.

"Width %" (X distribution): Horizontal size of opening: 0.10 - 1; Create repeated openings across top of wall area. Minimal block size area will be created, so Crenelation cannot actually be 100%, and thereby clip top of wall.

"Height %" (Z size): Vertical size of opening: 0.10 - 1; offset from top of wall area. 100% will create "columns".

Shelf

Add blocks to wall to make a platform, protrusion, in defined area. Uses block sizing values for rows and block widths.

Shelf will be obscured [not visible] if [half] block "Depth" is more than Depth of shelf.

"Left" (X): Horizontal origin: +-100.

"Bottom" (Z): Vertical origin: +-100.

"Height" (Z+): Vertical size of shelf: 0.01 - 100.

"Width" (X+): Horizontal size of shelf: 0.01 - 100.

"Depth" (Y): Thickness of shelf: 0.01 - 100; Offset from cursor.

"Backside": Reverse Y so shelf is "behind" wall.

Steps

Add extruded decremental levels in defined area to create steps. Uses block sizing values for block widths; does not vary grout.

Steps will be obscured [not visible] if [half] block "Depth" is more than Depth of steps.

The "Riser" and "Tread" determine the step sizing. If the values do not fit within the "area" the steps may not reach the top.

"Left" (X): Horizontal origin: +-100.

"Bottom" (Z): Vertical origin: +-100.

"Height" (Z+): Vertical area of steps: 0.01 - 100; Offset from "Bottom".

"Width" (X+): Horizontal area of steps: 0.01 - 100. Offset from "Left".

"Depth" (Y): Thickness of steps: 0.01 - 100; Offset from cursor.

"Riser" (step height): Height of steps: 0.01 - 100; Determines the row height for each step.

Bug: Single step max not clipped to step "area".

"Tread" (step width): Width of steps: 0.01 - 100; Determines the block width for each step. Blocks used to "fill" the row are based on wall block width settings.

"High Left": Reverse "start" to be on right of area; Lower Left to Upper Right is default construction.

"No Blocks": Creates "cantilevered" steps, that do not have supporting blocks under steps.

"Backside": Reverse Y so steps are "behind" wall.

Blender Tools

Modifications you may want to apply to an object using built-in Blender capabilities.

Bevel

Square blocks minimize the number of vertex points and faces but look artificial; put a bevel on the blocks to improve the general appearance.

Warning: Adding bevel will [at least] double the time it takes to render object - use this modifier sparingly; and it's best to wait until you're "almost done" before using it.

Properties>>Tools

Add Modifier - Select Bevel Scale: 0.10 works just fine... :)

Texture

Put a "finish" on your stone-work: This example describes using an image texture for simplicity. A "good" image, in this use case, will be large and have a lot of detail. The texture is applied to the object, not individual block elements.

The following is basic, and standard procedure for applying a texture to an object.

Select the object Properties>>Material

Add a new material. Name it Wall-Material.

Properties>>Texture Add a new texture. Name it Wall-Texture.

Set "Type" to Image.

Under Mapping tab, select Cube for projection.

Under Image tab, "Open" and select texture image.

Warp

Create a tower/curved wall. Use smaller block sizes so the warped wall is smoother.

Switch to edit mode.

Set top view, ortho.

Place the 3D cursor near center of wall and approximately 1/2 the wall width away.

Shift-W to enable warp. Move cursor to curve the wall. LMB to confirm. You can manually adjust the curve to fine tune the edge position in the toolbox.

Try different cursor locations and repeated warps for various effects.

CREDITS

Thx2: Dudecon, Meta-Androcto, BA, Ton, Blender, et al.
Will do better next time.