Daimonin
Members login
Sign Up!      problems?
N F
* Daimonin Forum
Home Help Search Calendar

Welcome Guest, you have to register to post here.
Search

News

Stats
74116 Posts in 6716 Topics by 8115 Members
Latest Member: salvafrench
Daimonin Forum  |  Contributions  |  Graphics (Moderators: Sherock, subaru)  |  Topic: Torchwood's Blender Tutorial (warning - picture heavy thread!) « previous next »
Pages: [1] Go Down Print
Topic: Torchwood's Blender Tutorial (warning - picture heavy thread!)  (Read 1385 times)
Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« on: May 10, 2008, 03:33:43 pm »

Uni asks ... and Uni gets!  Here is a very rough, but quite detailed tutorial on how I personally use Blender to create my mobs.  I'm not an expert, and I'm sure some of the things I do may not be using Blender to its best advantage - but never mind!  Hopefully you will find this useful if you are considering using Blender yourself.  Note:  Don't just use my tutorial ... you should look at some of the official tutorials on the Blender web site that will give more details on some of the basic techniques I gloss over.  This one in particular is excellant:
http://wiki.blender.org/index.php/BSoD/Introduction_to_Character_Animation

This one is also very good:
http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Creating_Models_With_Photo_Assistance#Taking_the_Best_Reference_Photos

Here is the Blend file as it exists at the end of the tutorial:
http://screamingflower.dontexist.org/daimonin/media/graphic/temp/torchwood/tutorial/carrier_08.blend

On to my tutorial (I'll put it in a couple of posts for clarity ... and yes ... it really should go into the Wiki, but I don't have access).
« Last Edit: May 10, 2008, 03:56:08 pm by Torchwood » Logged

Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #1 on: May 10, 2008, 03:34:44 pm »

Before starting any modelling you always need a good reference image.  For the 'sedan chair' project, I need to model the sedan chair and a human 'slave' carrier.  Here is a good image of a slave, a good image showing typical human proportions and the sedan chair itself:







Before I start modelling I need to consider roughly what clothing I want the finished model to be wearing, and what impact this will have on the actual modelling process.  For instance, if I was modelling a lady wearing a long dress, then I wouldn't need to model the legs - only the dress, ankles and feet.  With the slave, all I need to consider is the loin wrap clothing, which means the rest of the model can conform quite closely to the human proportions image.

This tutorial will not give too many details on which key presses to make in Blender - for that there are plenty of good tutorials available on the web, especially this one.  Instead, this tutorial aims to show how Blender is used to create a mob for Daimonin.  Due to the small image size, we can be quite rough with some details that would normally require more time and effort.

Also, this isn't so much of a tutorial, but more of a mini-blog I wrote during the modelling process - so sometimes it may not be too logically presented!!!

Now, on to the actual tutorial itself ...

===== Initial Mesh Modelling =====

(1)  Set some preliminary stuff up - CatRom filter and oversample level to 5 in Render settings (F10).  Set the sky background colour (F5, then World) to black (helps with anti-aliasing around the edges of the model).

(2)  Split the main 3D window in half so we can have front and side views, and set the background image in both windows to use the human proporations image.  Move the background image in each view so the front and side parts of the human proportions line up with the default cube in the scene.  Set the blend value for each background image to 0.75 so it is mostly transparent - so the mesh can be seen more clearly in front of it.  For now, move the default camera and light source to layer 2 so they are out of the way.  Set each window to wireframe mode.



(3)  Select default cube in object mode, Alt-R to remove any rotation.  Go into edit mode and from the front view delete the 4 vertices on the left.  Add a mirror modifier (X, Do clipping).  Note:  From this point, I will only refer to 'real' vertices (there are 4 left at this point) - the other vertices are the mirrored vertices.  Select all remaining 4 vertices and extrude a region back to the centre line of the mesh.  We now have our cube back again - but with the mirror modifier in place.

(4)  Select all vertices and move them up in z so the top face of the cube lines up with armpits (and luckily the bottom face lines up with the groin area).  Extrude the top face of the cube to line up with the base of the neck.  Extrude further faces to continue to build a 'box model' of the human.  I did 3 extrudes for the arm to represent upper arm, lower arm and hand (Note:  I'm modelling these straight out to the sides even though the reference image shows the arms down by the sides of the torso).  I did an extrude for the neck and one for the head.

(5)  Turn off 'do clipping' on the mirror modifier and extrude the bottom face of the original cube down to the knee line.  Now grab the new faces and move them away from the centre line of the mesh.  Turn 'do clipping' back on.

(screen shot also shows buttons panel for setting sky to black!)



(6)  Extrude the knee down to ankle level and then a final extrude to floor/foot level.  Extrude the front face of the foot forward (in the side view) to make the foot.  Now add a subsurf modifier (level 1).  For now, leave it switched off in edit mode (we are still doing basic forming operations - later on we will switch the modifier on and off repeatedly when fine tuning the final shape of the mesh).

Note:  This type of modelling is called box modelling, for obvious reasons!  I've read that faces with 4 sides/vertices are better to work with compared with triangles ... and box modelling naturally leads to lots ot quad faces!

(7)  Select all 4 vertices at the knee joint and scale in x to get a better width for the knee.  Repeat this step for each joint, and then grab individual vertices or groups of vertices and move them around until you have a better shape for the mesh.  The waist needs more shape, so loop cut and then adjust vertex positions.



(Cool  Turn on the subsurf modifier and spin the model round - its starting to have the basic shape required, although lots more adjustment to go yet.  I've realised that I left some internal faces on the centre line of the mesh during my initial mirror and extrude operations - these need to be deleted.



(9)  Now is a good time to save your blend file (make sure to use a name like xxx_01.blend - then when saving in the future you can press the + key and Blender will automatically increment the filename to xxx_02.blend - which is useful if you want to go back to a previous level file).

In the past, I've always added far too much detail to my models, but I've learned over time that this level of detail just isn't justified as it is not visible in the final images.  Its also no good from a 3D client perspective, where we want to keep the number of individual faces on a model as low as possible.

For instance, my 'guard3' model has over 3,300 faces which is ridiculous.  My most recent model, lizardman, has only 680 faces - a much more reasonable figure, although still probably too high for the 3D client.

A key approach to keeping the mesh simple is to concentrate only on the overall form or shape of the mesh.  We will be texturing the final mesh using UV Mapping (where the mesh is "unwrapped" onto a flat sheet of paper and then a suitable image used to provide all the surface colouring on the mesh).  We can therefore add many details into the Uv image (like shading under the chest muscles), meaning we don't have to add these details onto the base mesh itself.

And so, back to the tutorial ...

(10) We need to add more definition to the major limb muscles, so loop cut the thigh, calf, bicep and forearm and scale these new loops up a bit.  I also keep grabbing various other vertices and adjusting their position, slowly improving the shape of the model.  I'm working with the subsurf modifier switched at this point ... if you switch it off you'll see the base mesh is becoming quite exaggerated.

(11) Next step is to look at the feet - they are too rounded at the moment.  Adjust some vertex positions, and then crease (shift-e) some of the edges to make them sharper (or less affected by the subsurf modifier), especially the edges around the base of the foot - giving them a good crease makes the bottom of the foot flat.  I want the feet to be wider than the ankle so I add a loop cut just above the ankle vertices - I can now widen the feet without also widening the bottom of the calf.  Overall, I've probably spent too much time on the foot - some of those creases won't really have an effect on the final 2D images, but it makes me feel better, and I only added a few vertices to the mesh!



(12) Make a pair of loop cuts just above and below the knee.  Then scale the knee up slightly to give some definition to the joint.  This won't do much for the final image, but these loop cuts are important to control the deformation of the mesh when the knee is bent.  If these loop cuts are not added, the subsurf modifier will try to smooth out the vertices of the upper and lower leg which is not wanted.  We will make similar loop cuts around the shoulder, elbow and wrist joints (not needed at the hip as we won't be making large movements at that joint).

(13) Moving up the model to the waist, the model currently shows the legs coming together and forming a v-section in the groin area - but I want a loin cloth - which means a square section.  This step is easier with sub-surf turned off.  I loop cut the thigh at about the level where I estimate the bottom of the loin cloth to be.  Select the pair of new vertices on the inside leg and extrude them in X towards the centre line of the model.  With the mirror modifier 'do clipping' option switched on the mirrored vertices will snap together.  Next I make a triangular pair of faces (front and rear of model).  Final job is to delete the faces on the inside of the thigh that are now internal to the mesh (see selected faces below).



(14) Switch subsurf back on, and sharpen the bottom edge of the loin cloth on all edges except the outside of the thighs.

(15) Next, we move up to the arms.  Add a loop cut for the shoulder, two for the elbow and one for the wrist.  I spent some time adjusting vertex positions on the arm (with subsurf on) to get the right sort of shape, including bulges in muscles.  Some of the proportions are not quite right on the overall figure at this point, but we'll adjust that later once we have all the vertices created and we've done some test rendering.  The proportions of the final model will need to be somewhat distorted to get a good result (e.g. shorter legs, narrow hips, wider waist and chest).



(16) Time to look at the hands.  No point in modelling the fingers as separate, and even the thumb is questionable, but I normally put it in.  I will do a simple model showing the hand as it would grip a baseball bat handle.  Turn off subsurf just while we create the required vertices.  Select the bottom face of the hand and move the vertices up in Z to make the hand thinner.  Loop cut the hand to suggest a knuckle joint, then loop cut the palm of the hand again.  Select the bottom edges of the hand and subdivide them to form two faces.  The subdivision will create 2 sets of 3 triangular faces - join two pairs back together (Alt-J) to reduce the number of faces.  The selected face shown below will be extruded to form the thumb.



(17) Extrude the selected face, rotate the face and extrude/rotate once more to form a crude thumb.  Now switch subsurf back on and adjust vertex positions appropriately.  Here is a view from the underside/rear of the model.  It is crude but even so, this level of detail won't show up that much in the final game-size rendered images.



(18) On to the head.  From a distance, a head is just a ball!  All the details (face, hair, ears) will be created using our UV texture image, so all we really need to worry about is to get the proportions correct and to define the chin/throat/neck area better.  Make one horizontal loop cut at chin height and ajust vertex positions to get something like this (its rough in shape but this shouldn't matter too much):



(19) Final step is some proportion adjustments.  I selected all the vertices from shoulder to hand and moved them out in x.  I selected all vertices below the waist and scaled them slightly smaller in z and then moved them up in z to make the legs shorter.  Final result (for now), only 120 faces:


« Last Edit: May 10, 2008, 03:47:09 pm by Torchwood » Logged

Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #2 on: May 10, 2008, 03:36:29 pm »

===== Rigging the Model =====

Next step is to add the rig we will use to pose the model and check we can get good deformations, especially around the joints.  Note:  I will present here a fairly simple rig without any advanced features - it will still work though.

(20) Tab out of edit mode, and remove the background reference images in each 3D window as we don't need them any more.  Switch one view to front view.  Select the mesh and then snap the cursor to selection to put the 3D cursor in the centre of the mesh object.  Now add an armature object (space / Add / Armature).  The armature root bone will be added and Blender will change automatically to edit mode.  Tab back to object mode and clear any rotation (alt-R) of the armature object (this is important).

(21) Tab back to edit mode, change the armature display mode to x-ray and x-axis mirror, grab the single bone and move and rotate as shown below.  Name this bone COG (centre of gravity).  This will be the root bone that all other bones are connected to (directly or indirectly).  From the tip of the COG bone, extrude two spine bones, a neck bone and a head bone.  Name these bones.



(22) Switch to front view and select the tip of the upper spine bone.  Symmetrically extrude (shift-e) two bones that go to the shoulder joint (note the low position of the ends of these shoulder bones).  Select the tip of one of these bones and extrude a bicep, forearm and hand bone (notice the opposite arm bones are automatically created).  Name these bones Shoulder_L, Bicep_L, etc. and name the opposite bones with a _R suffix (doing this ensures the bones are recognised as a pair - changing position and scale of a bone on one side in edit mode will automatically do the same to the opposite side).  Switch to top view and make sure the arm and shoulder bones lie inside the centre of the arm (the shoulder joint should be biased towards the front of the chest).



(23) In front view, select the tip of the COG bone and symetrically extrude 2 hip bones.  Then, as with the arm, extrude a thigh, calf, foot, and in this case, a toe bone.  Name both _L and _R bones as before.  Notice that I have made sure there is a natural bend in the knee bone (I also put a similar bend in the elbow).  This will help Blender decide which way to bend the knee when posing the model.



(24) Now we are going to add some control bones that will not directly deform the mesh geometry, but instead will help to control the rotation of the leg and arm bones that DO deform mesh geometry.

From the tip of the calf bone extrude a bone and call it LegIK_L.  Unconnect this bone from the calf bone and connect it to COG.  Repeat with the right leg.



(25) Now repeat the procedure with the arm, creating ArmIK_L.  Repeat with the right arm.



(26) The final step in edit mode on the armature is to organise our bones onto appropriate layers.  I tend to use bone layer 1 for control bones, layer 3 for deform bones and layer 2 for other bones.  A bone can exist on more than one layer, and more than one layer can be displayed at a time.  Organise the bones as follows:

COG, LegIK, ArmIK - deform off, layer 1
Hip - deform off, layer 2
Toe, foot, thigh, bicep, hand, neck, head - deform on, layers 1 and 3
All other bones - deform on, layer 3
Logged

Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #3 on: May 10, 2008, 03:37:19 pm »

===== Applying Rig Constraints =====

(27) Now we need to add some constraints to control how the separate layer 1 bones can be used to pose the whole rig.  Tab to object mode then change to pose mode.  Add an IK constraint to Calf_L, make sure UseTip is selected and set Chain length to 2.  In the target object type "Armature" (which is the name of the current armature object), and then in the bone field, type LegIK_L.  Grab the LegIK_L bone and move it around and verify the thigh and calf bones move appropriately, but the hip bone stays still.  The knee can be positioned by rotating the thigh bone.



(28) Repeat with the right leg and test.  Reset the position of LegIK control bones using alt-g.

(29) Now repeat with the arms.  Add IK constraints to the forearm bones and target them to the ArmIK bones, and test.  Elbow position can be controlled by rotating the bicep.



(30) Ooops - forgot a bone!  Go back into edit mode and from the tip of the upper spine, extrude a bone backwards.  Name this SpineIK, set it to non-deform and layer 1.  Disconnect it from the upper spine and make it's parent COG.

(31) Back to pose mode ... give the UpperSpine bone an IK constraint, target it to the SpineIK bone, chain length 2.

(32) I would like to use the SpineIK to control shoulder rotation.  First, add a LimitRotation constraint to SpineIK, and click the local and LimitX and LimitY buttons.  Next, add a CopyRotation constraint to Shoulder_L, set the target to SpineIK and click the local button.  Deselect X and Y to leave only Z.  Repeat for the opposite shoulder.

Now, moving the SpineIK bone allows the back to be posed, and rotating the SpineIK bone allows both shoulders to be posed.


Logged

Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #4 on: May 10, 2008, 03:37:54 pm »

===== Attaching the Mesh to the Rig =====

Next, we need to attach the mesh object to the armature, and indicate which sections of the mesh are deformed by which bones.

(33) With the armature still selected, change the draw mode to 'stick'.  Then select the mesh object, and add an Armature modifier.  Type "Armature" into the object field and deselect envelopes.

(34) Now change to Weight Paint mode.  Change the paint weight and opacity to 1.  Click on the head bone, and then paint all the vertices in the head - they turn red when painted.  Click the head bone again and rotate it - you should see the head deform.



(35) Repeat for the other bones on layer 3 on the left side of the model only.  The mirror modifier is still active and this can mess things up a bit.  We will remove this modifier later and come back to weight painting the RHS of the model.

The arm and leg bones are tricky.  For example, the vertices that form the central elbow ring must be assigned to the forearm and the bicep.  The 2 additional edge loops we added in step 15 must only be assigned to either the bicep or the forearm as appropriate - not both.  Apply similar logic for all the other layer 3 bones on the left side of the rig.

In this screen shot I have moved the ArmIK_L bone.  Two things are apparent - (1) I have missed a vertex from somewhere in the hand area during weight painting and (2) you can see effect of the mirror modifier in action - when weight painting vertices on the left side of the model to the left side bones, vertices on the right side have been automatically selected and assigned at the same time.

Don't worry!  We will fix this later, after we have finished the UV mapping stage of the project!



(36) Continue to assign left-side vertices to left-side bones.  Check what happens when you pose the bones - e.g. bend the wrist, elbow, shoulder, knee, hip, ankle, neck, etc - is the mesh deformation acceptable/realistic at the joints?  You can assign the same vertex to more than one bone, or if necessary add additional loop cuts.

Note:  I realised I missed out a pair of loop cuts from the foot area that allows the toes to bend up, so I added these in and then weight-painted the foot and toe bones.  I also found that I needed an additional edge loop between the waist and the bottom of the loin cloth to improve deformation in that area when the thighs were brought right up (e.g. for sitting on a chair).

In some areas, e.g. the ankle there are still some minor deformation problems, but these won't be visible in the final render.

The final test is to grab the COG bone and move it - the entire mesh should now move and no vertices should be left behind.
Logged

Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #5 on: May 10, 2008, 03:38:39 pm »

===== Texturing =====

The final major step is to add some colouration to the model, and to do this we need to 'unwrap' all the faces of the mesh onto a flat sheet of paper.  This is called UV wrapping.  Typically 3D objects cannot be simply unwrapped (think of a cube).  Instead we must provide some assistance by specifying which edges are to act as 'seams'.

Deciding which edges of the mesh to be marked as seams is a matter of trial and error - I had several goes at it with this model before settling on a final design.  I'm not an expert in this area at all (still learning!), but it seems to me that the fewer seams you have the more your mesh will be distorted when it is mapped to UV - especially in areas like the arm, where a complete section of the mesh 'branches out' from the main part of the mesh.  We have a second similar situation where the thumb branches out from the hand.

One problem with seams is that it becomes very hard to match the final texture across them, so we should only add seams in areas that are hard to see, or where there is a natural break in the texture anyway (e.g. at the bottom edge of the loin cloth where it meets the legs), or on the inside/lower seam of the leg/arm.

Remember - as we still have the mirror modifier switched on we only need to unwrap one half of the model.  We will get a mirror image of the textures, but for this model that is fine.

(37) With the armature selected and in pose mode, select all bones (a key) and reset rotation (alt-r) and position (alt-g).  Select the mesh and go into edit mode again.  Switch to line select mode and mark the edges seen in the following images as seams (ctrl-e, 1).

Armpit, front of arm:


Rear of arm, top of shoulder, base of neck:


Hand, thumb detail:


Base of loin cloth, top of feet (front):


Base of loin cloth, top of feet, leg (rear):


Sole of foot:


(38) Now switch to UVFace Select mode.  Make sure you have two main viewports and change the one of them to the UV/Image Editor mode.  Select all the faces of the mesh (a key) and press U for unwrap.  Click reset (or 7 key), then U again, then Unwrap (or 1 key).  You should get this result:



If you are not happy with this mesh you can play with it by tabbing back to edit mode, seaming or unseaming edges, tabbing back to UVFace Select mode, select all faces, reset, unwrap as above.

Next, I want to adjust some of the vertex locations on the UV map.  You can grab (g), rotate (r), box select (b), etc. vertices in the UV map just as you can in the 3D mesh.  Select a vertex then press L to select all vertices 'attached' to that vertex.

(39) In the UV/Image Editor window, I rearranged the various chunks of the UV map so the arm and leg were the right way round (hand pointing up, foot pointing down), placed the thumb near the hand and the foot below the body.

I dragged some of the vertices of the elbow and knee to give a 'straighter' seam to the arm and leg (not too important that our skin image won't map to edge to edge very well - it won't be seen in the final image).

I did the most work on the body and head.  I made sure the two faces representing the real face of the figure were relatively square (rest of the head doesn't matter too much as that will just be skin or hair).  I also squared off the edges of the body - this makes it easier when adding clothing such as a leather jerkin or some armour, as source images are usually 'square' as well.  I used the align (w key) tool on selected vertices to get good straight edges.



(40) Click on the UVs menu, and click Scripts, then Save UV Face Layout.  Set the image size to 1024 and save the file somewhere.  Then open this in your favourite photo image editor (I use GIMP).

This tutorial won't cover how to use GIMP, but my basic routine is:

(a) Add alpha channel to your UV map and delete all the 'white' to leave just the grid.
(b) Make this your top layer - switch it on and off as you are painting your images on layers below it so you can see where you are supposed to paint (e.g. where exactly is the face of the model).
(c) Add separate layers for each texture on the model (e.g. I will probably have a skin layer, a face layer, loin cloth, sole of foot)
(d) Save the final texture image (with UV map layer turned off!) as PNG
(e) Check how it looks in Blender, and adjust and readjust until you are happy!

Here is a screen shot of what I came up with after about 10 minutes work.  Its very crude and rough in places, but that shouldn't matter too much - as I've said already, you won't see a lot of the detail, and it is easy to adjust later as we get closer to a final render.


Logged

Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #6 on: May 10, 2008, 03:39:11 pm »

===== Final Texture and Rigging Work =====

(41) Back to Blender ... In the UV/Image Editor view click Image, then Open, then browse to your texture image.png file you exported from GIMP.  Tab to object mode and switch the 3D view to textured.  It looks pretty bad!  But we can see the areas of the texture image that might need some more work.  The face has become a bit distorted vertically, so the thing to do is to adjust the faces on the UV layout as we did in step 39.  Save the UV layout again and reimport to Blender (replacing the original UVMap layer).  Its good to do this sort of work now before we put a serious amount of effort into the texture image.

(42) However, to really see what work we need to do to the texture image we need to do a test render from Blender.  Split the lower buttons window, and change the new window to Text Editor .  Then load the Daimex python script (you need to have Python installed on your computer for the Daimex script to work!)  There are many parameters that can be adjusted, but for now just set the file name, set orframes=True and framestart=frameend=1.



(43) If you try to render now everything will come out white.  We need to add a material to our mesh and tell that material to use the texture image we added in the UV mapping phase.  Select the mesh object, press F5 to get to the material settings and in the materials panel press TexFace.  I also set the specularity colour and mirror colour to black otherwise you get nasty reflections from faces that point to the camera - not what we want in our Daimonin images.  Switch to edit mode, select all faces, press F9 and then in the "link and materials" panel press assign to make sure all faces are using our TexFace material.



(44) If we run the Daimex script now we should see our mesh properly textured - but its far too big.  Tab to object mode, select the mesh AND the armature (or press a key to select all objects) and then press s key to scale them.  Then press g key to move the models onto the floor (in my case, the floor lined up with the waist of the human mesh, so I had to move everything up.  Here is my first result (I've just used a GIMP script I developed to 'tile' the separate images together into a single image):



You can now, finally, see exactly what detail is visible and what is not.  The face is completely non-visible so I'm not going to spend any more time on that in GIMP.  The top of the loin cloth definitely needs sharpening up but the rest of the texturing looks fine (nice tanned skin colour I think).  As to the mesh itself, I think the waist is too narrow and the arms need to have more muscles (after all, this guy carries a sedan chair around all the time)!  These kind of mesh changes do not really need any adjustments on the UV map side of things.

(Make sure you continue to save your Blend file regularly.  When you reach each significant stage, make sure to create a new Blend file so you have a good set of backup files.)

The next step is to remove the mirror modifier and fix the weight painting problems we found earlier.

(45) Select the mesh object, and in the mirror modifier, click Apply.  You will notice the number of faces has now doubled (you can see this when in face select mode, at the top right of the Blender window) (total number of faces is now 266).  This step cannot be undone, and if you decide you want to modify the mesh further, you need to remember to modify both sides of the mesh!  This is why we left the modifier on for so long - we know the texture image is OK and the deformation from the rig is fine - so we shouldn't need to do any major changes to the mesh, anything more than tweaking a few vertex positions.

(46) Go back to steps 35 and 36 and fix the weight painting so that vertices on the RHS of the model are (only) assigned to bones on the RHS.  You need to do 2 things - select the left bone and deselect the vertices on the right side, then select the right bone and reselect the vertices on the right side.  Test regularly!  Once you are finished you should be able to pose the mesh how you want!

(In this image we can see a problem where the loin cloth seems to disappear at high thigh rotations - but this probably won't be an issue as when animating we won't want to move the leg to this extreme position ... I've found a walking animation looks better than a running animation)


« Last Edit: May 11, 2008, 06:46:43 am by Torchwood » Logged

Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #7 on: May 10, 2008, 03:40:31 pm »

===== Creating the Animation =====

(47) Change the UV/Image Editor window to an action editor window.  Now select the armature and make sure you are in Pose Mode.  Select all the bones with the a key, and reset rotation (alt-r), position (alt-g) and scale (alt-s) for all the bones.  Deselect all bones (a key).  Now set only bone layer 1 as visible - remember these are our control bones and we don't need to work with or view the other bones any more.

(48) Select all the visible bones (a key) Press the i key with the mouse in the 3D window, and select LocRotScale.  For each of the control bones, a vertex is created at frame 1 in the action editor window.  Note you can zoom in on the action editor and move around using middle mouse button, just as you can in the 3D window.  You can also grab (g), box select (b), duplicate (shift-d) these vertices as you can with other objects in Blender.  For this screen shot, I zoomed right in so I can see the individual frame numbers at the bottom of the window, and I can also see frame 1.



I tend to create 4-frame animations (decent walk animations are tough to do with an odd number of frames when dealing with a symmetrical 2-legged creature) for each action (resting, running, walking, attacking), and prior to each set of 4 frames I use a 'home position' frame and I also leave an empty frame at the end of the set of 4.  In this tutorial I'm going to create only the walking animation.  The home position will be frame 7, animation frames 8-11, empty frame 12.

(49) Use the right cursor key (or click in the action editor window) to move the green line representing the current frame to frame 7.  Box select all the vertices in frame 1 and duplicate them (shift-d).  Move the mouse and drop them near frame 7.  Snap (shift-s) to nearest frame.



(50) Switch to side view in the 3D window.  Right cursor key to move the green line to frame 8.  Now start posing the left leg by grabbing LegIK_L and then rotating Thigh_L to correct the knee position.  For frame 8, I am aiming to have the right foot in its rest position: the character is standing on the right leg whilst bringing the left leg forward to take the next step.  Once you are happy with your leg and foot position, press i and select LocRotScale.  Select all the right leg control bones (thigh, legIK, foot, toe) and press i/LocRotScale.



(51) Now move to frame 10.  This will be the same pose as frame 8, but with the leg positions reversed.  Select all the left leg bones and reset location and rotation and press i and LocRotScale to insert new key frame vertices for those bones.  Now pose the right leg in a similar fashion to the left leg was in frame 8.  Insert key frame vertices for the left leg.

(52) Now we will pose the legs for frames 9 and 11.  In these frames one leg is out in front of the model about to be placed on the floor, and the other leg is out behind, about to be lifted up off the floor.  Use the same techniques as above to pose the legs.  I found that for these frames, with the legs bent, I needed to move the COG bone down to stop the feet from looking to far above the floor.  I duplicated the key frame vertex for the COG bone to make sure it had the same position in frames 9 and 11.  I duplicated the rest postion for the COG bone for frames 8 and 10.

(53) Last step is to animate the top half of the body.  I grabbed ShoulderIK, moved to frame 8 and then moved the bone forward (you tend to lean forward slightly when walking).  In top view I rotated ShoulderIK on frames 9 and 11 to show the shoulders rotating when the legs are extended (only small rotations/amounts are needed!).  Finally, I moved the hands to appropriate positions for each frame and gave the head a slight amount of movement.  Remember - the shoulders and arms go in opposite time to the legs ... you'll find yourself getting up and walking around to see how your own body works when doing this animation stuff!!! Cheesy

You can see in this screen shot I have inserted key frame vertices for every bone for each of the 4 animations, even if that bone isn't moved at all (just my habbit!) (hands and neck have not been moved - the pink bars represent constant position).



(54) Final step - set the Daimex to have startframe=8 and endframe=11, and run the script to export the images.  I then use my GIMP script to crop the top and right sides and tile them together.  The GIMP script can also be used to add a shadow.  Only job now is to post on the forums and take people's feedback to adjust the model!!!

(Oh, and go back and do the idle and attacking animations as well!!!)


« Last Edit: May 10, 2008, 03:42:17 pm by Torchwood » Logged

Unislash
Administrator
*
*
*
*
*


Karma: +24/-4
Posts: 2309



View Profile
« Reply #8 on: May 10, 2008, 08:38:23 pm »

Wow! That's gold.

10/10

Cheers,
Unislash

PS: Explain what clipping does, and maybe put in a pic of your lower buttons panel when you're setting the materials Smiley. Absolutely excellent pictures through your texturing post!

PPS: Few words meant to mean a lot of praise Wink
Logged

Forum Admin/Mapmaker
LordGrunt
Administrator
*
*


Karma: +7/-1
Posts: 289



View Profile
« Reply #9 on: May 11, 2008, 05:11:36 am »

i would love to see that gimp script to make shadow... tried to do that in pov many times :/
Logged

CadaverForSale.com

Gadu-Gadu: 8194627
Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #10 on: May 11, 2008, 06:45:18 am »


@ Grunt - simple, its a built in script to GIMP (my script is just a batch script that does lots of things to lots of images (cropping, indexing, etc.).  The script is in:

Filters / Light and Shadow / Perspective ...

The settings I use are:

Angle 45 / Rel dist 3 / Rel length 0.3 / Blur 3 / Opacity 33%

@ Uni ... clipping ... no idea!  What's that then?  Cheesy

I did a google search for it and found something to do with a constraint that prevents the feet going through the floor when animating.  I don't use that constraint - as I only have 4 frames, and every frame is a key frame, I can place the foot to stop it going through the floor.

Ref material panel - I've updated the thread above at step 43 to add a picture.  Note:  You can do 1001 things with materials, but I've found that, for our small models, this isn't really needed when you use UV mapped textures.
Logged

LordGrunt
Administrator
*
*


Karma: +7/-1
Posts: 289



View Profile
« Reply #11 on: May 11, 2008, 08:28:25 am »

hmm, it works on low volume centrally placed objects, not for wider things:
Logged

CadaverForSale.com

Gadu-Gadu: 8194627
Unislash
Administrator
*
*
*
*
*


Karma: +24/-4
Posts: 2309



View Profile
« Reply #12 on: May 11, 2008, 09:39:59 am »

Lol, Torch, better search your own posts first Wink

Quote
With the mirror modifier 'do clipping' option switched on the mirrored vertices will snap together

And yes, you *can* do 1001 things with materials, but when i was a newbie (or, even when i wasn't a newbie) i still got very confused with the materials, as there are so many options that it is hard to even locate them at first.

Cheers,
Unislash
Logged

Forum Admin/Mapmaker
Anchakor
Multi-headed dragon
*


Karma: +13/-8
Posts: 656



View Profile
« Reply #13 on: May 11, 2008, 10:02:21 am »

Awesome tutorial!
*speechless*
Logged

- best system I've ever had pleasure with Smiley

Torchwood
MapMaster
*
*
*


Karma: +34/-5
Posts: 948



View Profile
« Reply #14 on: May 11, 2008, 01:24:43 pm »


Hehe ... got you Uni!

OK, imagine we only work in 2D for a minute ... and imagine a point at location (1, 3) ... or 1 unit to the right and 3 units up.  Apply a mirror modifier mirror about the y axis (or rather the vertical line going through x=0), and we get a second vertex created for us at (-1, 3).  As I move my vertex the mirrored vertex moves with it.

Now, if you drag the vertex towards and then past the mirror plane nasty things with your surfaces happen - so to stop this, 'do clipping' means that any vertex that gets very close to the mirror plane will 'snap' to the mirror plane and merge with its mirrored counterpart - so you end up with a single vertex instead of 2.

And materials still confuse me!  I've tried to do things with them to avoid having to do the UV mapping, but in the end I've decided to take the time to do the UV unwrapping!  Easier for me to see what is going on!  Even for this model, we only really have 3 colours on it, so I could have used materials ... but UV mapping is still easier.

This way, you only need to add 1 material to your mesh, and set the TexFace option ... much easier.
Logged

Pages: [1] Go Up Print 
Daimonin Forum  |  Contributions  |  Graphics (Moderators: Sherock, subaru)  |  Topic: Torchwood's Blender Tutorial (warning - picture heavy thread!) « previous next »
Jump to:  

Page created in 0.358 seconds with 20 queries.
Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Copyright 2008 Daimonin MMORPG  •  Terms of Service  •  XHTML  •  Daimonin sourceforge open source project