Window Generator

by Mark Kingsnorth in Scripts and Addons

Model many windows at once on the faces of a mesh:

Years ago, I had a very hard time modelling window patterns onto models like this one:

The user wanted more and more windows added to the 3D model, and each time I found myself painstakingly adding each one in a random pattern onto the faces.  This took up many hours and days of my time, far more than modelling the overall model itself. After this painful experience, I thought there surely must be a better way.  So when using Blender, I decided to create an add-on that would do the job for me.

The add-on has applications beyond just modelling spaceships, and would also apply when needing to quickly model many windows onto architectural buildings.

Features:

  • Select faces and then add a configurable pattern of windows, where the amount of coverage and randomness can be controlled.
  • Control how many windows are mapped across each face and how many are mapped down them.
  • The width and height of the windows can be changed.
  • Different window styles can be created by adding corner bevels, and outer bevels can be added to make the window edges smooth.
  • Option to disable top or bottom bevels to create different effects:
  • Ability to assign a material to the newly created windows by specifying a material slot id.
  • Also assign a lights-off material to give the impression that some window lights are switched off.
  • Introduce further variations by adding a random "jitter" to the width and height of each window.
  • Option to perform edge split operations to create a quicker clean look.
  • The process automatically creates uv seams to aid in uv mapping for textures.
  • Faces are mapped from the top-to-bottom of a face by default, but the orientation can be changed to either left-right or front-back.
  • Additional refinement options that will attempt to remove unwanted edges or vertices from the created window patterns.



If you have a new feature suggestion or feedback on the add-on feel free to contact me through this website, visit www.markkingsnorth.com, or contact me through twitter @markkingsnorth.

Installation

The add-on can either be installed through the Blender UI or by unzipping the file into your add-ons directory.

Blender UI

  1. Go to File -> User Preferences.
  2. Select the Add-ons tab at the top.
  3. Select the Install Add-on from File... button along the bottom.
  4. A file dialogue will pop up. Navigate to the file location where you downloaded the window_generator .zip file and double click it.
  5. Search for the add-on by typing "window" in the search box if it does not already appear. Make sure the checkbox next to the Add-on (Mesh: Window Generator) is ticked.
  6. Click the Save User Settings button to make sure the add-on is installed next time you open Blender.
  7. Close the User Preferences dialog box and enjoy!

Manual installation

  1. Close Blender.
  2. Unzip the contents of the window_generator .zip fine into your scripts/addons directory.
  3. The windows-generator folder should be created within this directory.
  4. Re-open Blender.
  5. Go to File-> User Preferences.
  6. Select the Add-ons tab at the top.
  7. Search for the add-on by typing "window" in the search box if it does not already appear. Make sure the checkbox next to the Add-on (Mesh: Window Generator) is ticked.
  8. Click the Save User Settings button to make sure the add-on is installed next time you open Blender.
  9. Close the User Preferences dialog box and enjoy!


Adding Windows

In face edit mode, select the quad faces you wish to add windows to. Then either:

  • Navigate to Mesh -> Generate Windows in the Object menu of the 3D viewport. or
  • Press Space and start typing "Generate Windows" and the menu option will appear.

The configurable parameters should appear as a panel in the Blender toolbar.  Try pressing t if it does not appear.

Below is an outline on how the add-on works and then a more detailed list of all the configurable options.

How it works

Basic Principle

The windows are added on every selected face: Each face is divided up depending on the number of windows across and down you have specified.  The pattern works on a top-down basis (by default) on a quad face working from the highest edge to the lowest. The relative width and height of each window can then be controlled.

This can be used to produce a variety of patterns on multiple faces:


Bevels

To add more detail to the windows, you have the option to bevel the frames by both adding a corner bevel to each corner of the window, and by also adding a seperate outer bevel of the window rim.

You can disable the top or bottom of the corner bevels to create church window like effects:

How to control these options and more are described below.

Parameters

A screenshot of the menu options when windows are added.  Further detail follows it:

Window Pattern

This is the random pattern that is added onto the faces.  This works in a similar way to Blender's random selection tool.

  • Percent:  How many windows are added. You can cover the faces with windows completely by increasing this to 100%.
  • Random Seed: Seed number for initialising the random window pattern.


Windows Per Face


How many windows are added to each face across and down.

  • Across: Number of windows across.
  • Down: Number of windows down.

Windows Dimensions

For each window on a face you can change the relative dimensions of the face.

  • Width: Relative Width of the windows.
  • Height: Relative height of the windows.
  • Depth: Depth of window recess.
  • Depth Segments: Segments in window depth.

Bevels

This controlled how rounded, and how detailed, each window is.

  • Corner Bevel: Bevel width of corners.
  • Corner Bevel Segments: Segments in window corner bevel.
  • Corner Bevel Type: This is the type of bevel to be applied to the corners. See the Bevel Documentation under "Amount Type".
  • Outer Bevel: Bevel width of the outer edge of the window recess.
  • Outer Bevel Segments: Segments in outer bevel.
  • Outer Bevel Type: This is the type of bevel to be applied to the outer edges. See the Bevel Documentation under "Amount Type".

Lights off pattern

There is the option to overlay a material pattern which randomly assigns some windows to have a different pattern. This can give the effect of some windows having their lights switched off.

  • Random Seed: Seed for generating window pattern
  • Percent: Random Percent for generating window pattern

Material indexes

When the object has material slots added, you can assign a slot index number so that when windows are created they are assigned that material.

  • Lights On: Assign material slot index for lights marked on, where -1 means nothing will be assigned
  • Lights Off: Assign material slot index for lights marked off, where -1 means nothing will be assigned    

Variation

To add variation to the sizes of the windows added, you can add a random "jitter" to the width and/or height of each window.

  • Width Jitter: Width variation.  
  • Height Jitter: Height variation.
  • Random Seed: Seed for generating jitter variation.

Pattern

The following parameters control how the pattern is applied to each face.

  • Orientation: The window pattern is applied based on the orientation of a face.  By default, windows are created from the top-most edge of a face to the bottom (Top-Bottom).  You also have the option of the face pattern applied from Front-Back or Left-Right.

You also have the option of disabling bevels to either the top or the bottom of the window to create different window shapes.

  • Bevel Tops: Bevel Tops of Windows.
  • Bevel Bottoms: Bevel Bottoms of Windows.

Optimisation

Random window patterns can create unwanted sub-divisions and edges, which you can choose to remove (or 'dissolve').  This may produce unwanted results however, so you may want to disable them.

  • Dissolve unwanted edges: (On by default) dissolve unwanted edges made by random window creation
  • Dissolve unwanted vertices: dissolve unwanted vertices made by random window creation.
  • Edge Split:  Split edges of windows to improve smoothing effect. To quickly remove unwanted smoothing issues when windows are created on smooth faces, you can choose to apply an edge split which cuts up the edges along the window edges.

UV Seams

You also have the option to automatically add some UV seams to aid in UV unwrapping for texturing operations:

  • Mark Seams: Mark the seams of the windows for uv projection
What sorts of faces does the add-on work on?

The add-on works on quads; that is, faces with 4 edges connected by 4 vertices.

Where should I put this in my workflow?

I would suggest towards the end of the modelling stage, where all the details have mostly been modelled and the overall shape has been defined.

I have a new feature suggestion or issue with the add-on. How do I contact you?

I would welcome you contacting me through this website, visit www.markkingsnorth.com, or through twitter @markkingsnorth.

When I add the windows to something like a cube, I can get strange edges appear at the tops and bottoms of the faces. How do I remove those?

You can either:

  • Select the Dissolve unwanted edges and/or Dissolve unwanted vertices. This built in optimisation may help.
  • Alternatively, before adding the windows, add an extra extrusion or edge loop to the top and the bottoms of the cube.

These artefacts occur due to how the window generator splits up the mesh when determining the windows to add. 

When I try and add windows to a face next to one I have just added windows to it does not work. What's happened?

This is most likely because although the adjacent face looks like a quad face (4 edges, 4 vertices) it no longer is.  This is because the windows added to the face you selected previously has added extra vertices.  Instead, try selecting both those faces and create the windows in one go.

When adding a high number of windows across, down, or a high number of bevels, this locks up Blender for a long time. What can I do?

The higher the subdivisions the tool has to make on each face, the greater number of calculations the CPU has to do.  This can become worse when Bevels are added to each window, as Blender has to do even further calculations per window.  You can decrease the chance of this locking out Blender by disabling Bevels completely (by setting the Bevel amount to zero).  I thought about putting a restriction on how many windows you can create, but I felt this limited the tool.

I added windows to a quad face and they look very distressed and not what I expected. What could this be?

If you are still having problems after the following suggestions do not hesitate to contact me and we'll discuss. There are two main possibilities:

  • It is likely that the face is an irregular shape (in other words, not very rectangular).  This is because the tool works best when creating windows on more rectangular looking faces. By default, the windows are applied to each face from the top edge to the bottom.  See the documentation tab for further details.
  • By default, the window generator will dissolve unwanted edges when a window pattern is created.  Often, this can reduce the complexity of the mesh but sometimes it can create undesired effects.  Try disabling the Dissolve unwanted edges option, and if it is selected, turn off Dissolve unwanted vertices as well.
Item Rating

This item has an average rating of 5 from 1 ratings by the community.

100%
0%
0%
0%
0%
  • C64e91fe269b56bfe00f96fc994a56b1

    starfury359 10 days ago

    This is an excellent plugin - with loads of uses and a tonne of options as well. Recommended if you need lots of small detail/nurny style windows or nubbings. Great value as well. Great stuff - thank you Mark.

    • E6d9aac9d9b155b1c848c7aa40b6bc22

      Mark Kingsnorth 10 days ago

      Thanks for the great rating and kind words!

Purchase this item to leave a review!