Thursday, July 4, 2019

Using Array modifier for an object around a point in space in Blender

Building an array of an object around a point - it always feel messy and non-intuitive in Blender. The first half-dozen times, I'd have to look things up on the internet to recognize where I went wrong. I did this in Blender 2.78, but it applies the same in 2.8.

The two primary tips


  • Set your object to scale & rotation (Scale should be 1.00 when doing an array)
  • Put the object origin on whatever you're going to rotate around

To demonstrate the process, make any object, grab it so it's not in the center, and scale it some fashion.
For this example, I took a cube, extruded it on the Y-axis, added some loop cuts in edit mode (control-r), scaled those cuts in x- and y-axis — then moved it on the y-axis away from the center.

We'll want to spin this object around the center of the grid on 0, 0, 0 - so shift-s to put cursor to center (if it wasn't already there).  Under Object>Transform>Origin to 3D Cursor (or under Tools>Set Origin, or shift-control-alt C)...set the origin to the cursor.

If we DON'T set the origin to cursor, it'll spin around the center of the object when it was a lonely little cube. The green and red arrows should no longer be set on the object, they should have moved down to the center.

This is the killer - Object>Apply>Rotation & Scale.

With the cursor still in the center, shift-a to add an empty axis.

Now for the fun.
The Modifier (wrench) > Array panel

You'll want to turn off the relative and constant offsets. The Object Offset, you will want to turn on, and mark the Empty axis as your offset. (It'll be a drop down in the list of objects you have in Blender.) Nothing will appear to have happened to your object, as the array objects are stacked in the same space.

The next step is selecting the Empty axis, and then rotate it 45 degrees on the Z-axis. This will fan out your objects, based on the rotation of your empty axis. If you want an even distribution of these objects, you would take 360 degrees, divide by 7, and use that instead of 45. (This is convenient sometimes when building a complex objects.)

The array of 7 pieces, at 45 degrees. Note that the original piece counts towards the "Count" from the array modifier panel.

Troubleshooting

If it didn't look like this, go back and revisit the first two points: apply the rotation & scale to the object, and make sure the origin of your object is set to the same spot as your Empty axis.

Extra Tricks


Let's say you wanted to add a number to each of those tiles in space. You could Add Text (then duplicate it any number of times, but hide the extras) above one of those tiles, convert it to mesh, thicken it, boolean it into the object...and then rotate the Empty axis another 45 degrees, to add each number.

Alternatively, you could "set rotation" on your Empty axis each time, and then type in the 45 degrees again....this could be useful, if your rotation is something more complex, like 31.528 — meaning you wouldn't have to do the extra math each step.

You can also do some funky things, by changing the scale of your Empty axis which will stretch or shrink your array in a given direction.