Thursday, July 21, 2011

Leg & Foot Rigging: Trial and Error

After trying Tob's tutorial for the first time yesterday, I failed. Not completely, but things weren't working right. I was trying to apply it to my model while watching the video. I renamed bones differently because I didn't like his conventions and so forth - that may have thrown me off.  Last night I spent a few hours toying around with what I've learned so far until I got tired.  It seemed pretty hopeless in the moment, but I learned some IK behaviors in the process.

Today, I started Tob's tutorial afresh from the basic scene - no mesh - no nuthin.  Maybe things have settled in my brain a bit better - I've succeeded in getting through videos 2 & 3 which are the hardest parts (so he says. I'm feeling better about this whole IK thing, but really, I just can't wait to get to the point where I can start animating some actions properly.


Q&A
Here are some questions that I had, my solution, and links to the source.

Q. Why are my bones with IK constraints showing as orange rather than yellow?
A. The bone is not being targeted "correctly". In order for a true IK to work you must target a bone that is outside the chain / is not parented to any bone in the chain with the IK. If the bone is targetless or if auto IK is on, this  means that when you are animating you have to track all of the bones in the timeline individually vs. only having to track the targeted bone.

revolt_randy on BlenderArtist.org :

First off, you don't have a proper IK setup. Notice how the bone with the IK constraint is orange in color. That means there is an error, proper IK constraint setups are yellow in color. The way you have it set up, it works as a 'fake Auto-IK'. You can use it this way, but you have to do a couple of things. First, when you set your keyframe on frame one, you will have to set rotation keyframes for all the bones. It's easiest to just select all the bones, and set loc/rot keyframes for them all. Then make sure you turn on auto keyframes in the time line. (that's where I had my stupid moment) Now advance to frame 31, grab you bone with the constraint and move it. Keyframes will be made for the bone you moved and all other bones that were moved. Then it works how you expect it to.

You can also, remove the constraint, and in the toolshelf, select the 'AutoIK' option, then repeat as above, does the same thing.

To make a 'proper' IK chain, you need to add one more bone, which acts as a controller for the chain. This extra bone cannot be parented to any bone in the IK chain. Then you can control all the bones in the chain by just keying this one bone.
view entire thread


Q. How do I lock rotations in an IK chain?

Inverse Kinematics options

A. The closest thing I've got is the documentation on WikiBlender.org,  but the documentation is for version 2.4:  http://wiki.blender.org/index.php/Doc:Manual/Rigging/Posing/Inverse_Kinematics
I've found that in 2.5 the options / settings are in (Armature Pose Mode) Properties Window > Bone Panel > Inverse Kinematics.  Here you can lock the bone from rotating in certain ways even if it's in an IK chain.

In order to limit a bone's rotation / location / scale in any other scenario, you can select the bone, then add a Limit Rotation / Location / Scale Bone Constraint from the Bone Constraints Panel while in Pose Mode, or toggle Transform Locks in the Bone Panel while in Pose Mode.

Wednesday, July 20, 2011

Leg & Foot Rigging

Wow, when it come to rigging and Blender, this guy really knows what he's talking about it seems:
Tobuslieven Youtube Chanel

Image of rig from Tob's tutorial

The last tutorial I found for rigging a squat or sit was pretty bad in hindsight, or was just too simple for what I want to achieve. Problems came up when I tried to move the foot independent of the leg. It was not a very sound structure for animation.

Tob is making some clean rigs that I can't wait to try. I'm going to eventually scrap my last leg rig (uuug) and try out this one.  His tutorial is in version 2.5 which is a plus for sure, and following the foot tutorial he has a tutorial for a leg rig which I haven't viewed yet - all of which can be found here:
Youtube Playlist: Blender 2.5 Foot and Leg Rigging Tutorial

Thanks Tob, and everyone who takes the time to make tutorials, even the ones that turn out not so great. I've learned something from every one that I've viewed so far.

Tuesday, July 19, 2011

First Human Character: Progress

I haven't been tracking my progress very well, but I have been learning a ton. Here is a screen shot of my most recent model:

my model squatting / sitting using IK Constraints
I'm being lazy about my blog but here are the steps and skills I used to create her:

PREPARATION
> Created orthographic sketch in MyPaint and GIMP
> In Blender, added sketch to background and split 3D window and set to front and left orthographic views

MODELING

> Added a mirror modifier to a cube split down the middle and mirror-modeled one side of body mesh (body mesh included body arms and feet)
Mirror modeling saves a ton of time and allowed me to work maybe 3-5 times as fast because I didnt have to manually match up left and right and I didn't have to duplicate or create anything separately.
> Modeled hand mesh in separate file, saved as .dae and imported to main character file
> Joined hand and body mesh
> Created head from a split UV sphere in body mesh

> Created left side of armature naming all future duplicate bones with the extension .L

TEXTURING

> Created UV map of completed mesh for texturing
> Textured a bikini using MyPaint and GIMP (Linux OS so no Photoshop)
> Learned how to implement transparent (alpha) UV textures
> Learned how to map a texture onto a material and use premul (premultiply) for smoothing of edges


ARMATURE
> Parented armature to mesh with named groups
> Manually assigned all vertices to vertex groups
> Created a couple items like a hat and hair, then parented to head bone of armature.> Tested rigging thoroughly
> Mirrored armature
> Learned how to automatically rename .L extension to .R by pressing Wkey in Edit Mode
> Combined armatures

> Learned how to automatically create reflected vertex groups and apply to complete armature

IK RIGGING

Now I'm learning how to create IK chains - it's probably been the most frustrating step next to learning how to implement textures with alpha.  However, it might just be me making a simple thing into a difficult one - I tend to do that sometimes.

RIGGING CHARACTER TO SIT AND SQUAT

My most recent breakthrough was rigging my character to squat or assume a sitting position using IKs. I watched these videos and found the solution:

Video 1 teaches you how to set up the pelvis bones:
Blender Rigging Intro Part 1

Video 2 sets up the patenting hierarchy and foot bone IK targets:
Blender Rigging Intro Part 2

Video 3 finishes up the IK constraints and targeting so the character can sit or squat :
Blender Rigging Tutorial-Part3

This guy's video is alright, I got impatient watching it, mostly because he makes mistakes in one vid that you have to be sure to go back and fix once you see it in another. Pay close attention to his set-up, IK rigging, and mistakes through all three vids and you should be alright.

EVENTUALLY

Eventually, I'm going to create some tutorials of my own for others to view, but right now, I'm too busy making mistakes and learning from them. If there are any questions about the steps that I make above, feel free to leave a comment, and I'll elaborate.

Tuesday, June 21, 2011

First Human Character

Alrighty, so I already know this entry is going to take a couple days, and possibly cause me a few headaches, but it should be fun. I'm going to create a human-like character in Blender 2.5 starting with an orthographic sketch, and moving on to a double-view mirror-editing technique. If you haven't already seen it go to my last entry about My Blender Beginner Resources and see Peter's Massive Blender Tutorial for an example.


The Orthographic Sketch
An orthographic sketch makes things easier to shape. In order to model in 3D, you need at least two views, and it is best to choose two important views - front and side. To start I drew an orthographic view. In order to properly create an orthographic view, you need to pretend that your character is facing you inside of a glass box. If the subject is facing you and you turn your box to the right (clockwise from the top), your character would now be facing left. This is an important concept to learn! Here is my example below. You may understand clearer from the sketch:


character faces front & left

If the figure on the right was facing the other way, this would be wrong!

Also, you may notice that I drew parallel lines and labeled them on the far right. This is so that both drawing are drawn on the same height scale. The head must be the same height, the torso must line up, the legs, arms and feet must be the same height in both drawings!  Seeing as your 3D model will be a composite of both views, they need to share the same heights.

Well, this is it for now, more to come. I'll talk about setting up Blender to begin modeling next!

Monday, June 20, 2011

My Blender Beginner Resources


Starting off, I was very tentative.  I didn't understand how I was going to be able to create 3D objects on a 2D screen.  I thought modeling would be super technical and complicated, but once I got used to navigating the view and using the basic tools, I discovered that it was surprisingly simple.  I could write some tutorials on the basics, but it would be super redundant seeing that there are great resources out there already.

Blender.org Video Tutorials
As I said before, I started Blender with little to no previous knowledge or experience with 3D programs, so my first stop was the Blender.org website. They have a listing of 7 video tutorials that will give you a basic introduction to Blender.

Gryllus.net Blender (2.5) 3D Design Course
This is a free course that teaches Blender from square one and is probably one of the best recourses I've found.
There are links to great videos and he has lists of projects that you can do. Two very helpful videos in Unit 2 were about rotation, pivot points, and center points :


Peter's Massive Blender Tutorial

Peter's Massive Blender Tutorial is a kick-ass 9-part Youtube tutorial series by PXstriker that teaches you his method of modeling low poly characters. I suggest getting comfortable with some basic controls first - he goes a bit fast.

Chapter 1 - Blender Basics (basic commands)

Chapter 2-1 - "Modeling" (setup mirror modeling & model the body)
Chapter 2-2 -  continued (arms & joints)
Chapter 3 - "Hands"
Chapter 4  - "Heads" (hair)
Chapter 5 - "Meshing the Meshes" (combining meshes / attaching)
Chapter 6 - "Texturing" (UV texture maps)
Chapter 7 - "Bones" (armature & animation)
Chapter 8 - "Rendering"

HotKeys Reference
Here is a great reference for hotkeys that's gotten me out of many a sticky situation:

How I Killed Blender With Subsurfaces... Oops

During the week or so I have been working, Blender has only crashed once, and that was my fault - I added a subsurface modifier to a mesh then set the subdivisions to, say, possibly 100! This cut up the surface of a mesh into thousands of smaller polygons, and created some kind of math that my computer couldn't handle. Needless to say - don't do that when you learn how to use subsurfaces and subdivisions. 
Anyway, this is how I did it, and this is also how to create a subsurface modifier if you are curious:
  • In Blender 2.57 open a new project
  • Right click your default cube (it should already be selected)
  • Go to your Properties panel (hover your mouse over a panel and press SHIFT+F7)
  • Go to Modifiers (the wrench icon) > Add Modifier > Subdivision Surface
If you look at your cube in the 3D View window you'll notice that it has "rounded out" into a clumpy spherical shape. If you increase the subdivisions, this breaks up the 6 faces of the cube into more and more polygons. With the next two steps I managed to kill Blender.
  • Found Subdivisions option and set to 100 (or anything over 7 I've come to find)
  • Pressed Enter ( KABLAMO - broken )
click to enlarge

As a side-note, I found when you set Subdivisions, be sure to set both View and Render.  If you don't adjust the Render property, your rendered image or animation will look different than your view.  Keeping the View number low when making a model and rigging animations helps the program run faster in real-time playback (there are less polygons to keep track of).

Friday, June 17, 2011

Invert Z-Depth ( Back-Face Culling ) in Blender 2.57

These are some of the first things that I created to start off in Blender and how I made them.

A Cube Inside of Another Cube
My first few creations were inspired by an artist on Deviantart.com - Cezkid.  He makes 3D pixelated 8-bit video game characters (voxel models) that I found to be pretty novel - Cezkid Voxel Characters. He uses Google SketchUp not Blender.


cube inside of another cube with Invert Z Depth enabled
So at first glance, this cube looks quite unimpressive. You'd think it was just a cube with a big blue border around it, but it's not. And it wasn't that easy to figure out how to execute.  I asked Cezkid for some leads and he mentioned "back-face culling". Well it was a lead, but it did me little good because Blender doesn't have an option named back-face culling or anything similar.  Also, this was my first model, and I had little to no idea how to determine the visibility of a polygon or face.  After many hours of Googleing and tweaking, I happened to stumble upon the Invert Z Depth property (Zinvert in earlier versions) by accident - success.
Brief Invert Z Depth Explanation:
These are two cubes- a small one ( solid grey material with Recieve Shadows and Cast Shadows turned off and Z Transparency turned on), and a bigger blue one ( solid blue material with Shadeless and Invert Z Depth property turned on).  This creates a mesh (the big cube) that has transparent faces when they point to the camera.  This also works on two-sided faces in case anyone's wondering. Read on to see exactly how I did it.



Invert Z Depth Tutorial:
You don't need an actual mouse with a wheel for this tutorial. A touch pad will suffice.
  • Open a new Blender project
  • Right click on the cube in the 3D View to select it.
    selected cube object
  • Go to Properties Panel (SHFT+F7) and select Material
  • Materials icon in Properties panel
  • Scroll down to Shading and check Shadeless
  • set Shading to Shadeless
  • Scroll down to Options and check Invert Z Depth
  • Inver Z Depth
  • Place the cursor in the 3D View and press the ZKey to show the cube in Mesh mode.
  • Be sure the cube is selected and press SHFT+DKey to duplicate the cube. 
  • Press ESC (otherwise the duplicated cube will move around)
  • Press SKey > type the number .5 > press ENTER (this scales a cube down to half size)
  • scaled cube inside duplicate in mesh mode
  • Now be sure that the smaller cube is selected and go to the top of its Material panel.
  • Remove the Material by pressing the minus-looking button.
  • Remove material and add a new one
  • Press the + New button that pops up.
  • Check the Transparency option and enable Z Transparency (THIS IS IMPORTANT)
  • enable Z Transparency in the smaller cube
  • Scroll down to Shadow and un-check Recieve.
  • un-check Recieve in Shadows option
  • Press F12 to render!



If everything went smoothly, you should see this:


 Hope this may help anyone who may be looking for something similar. I have no idea how this will hold up under other scenarios or circumstances, but it worked for this example.



Other Objects
Here are two other objects that I created with the same concept.