Monday, August 30, 2010

Sunday, August 29, 2010

Next Tutorial will be about...

Creating this (sorry for the poor quality):


Yep, the next multi-parted tutorial will be on creating a roller coaster, and animating a camera on the tracks to create the above.  First part will be out in a day or so; remember, feel free to request tutorials in the comments on any of my posts, and I'll see what I can do.  Thanks for reading, and I hope you'll stick around to read these upcoming tutorials!

Saturday, August 28, 2010

How to Animate a Lightsaber in Blender 2.5

Hello, everyone!  This is the final part for the lightsaber tutorial series, and is obviously optional if you want to produce a still render.  Let's get started!

We'll begin by adding a bone (Shift A - Armature - Single Bone).  Line up the bottom of the bone with the bottom of the lightsaber handle (make sure to look at front, top, and side view before continuing).  Select the button on the right that looks like a stick figure, and click 'Stick' in the Display panel.  You'll probably have to re-align the bone a bit, then drag the top of the bone to the top of the lightsaber blade.

AL1

Now select the bone, the camera, and the lamp, then Press Ctrl I to invert the selection.  This will select the blades and the handle.  Now Shift-Right Click the bone to select it, and type Ctrl P on your keyboard, then select 'Automatic Weights'.  This parents the mesh to the bone, so that wherever the bone goes, the mesh will follow.  You may be wondering why we can't just move the handle and two blades around together and animate it.  If you do, this will be the result:


As you can see, we clearly need the bone to hold it all together properly.  Now if you rotate, move, or scale your bone, you should see that the lightsaber follows it.  Now we'll start on the animating.  Make sure your bone is selected (Right Click), and press I and select Rotation.  This is just for demonstration purposes.  If you want to move your lightsaber around, select Location.  If you want to rotate it (as I'm doing) select Rotation.  And if you want to scale it up or down, select Scale.  And of course, do all three if you want to move, rotate, and scale it.  In a separate .blend file, take some time to experiment with the other options if you wish, but read the rest of the animating process first.

Now check these two things; if you did it correctly, the white letters in the lower left corner will now be orange.  Also, make sure that the number on the bottom (as shown below) is on 1.  This is the frame number, and the starting point is, of course, frame 1.


Now hit the Up arrow key.  This will move forward 10 frames.  You should now be on frame 11.  Rotate your lightsaber as far as you want to.  The farther you rotate it, the faster it will move, and vice versa.  Now press I again and select Rotation (if you're rotating it).  Every time you press I and select an option, you are inserting keyframes.  These keyframes are the main points of animation.  Once you have set your keyframes, blender calculates the frames in between to fill it in.

Now if you go back to frame one by pressing the Down Arrow key, and Press Alt A, your lightsaber should move!  Now repeat the process of inserting keyframes in whatever way you want.  To go up or down just one frame, use the left and right arrow keys instead.  You can also click the arrows next to the frame number at the bottom.

My animation has only 50 frames, so I've set the End to 50.  My timeline now look like this:

AL1

Now to render the animation.  Click on the button that looks like a camera (it will take you to the rendering panel).  Typically, I would save a basic animation in QuickTime format, as it is relatively straightforward and works most of the time.  But in 2.53 beta, there appears to be a bug where every time one tries to render an animation in QuickTime, blender crashes.  So I will use AVI Raw for this demonstration.  AVI Raw files can be played in Windows Media player, and several other media programs.  This can be done in the Output panel.


Click on the folder button (as shown above) to choose where you want your animation to be saved.  I am also going to change the fps (frames per second) to 29.97, as I think it gives a smoother animation than 24 (this can be done under the dimensions panel).  Finally, click the Animate button at the top of the Render panel.  Once it's finished rendering, go to the place where you saved your file, and play through your animation.  Great job!  You've now animated a lightsaber in blender!  If you have any questions, comments, or problems, post them in the comments below.  Thanks for reading!

Thursday, August 26, 2010

Creating A Lightsaber in Blender - Part 3 (Background and Compositing)

Sorry that I didn't write this tutorial until today; but without farther ado, let's begin.

The final result of this tutorial:



I've rotated my lightsaber around (R) with both the handle and the two blades selected in order to fit in the camera viewport better; I also moved the lamp, and adjusted the halo size.  This can be done here:


Now when you render, you should get a result like this:


Now, for our purposes we want something better than just a dull, grey background, so let's change that.  Select 'Blend Sky', then change the Horizon color to a very dark purple, and the Zenith color to a very dark blue.  You should now get something like this:


Notice how I also changed the halo settings more; if you want your halo size smaller, but if you make it smaller you can see individual dots, simply go into Edit Mode and subdivide it again.  Now our background still looks a little drab, so let's add something else to it.  Go to the world buttons, and enable 'Stars', then click the little arrow that drops the menu down.  Set the size to .04, the Colors to .25, and the Separation to 2.  Also, you may have noticed that my camera dimensions are different than yours.  In case you want the same, these are: 1280 by 720, rendered at 65%.

Now we should get something like this if we render:


That's good enough for now, so let's move on to the compositing.  All we'll be doing is adding some Chromatic Aberration.  Change the screen from 'Default' to 'Compositing'.


Select 'Use Nodes'.  Two nodes will appear on the screen; move the Render Layer node to the upper left corner, and the Composite node to the lower right.  You should now have a setup like this:



Now add a Lens Distortion node (Shift A - Distort - Lens Distortion), and connect the nodes as shown below (Click and drag).


Set the 'Dispersion' at 0.015, and render.  Congrats!  You have finished the 3rd part of this blender tutorial! If you have any questions, comments, or problems, post them in the comments below.  Thanks for reading!

Tuesday, August 24, 2010

Monday, August 23, 2010

Quick Tip; How to Improve Reflections in Blender

Hey, everyone!  This is just a quick tip on how to make reflections look better in Blender.  If you've been following the lightsaber tutorials and want to make your handle look more realistic, this is one step closer to realism.  In light of that, I'll be using the lightsaber handle as an example for this tutorial.  I'll start by selecting the handle (Right Click).  Next, I'll go to our Silver material.


Now click on the texture button (you may have to drag your panel out a bit to see it) and add a new texture.


Change the type from 'Clouds' to 'Image', and load the image you want the handle to reflect.  In this case, I'm using this image I pulled off of http://cgtextures.com/, which is a very reliable texture resource database, and I strongly recommend you become a member.  


After opening the image, under the 'Mapping' tab, change the coordinates from 'Generated' to 'Reflection'.  Next, under the Influence tab, select 'RGB to Intensity', and change the color from pink to a darker grey.

If you render now, you should see the reflection.  You may need to tweak some of the coordinates in the 'Size' in the 'Mapping' panel, but other than that it should work!  Any questions, comments, or problems, post them in the comments below.  Thanks for reading!

How to Create a Lightsaber in Blender - Part 2 (Materials)

Hello again!  This is the second part of the lightsaber creation tutorials; in this tutorial, I will be teaching you how to add materials to the handle, and how to create the blade.  I am using Blender version 2.53 beta in this tutorial.

This is the final result of this tutorial:


So let's get started!

First, open up your previous .blend file with the handle in it.  As you can see in this image, I have rotated the handle and moved it around to produce the final image shown on the last tutorial.



To put it back to it's original position, I'm going to clear it's rotation (Alt R), clear it's scale (Alt S), and clear it's location (Alt G).  Now when I go back to front view (Numpad 1), I'll see this:


Next we're going to deselect the handle (A), and zoom out (Scroll your mouse wheel or use the '-' key).  Pan your view up some (Ctrl - Numpad 8) so you get something like this:


Ass you may have guessed, we're now going to work on the blade.  Add a plane (Shift A - Mesh - Plane), and go into Edit Mode (Tab).  Go to the top view (Numpad 7), and deselect all of the vertices (A).  Add a loop (Ctrl R) in the middle of the plane as shown below:


Now invert the selection (Ctrl I), and delete the selected vertices (X).  Go back into front view (1) and zoom out some.  Rotate the line 90 degrees along the Y axis (R - Y - 90), tab back into Object Mode, and move the line up along the Z axis (G - Z - 35).


Now scale it up along the Z axis (S - Z - 20).


We're going to give the blade it's materials now.  Click on the materials button on the right side of the window:


Click on the big button that says 'New'.  Next, select the button that says 'Halo'.


Now go go into Edit Mode (Tab), and subdivide the blade (W - Subdivide).  On the left, set the number of cuts to 10.  Next, subdivide it again, and set the number of cuts to 5.  If we tab back into Object Mode now, we should see this:


Now, back in the materials panel, raise the 'Add' value to 1 (the maximum), and change the color from light-grey to white.


Now, we won't have an exact idea of what we want the halo size to be until we render it, so we'll leave the material settings at that for the time being.

Moving on, we're now going to duplicate the blade (Shift D - Right Click).  Now scale the second blade up slightly (S - 1.03), and subdivide it once.  There's a small '2' next to the name of your material; click that to make the material a single user.


Now make the color of this material the color you want your lightsaber to be; I'm going to make mine blue.  Next we'll work on the handle materials.  Select the handle, and press the 'Add' button to give it a new material.  I'll just be giving it a basic shiny metal material; set the specularity's intensity at 1 (the maximum value), and set the Hardness value at 100.  Next, change the specularity type from 'Cook-Torr' to 'Wardiso'.  Finally, enable Tangent Shading, and make the material a darker grey color.  Your material settings should now look like this:


Now tab into Edit Mode, and zoom in on the two rings and the upper part of the handle.  Select these portions of the mesh:


Add a new material, click the little '2' again, name the new material 'Gold' and the other material 'Silver'.  Now change the color of the Gold material to gold, and click the 'Assign' button at the top of the materials panel.  If you tab back into Object Mode, you should see that the edges of our rings are now gold:


Tab into Edit Mode again, and deselect the rings (A).  Add a new material by pressing the '+' button, click the '2', and name the new material 'Black'.  Change the color to black, deselect 'Tangent Shading', change the specular type back to Cook-Torr, set the specularity intensity at 0.1, and set the hardness value at 50.  Your material settings should look like this:

Now select the parts you want to be black.  I'm changing these parts:


Click 'Assign' once you've selected the parts you want.  I've noticed that the black is leaking into a part that I want to be silver:


This can be fixed by adding a loop underneath it:


Now deselect the loop (A), and select the lightsaber button by pressing 'B' on your keyboard and dragging a box around it with your mouse.  Add a new material by clicking the '+' button, click the little '2', rename the material 'Red', change the color to red, and click 'Assign'.

Congratulations!  You have just finished part two of this tutorial series!  In the next part I will be showing you how to light and render the lightsaber in a simple scene.  If you have any questions, comments, or problems, post them in the comments below.  Thanks for reading!

Sunday, August 22, 2010

How to Create a Lightsaber in Blender - Part 1 (Modeling)

Hello, everyone!  This tutorial is going to show you how to model a lightsaber; I will follow this part up with a second part covering the materials and rendering within the next few days.  This is the final result of this tutorial:




So let's get started!  Open up blender, and delete the default cube (X).  Next, add a circle (Shift A - Mesh - Circle).


Press '1' on your numpad to go into front view, 5 to change to orthographic view, then hit 'Tab' to enter edit mode.  Extrude the circle 13 blender units (E - Z - 13), then hold down Ctrl and hit the '8' key on your numpad to scroll the view up so you can see the whole extruded circle.


This is the start of our lightsaber handle.  Press the 'A' key to deselect everything, then press 'B' and drag a box around the vertices on the bottom of the tube.  Press 'E' to extrude, right click to lock it into position, then scale it up by 1.5 blender units (S - 1.5).  Next, extrude the selection again (E - Z - -4), then scale it down (S - 0.5).


Extrude the selection and scale it down again (E - S - 0.9), then extrude that selection (E - Z - 0.1).  Finally, extrude it one more time, then merge the vertices (E - Enter - W - Merge - At Center).  If you go back into object mode (Tab), and rotate around your viewport (Drag Middle Mouse Button), you should see something like this:


Go back into front view and enter edit mode again (Numpad 1 - Tab).  Press 'A' to deselect the selected vertex.  Pan your view to the bottom of the handle (Ctrl - Numpad 2), and zoom in (Mouse wheel or +).  Add a loop (Ctrl - R), and position it as shown below:


Add another loop, and position that one as shown below:


Deselect the vertices (A), and enter face select mode (Ctrl - Tab - 3).  Also, deselect this button (when selected, this button limits the selection to the current view):


Now select two faces at a time, every other two faces (select two faces, skip two, select the next two, skip the next two, and so on) by holding down Shift and Right Clicking the faces.


Next, delete these faces (X - Faces).


Next, go into Edge Select Mode (Ctrl - Tab - 2), and select each edge loop around every hole (Alt - Shift - Right Click).


Extrude them in (E - S - Shift Z - 0.95).  Tab back into Object Mode to take a quick look at your work so far.  The model looks a bit blocky, so lets set the Shading to Smooth.


Tab into Edit Mode, and press 'Ctrl N' to recalculate the normals on the outside.  Now let's readjust our focus to the top of the handle.  Pan your view up to the upper portion of the handle, switch to Vertex Select Mode (Ctrl - Tab - Numpad 1) and select the top loop of vertices (B - Drag a box around the loop).  Make sure before you select those vertices, that you don't have anything else selected (A to deselect everything).  Extrude this, and scale it up (E - S - 1.25).


Next, extrude it up 3 units (E - Z - 3).


Extrude it again, and scale it in (E - S - 0.9), and again (E - Z - -2.75).


Deselect everything (A), pan your view down a little bit, and add four loops as shown below (Ctrl - R) :


Then add four more loops around those as shown here:


Next select these sections by pressing 'B' and dragging a box around them:


Then, scale them up (S - Shift Z - 1.1).


Press 'A' to deselect the loops, and add a Circle (Shift A - Circle).  You may have to zoom out a bit to see the circle.  Rotate the circle along the X axis 90 degrees (R - X - 90).  Move it up along the Z axis (G - Z - 5).


Scale it down (S - 0.35) and go into side view (Numpad 3).  Move the circle along the Y axis (G - Y - -0.8), and extrude it (E - Y - -0.5).  Extrude it again, and merge the vertices (E - Enter - W - Merge - At Center).  Set the mesh to Smooth Shading again (so the circle is included).  Select the circle (which is now the button), and press 'Ctrl N' to recalculate the normals again.


Recalculating the normals removes the nasty black lines on the mesh.  Deselect the button (A) and go back to the front view (1).  Now we're going to give it a Subdivision Surface Modifier to smooth it out more.  On the left, click on the button that looks like a wrench.


Click on the menu that says 'Modifiers' and select the modifier highlighted in blue below:


Now the mesh looks a bit too smooth, but we can sharpen the edges by adding more loops.


I'll demonstrate now; tab into Edit Mode, and pan your view down to where the bottom of the handle meets the main shaft.  Add an edge loop (Ctrl R) and slide it down so that it almost touches the bottom, but not quite.


Notice how it made the connection a bit sharper; you may be wondering why I added a subsurf modifier if we wanted sharp edges.  This is because even though it's a somewhat subtle effect, it still makes the edges smoother.  Nothing in the real world has a perfectly sharp edge; there's always some level of thickness to it, and that's what we're adding here.  I'll demonstrate again on a more noticeable edge.  Now pan your view to where the rings on the handle are.


Add two edge loops on the inside of one of the rings:


This change isn't very noticeable in Edit Mode, but if we tab into Object Mode, it's a lot more obvious:


Unfortunately, I can't demonstrate with every edge loop necessary on the model for time's sake (and this tutorial is already long enough as it is), so just keep adding edge loops next to the edges that need sharpening (don't forget the button!).

You should have something like this when you're finished:


And that's all for this part of the tutorial!  You may be wondering why we haven't done the blade yet; that's because I'm saving it since it's mostly material work (including working with halo materials).  I hope you've enjoyed this tutorial and that you learned something from it!  If you have any questions, comments, or problems, post them in the comments below.  If you were having problems with switching to the different views, make sure you have num lock enabled.  Thanks for reading!