Modifiers in Blender are powerful tools that help achieve fast various goals. From shaping and modifying mesh objects, transferring data between objects, animation based on specific properties. Even physics simulations like particles, cloth and fluids are part of the modifiers family.
One interesting aspect of modifiers is that you can stack them on top of each other affecting the result from the previous modifiers.
This gives opportunity to create parametric models which is a way of nondestructive modeling.
Simply start with primitive object element and build up towards more complex structure using only modifiers and helper objects like Empties and Textures.
In this tutorial I will show you an example of parametric modeling with modifiers.
We will build a sphere from single plane and will add custom properties that will drive some parameters of the sphere.
If you feel impatient to read through the tutorial you can download the final blend file at the end of the page. But I strongly advise you to go through the steps if you want to learn how the sphere was constructed.
Let' s Begin!
Empty your scene from any objects or start on an empty layer
Creating the Plane
This will add a Plane object that by default is oriented with face pointing in Z direction (Fig. 1)
Figure 1. The good ol' Plane
In order to continue with building the parametric sphere rotate the Plane along X axis by 90 degrees and Apply the Rotation. With the Plane selected press - R then type - X, type - 90 and press Enter, to apply the rotation press Ctrl+A and select Rotation)
The Plane's local axis should look like in Fig. 2
Figure 2. The plane rotated 90 degrees around X axis. Don't forget to apply the rotation!
Adding the Modifiers
Figure 3. The Great Add Modifiers menu.
Adding Displace Modifier
In our case we need to move the whole plane half width (which is 1) to the left on the X axis.
Select the Plane object and add a Displace Modifier with the following settings (Fig. 4):
Figure 4. Our first modifier shifts the Plane to the left of its origin.
Adding second Displace Modifier
In the new Displace Modifier change Direction to Z (Fig. 5)
The Plane should move 1 unit along Z axis
Figure 5. This time let's move the Plane 1 unit along Z axis.
Adding Array Modifier
With the Plane object selected add Array Modifier and enter 12 (for now) in the Count field
Also enable Merge (not shown in the figure)
Figure 6. We continue bay making a stripe of planes using Array Modifier.
Tip: To view the edges of the object enable Wire and Draw All Edges in Display panel of the Object Tab
Adding Simple Deform Modifier
Figure 7. Bending the stripe with Simple Deform Modifier into half circle.
Tip: Bending works by placing the center of deformation at specified origin (center of the object or another one). Then it uses the axis orientation to perform the bend. It takes the vertices and swirl them around Z axis of the object by given angle. In our case the strip is bent to form a half circle.
Creating first custom property
Create a custom property that will represent the half of the faces in a sphere ring, respectively the half of the columns and name it half_cols (Fig. 8). Enter the settings as shown in the figure.
Press N in the 3D View to open the Properties shelf and open Properties panel.
Adding Driver for the columns
With the Picker click over the half_cols property. Increase the number of half_col to 12.
You can open additional Graph Editor to edit the Drivers (Fig. 9)
Figure 9. Create a driver for the Count property of the Array Modifier and link it with the half_rows custom property of the Plane. In this way we won't dig into the modifier stack to change this value.
Adding third Displace Modifier
The Bend Modifier takes the initial length of the stripe from the Array Modifier and bends it into half circle. The length of the stripe is:
length = 2*n ,where
2 is the width of the Plane
n is the number of Array copies
So the radius of the half circle should be:
radius = length/pi or
radius = (2*n)/pi ,where
pi is constant
Add new Displace modifier, set Direction to Y, Midlevel to 0. Add driver - Single from Target to Strength property and pick half_cols property.
Select the Strength channel in Drivers window of Graph Editor and enter the expression:
as shown in Fig. 10
Figure 10. Using driver to move the half circle so its center coincides with the Plane's origin
The half circle is centered correctly. You can test if everything works by changing the half_col value.
Adding second Array Modifier
Enable Merge option (Fig. 11).
Figure 11. Second Array Modifier duplicates the half circle along Z axis.
Creating second custom property
Figure 12. The second custom property of the Plane - rows, will control the number of sphere rows.
Adding Driver for the rows
Set the rows custom property to 12 (Fig. 13)
Figure 13. The second driver will link the number of rows to the Count of the Array.001 modifier.
Tip: Sometimes the Drivers don't update immediately - changing the frame on the timeline will refresh the Drivers.
Adding second Simple Deform Modifier
Add Empty object.
Add second Simple Deform modifier to the Plane.
Set the Empty as Axis, Origin and set the Deform Angle to 180 (Fig. 14)
Figure 14. Second Simple Deform will bend the half cylinder into half torus shape.
The bent half cylinder looks strange. We need to rotate the Empty in the correct orientation.
Select the Empty and type in the Properties shelf, in Transform panel, in Rotation fields the following values (Fig. 15):
Figure 15. With the help of the Empty object the bending looks better.
Adding Driver for the displacement Strength
Right click over X location field of the Empty and add driver - Manually Create Later (Single).
Click the X Location channel in the Drivers Graph Editor and change var to Single Property variable. Select Plane as Object and in Path type: ["rows"]. In the Expression field type:
which is the radius of the outer circle of the donut.
Change the rows custom property to see the Empty shifting along X axis and the half cylinder bending into half sphere (Fig. 16)
Figure 16, From half donut to half sphere - that's the power of drivers!
Tip: While changing the custom properties the half sphere will not close properly because of drivers not refreshing properly. Changing a frame on the timeline (with arrows keys) fixes this problem and refreshes the model shape.
Adding Mirror Modifier
Figure 17. Using Mirror Modifier we complete a full sphere.
If you play now with the custom properties you will notice that the sphere changes its rows and columns but also its size. Let's fix that.
Adding Cast Modifier
We already have spherical object but in this case we will use the Cast Modifier to restrict the radius of that shape to desired value.
Add Cast Modifier to the Plane object.
Disable From Radius, set Factor to 1 and for Size type 2 (Fig. 18).
Figure 18. Using Cast Modifier we restrict the radius of the sphere to constant while changing the custom properties - rows and half_cols.
We made a parametric sphere and we can control the number of polygons however we want.
Tip: To convert and collapse all modifiers and turn the parametric sphere into real mesh press Alt+C - Mesh from Curve/Meta/Surf/Text. This will erase all modifiers but will keep the sphere with the last settings.
Tip: You can add additional custom properties to the Plane for different modifiers parameters like bend angles, relative offsets and animate those custom properties to make crazy animations. Like this:
Download the final blend file!