Friday, 20 March 2015

Blender: Screwing Around (Simple Vase)

In my first handful of Blender beginner tutorials I featured the amazingly powerful array modifier and showed just how useful it can be for a wide variety of projects. Now I think it's time for the almost-as-equally-useful screw modifier to get some love.

Chic Aeon has been doing some great beginner Blender tutorials (highly recommended!) for the community as well, but one of the recent ones made me think "that's not the way I'd do it." That's not a knock on Chic. It's just something you'll find yourself thinking over and over again as you become more expert at modeling. Blender has a ton of tools, and when you have a certain end product in mind there are often a lot of different methods you can use to achieve it. The method you pick usually depends on what you're most comfortable with, and just how lazy you are.

I'm pretty lazy.

In this tutorial I'm going to show you a completely different method from the one Chic used to make a simple screwing around. :)

Think of the screw modifier as sort of array + curve on steroids or perhaps a super-extrusion tool. Better yet, let's play with it because it's a lot easier to show than to describe.

Fire up Blender and...
  1. Switch into ortho view if you aren't already (numpad5) - it's very rare for me not to work with this mode of viewing but if you find it more intuitive to work in perspective view instead, by all means feel free to do so. The primary reason I prefer it is that I can use the "grab" hotkey G and then visually move things with confidence on those 2 axes provided I have already set an axial view...which is a fancy way of saying that I'm looking at it from the front (numpad1), back (ctrl + numpad1), right (numpad3), left (ctrl + numpad3),  top (numpad7) or bottom (ctrl + numpad7).
  2. Because I'm lazy and don't like modeling by hand any more than I have to, let's use the handy Bezier Curve for this (menu: Add > Curve > Bezier)
  3. Select it and switch into edit mode (tab)
anatomy of a bezier curve segment
    1. By default the curve is "flat" on the z-axis and expects to be shaped on the x- and y-axes but for what we want to do we need to work with it on the x-z plane so let's rotate it twice. First, select both of the control points (either manually or you an use hotkey A to toggle back and forth between select all and select none) then rotate it +90 degrees on the z-axis (R Z 90) and then rotate it -90 degrees on the x-axis (R Z -90).
    2. Now switch to front view so we'll be looking at the front of the object (numpad1)

    3. We're going to be using this curve to define the shape of the side of our vase, which will be centered on the x-y axis, so let's move our whole curve a bit to the left.

      To avoid repeating myself a million times, whenever I say "move" that's your queue to press hotkey G. If I say to only move it along one axis, you'll follow that G with the letter of the axis to move it along. If I follow that up with a specific amount, you can type that in too as part of your hotkey combination, the just press enter. So "G X -0.1 <enter>" is "move > x-axis only > by -0.1 blender units > confirm".

      For this one we're moving left, which is the x-axis, and let's start by just moving it out a small amount...perhaps 0.1m.
    4. Now let's set up our modifier which will make it much easier to see what we're doing. We can add modifiers even while we're in edit mode so in the properties panel switch to the modifier tab, then from the "Add Modifier" drop-down box pick "Screw"
    Wow! What the heck just happened? Suddenly our simple little curve turned into a vase! Sure, it might not be the exact shape we wanted, but gosh that's handy (not to mention fast and perfect for a lazy person like me).

    What the screw modifier does is start smoothly extruding an entire object in a circle around whatever origin point is set and by default it's the object's z-axis. You can change this to one of the other axes using the "Axis" drop-down box or even set another object to be the center of rotation (usually you'd use an Empty for that, although not always) by selecting it in the "Axis O" box. For our vase the default z-axis is exactly what we want.

    The angle it "screws around" is set to 360 degrees by default -- a full circle -- so it's extruding our curve in a full circle around the z-axis which it pretty much exactly what a potter does when making one in real life and perfect for our vase. If you only wanted half a vase cut up the middle, you'd change the angle to 180 degrees.

    The "Steps" value is the other important one for today's tutorial. Blender actually uses two steps values...the one called "Steps" and the one called "Render Steps". Because we're exporting objects and importing them to Opensim we're only interested in the Steps value and can safely ignore the Render Steps value any time we see it (including in other modifiers or anywhere else we see it). For our vase this step value determines how many vertical loops will be used to make that full circle. If you set it to something very low like 6 (try it!) it will look really rough. If you set it to something quite high like 48 or more (try this too) it will be extremely smooth and look beautiful. Trouble is, it will also make the total vertex count skyrocket. So let's go with a reasonable middle value of 24.

    I'll do another tutorial sometime that explains a bit more about some of the other screw modifier settings but for this one let's leave the screw value set to 0.0 and the iterations at 1. You're welcome (in fact you're encouraged!) to play with them just to see what happens.

    CAVEAT: when most modifiers are visible on the screen, the vertex/face/tri values at the top of your screen will accurately reflect the numbers after the modifier has been applied. Sadly, that isn't the case with the screw modifier so you'll have to do a bit of mental math. At the moment you should see the value 13 for the vertex count, and 0 for the faces and triangles.

    Why 13 vertices? Isn't that unlucky?

    No, 13 is the number of vertices being used to form your curve and is a setting in the curve properties tab which we will probably need to increase a bit to get a nicely shaped vase. Let's do that.
    1. Switch to the curve properties tab (yes, we can change this while still in edit mode)
    2. You'll see two values in the "Resolution" for preview and one for render. We'll be exporting the object so it's the preview value that interests us and currently it's set to 12.

      This is the number of smaller "segments" to use between each control point to give us the shape of the curve. The number of vertices between points will be this value minus one, and then one vertex at each control point itself, so for simple curve with only 2 control points our total is 13.

      That's not very many (it won't look all that smooth) so let's increase it to 23 which will give us a total of 24 vertices being used to shape the curve. Multiplied by our 24 screw modifier steps, the total vertex count for the vase will then become 24 x 24 = 576. While you're here, try setting it to a very low number (like 4 or 5) and see how that affects the shape of your vase. Then set it back to 24.

      We also need to keep in mind that we're only modeling the outside of the vase right now. We'll be adding a bottom to it later, and if we don't put a lid of some sort on it (which I don't plan to do) we'll also need to model the interior. For safety, assume that your total object vertex count is likely to be at least double whatever we've just calculated, so we'll be looking at a finished vase with at least 1100-1200 vertices. If we want a fancy bottom, or very smoothly shaped rim at the top, that number will grow.
    3. You'll like this step: PLAY!

      While always remaining in front view when you're moving things, grab an interior handle and move it around, watching how it affects the shape of your vase. Grab the other interior handle and do the same. Grab a control point and move it around too (just keep both control points in the left-hand side of the z axis). Don't worry about the size of the vase, just its shape.

      Keep playing until you have a shape you like.

      If you want to get a little fancier, you can add another control point to the curve by selecting one of the existing ones, then extrude (hotkey E) it, then move your newly extruded control point and then confirm. Keep in mind that this also adds a lot of extra vertices to our object since that's another 23 vertices we've added to shape this new curve segment. Once the screw modifier has been applied and we've modeled the interior, our vertex count will be up to a bit over 2k. That's actually not all that bad (a typical single sculptie "prim" is just over 1k) but I wouldn't want to go any higher, and I'd try reducing the curve resolution downwards somewhat to find a good balance between shape and vertex count.

      You can also add a new control point between two existing control points by selecting them both, then click the "Subdivide" button on the toolshelf's Tools tab (or via menu with Curve > Segments > Subdivide).

      For my vase I added one more control point to allow me to make the mouth of the vase fluted at the top (to curve back out). I then played a bit with the resolution of the curve and the number of steps in my screw modifier and found that it still looked perfectly fine with a resolution of 15 and 16 steps
    4. Once you have a shape you like, switch back into Object mode (tab)
    5. Normally I try to avoid applying any modifiers until I'm ready to export because this makes it very easy to go back and make adjustments. In this case we need to do some extra work once our curve has been converted to a mesh so unfortunately we now need to do so. If you try clicking on the screw modifier's "Apply" button Blender will tell you that you're not allowed to apply modifiers to a curve. We didn't encounter that issue in our previous tutorials because, even though some involved using a curve, all of our modifiers were being applied to a mesh (a cube or torus). This time we're working with a curve directly so we need to do it a little differently. We need convert our curve into a mesh.

      To convert a curve into a mesh, select the curve then you can either use the menu (Object > Convert To > Mesh from Curve/Meta/Surf/Text) or hotkey ALT + C and pick that same option. This now "destroys" our curve and any modifiers that were applied to it, replacing it with a nicely modeled mesh that's exactly what you'd shaped.
    6. Now we need to do some non-lazy work, and our first step is to UV-map our vase. I intend to use a seamless pottery texture and I don't mind if it gets stretched a bit, so I'll maximize my laziness by using cylinder projection unwrapping.

      Switch from our default screen view to the UV Editing screen view using the drop-down box in the top menu bar, then entire Edit mode (tab) and with your mouse hovering over the model in the right-hand window press numpad5 to switch to ortho perspective, and numpad1 for front view.
    7. Select the entire vase (hotkey A)
    8. Use a cylinder-projection UV Unwrap (you can do this from the toolshelf's Shading/UVs tab by selecting it from the Unwrap dropdown, or use menu: Mesh > UV Unwrap > Cylinder Projection)
    9. Presto! Without any annoying seam-marking or other hoops to jump through we have our unwrapped surface. We don't care that it's extending outside the mapped texture area on the left because we aren't concerned about up-down tiling at the edges. If you have a little block of faces on the left of right that seems wrong you don't have to worry about them either because for a tiled texture that gets placed where it's supposed to be (believe me, it does and saves all the effort of moving them on the map) so we can accept this unwrapping exactly the way it is.
      body of the vase unwrapped using cylinder projection
    10. Next, we need to make a bottom for our vase, which we can do this very easily even while in UV Editing view. First make sure you're in vertex selection mode.
    11. Switch to bottom view (ctrl numpad7), and now we're going to extrude and join the bottom in the center all in a single step using a fancy hotkey combination: ES0 <enter> (that's a zero, not the letter O). E = extrude, S = scale, and the zero says to scale them to 0% of the original loop size which means they'll all be in the center, and then the enter key confirms that yes, we really want to do this.
    12. We still have all of these vertices crammed into this one point (Blender doesn't auto-merge them) so we now need to remove double while they're still selected. You can do this by clicking the "Remove doubles" button on the toolshelf's Tools tab or via menu with Mesh > Vertices > Remove doubles.
    13. We need to UV map the vase's bottom so now increase the selection from the single remaining vertex to include the entire bottom (hotkey ctrl numpad+). Then Unwrap it using a regular UV Unwrap (menu: Mesh > UV Unwrap > Unwrap). You'll see it added to your UV map along with our previous unwrapping of the side. Since we plan to use a tiled seamless texture this is perfectly fine. There will be a visible seam between the bottom and the sides but we'll assign different textures to them so it will look perfectly normal in world. Let's do that now since we already conveniently have the bottom selected...
    14. While still in edit mode switch back to the default screen view (instead of the UV Editing screen view we're in's the drop-down box in the top menu bar) and you should find yourself still in edit mode.
    15. I do my work with the Cycles Render engine active (for reasons I won't explain here) so if you're using the default Blender Render instead your screen will look slightly different, but for what we're doing it doesn't'll have the same options and buttons. If you'd like to follow along with your screen looking like mine, switch the render engine drop-down box in the top menu bar from Blender Render to Cycles Render.
    16. Switch to the materials properties tab.
    17. Click the + sign to add a new material. By default Blender will assign it to the entire object so let's called it "vase main". You can use all the Cycles render defaults since we aren't going to be exporting anything anyway, but at the bottom in the "Settings" section you might want to pick a viewport colour for this material. I used a pale green.
    18. Now click the + sign again to add another new material. Call this one "vase bottom" and to make it easy to see let's give it a salmon-coloured viewport tint.
    19. Since we have the bottom faces already selected from our previous UV mapping step we can simply now click the "Assign" button. If you've accidentally deselected them then you'll need to re-select them (click on the middle vertex and then ctrl + numpad+ to expand).
    20. We're almost finished! If you intend to put a lid on this vase you wouldn't need to do the next couple of steps because the lid will hide the interior. In my case I want the vase to be open at the top so I also need to model the interior. But, as I mentioned before, I'm lazy so...

      Switch to the modifiers tab. For the modifiers I want to add I find it easier to preview in object mode rather than edit mode so let's switch to that too (tab).
    21. Blender has a wonderfully handy modifier called "Solidify" that will become your friend (unless Second Life/Opensim supports double-sided faces some day) so it's worth spending some time playing with it to learn about its settings. It does exactly what the name says, solidifies an object, automatically modeling it to give it some thickness. For today's tutorial let's simply add the modifier and leave it at its default settings for a moment.

      From the "Add Modifier" drop-down list pick "Solidify".
    22. If you look closely you'll see that when the solidify modifier does the top rim of the object, it adds a 90-degree face to join the inside and outside and this looks very unnatural. I want a somewhat smoother rim (and a smoother "corner" between my vase' base and sides) so I'm also going to add an angle-based Bevel modifier to do this automatically for me.

      From the "Add Modifier" drop-down list, pick "Bevel"
    23. In the Bevel modifier properties, click the "Angle" button as the Limit Method instead of the default (none). This will keep the number of bevels to a minimum and only smooth our the very sharp edges.
    24. The exact settings you use for the rest of the Solidify and Bevel modifiers' settings depends somewhat on the way you want your vase to look, its current size, and how many vertices you're willing to add via the bevel modifier. You'll want to look very closely at the rim (and also at the very base to make sure the seam between the bottom and the sides is fine too) as you adjust them.

      For the Solidify modifier the setting you'll be most interested in is the Thickness. That determines how much space there is between the inside and outside of the mesh, and hence the width of the rim. If you're trying to make your vase look like glass you'll use a fairly small value. For some pottery you'd use a much larger value.

      Once you like your thickness, pick a combination of setting for Bevel that make the rim look decent. I'd suggest an angle in the range of 20-35 degrees, 1 to at most 3 segments (otherwise you're adding a lot of vertices that are not going to be noticed) and whatever width gives the smoothest, most appealing shape to the rim when you look closely at it.

      Here's what I ended up with
    At this point I am ready to apply modifiers and export to collada (.dae)

    In world, I add my textures and have something like this which I can easily scale to any size and even further modify the shape of (via changing only the x or y or z sizes of the mesh)

    No comments:

    Post a Comment