Difference between revisions of "User talk:Tehrasha"

From Valve Developer Community
Jump to: navigation, search
(temporary place to work on future tutorial)
 
(Update with some images)
Line 21: Line 21:
 
[http://www.gimp.org/ {GIMP}]  Free image editor for texturing, not covered in this tutorial.
 
[http://www.gimp.org/ {GIMP}]  Free image editor for texturing, not covered in this tutorial.
  
[http://nemesis.thewavelength.net/index.php?c=271 {GCFScape}]  For browsing and extracting models/textures/sounds from inside Valve's GCF files.
+
[http://nemesis.thewavelength.net/index.php?c=271 {GCFScape}]  For browsing and extracting models/textures/sounds from Valve's GCF files.
  
 +
== Keys reference ==
  
 +
{| {{standard-table}} style="width:17em;"
 +
! colspan=2 | Key
 +
|-
 +
| align=right | {{key|LMB}}
 +
| Left Mouse Button
 +
|-
 +
| align=right | {{key|MMB}}
 +
| Middle Mouse Button
 +
|-
 +
| align=right | {{key|RMB}}
 +
| Right Mouse Button
 +
|-
 +
| align=right | {{key|MW}}
 +
| Mouse Wheel
 +
|-
 +
| align=right | {{key|MWUp}}
 +
| Mouse Wheel Up
 +
|-
 +
| align=right | {{key|MWDown}}
 +
| Mouse Wheel Down
 +
|-
 +
| align=right | {{key|9}}
 +
| 9 on the main keyboard
 +
|-
 +
| align=right | {{key|Num9}}
 +
| 9 on the Number Pad
 +
|}
  
 
== Basic Model ==
 
== Basic Model ==
{{key|TAB}} (if not there)    object mode
 
  
{{key|RMB}}                   select starter cube
+
{{key|TAB}} To select object mode if not already there. [[Image:blender_tut_object_mode.jpg]]
  
{{key|TAB}}                   edit mode
+
{{key|RMB}} Right-click on the starter cube to select it.
  
{{key|DEL}}, {{key|F}}                delete starter cube
+
{{key|TAB}} Swtch to edit mode.  [[Image:blender_tut_edit_mode.jpg]]
  
ADD>Mesh>Cylinder, uncapped, 32 sides, size 4 depth 1
+
{{key|A}}, {{key|DEL}}, {{key|F}}  Select the entire cube, and delete it.
  
{{key|CTRL-TAB}}, {{key|E}}            edge select mode
+
[[Image:blender_tut_add_mesh_cylinder.jpg]]  [[Image:blender_tut_object_cylinder.jpg]]
  
{{key|CTRL-E}}, {{key|L}}              edge select loop of top ring
+
Add a new cylinder mesh to the project, and set its properties to 32 verticies, radius 4, depth 1, uncapped.
  
{{key|E}}, {{key|S}}, {{key|SHIFT-Z}}         extrude and scale x/y much smaller
+
{{key|CTRL-TAB}}, {{key|E}}           Select edge select mode  [[Image:blender_tut_edge_select.jpg]]
  
{{key|E}}, {{key|G}}, {{key|Z}}              extrude and grab +z .5
+
{{key|RMB}} Right-click on one of the edges of the top-most ring.
  
{{key|E}}, {{key|S}}, {{key|SHIFT-Z}}          extrude scale x/y a bit smaller
+
{{key|CTRL-E}}, {{key|L}}        Then use edge-loop to select all of the edges in the top ring.
 +
 
 +
{{key|E}}, {{key|S}}, {{key|SHIFT-Z}}, {{key|LMB}}          extrude and scale x/y much smaller
 +
 
 +
{{key|E}}, {{key|G}}, {{key|Z}}, {{key|.}}, {{key|5}}, {{key|ENTER}}              extrude and grab +z .5
 +
 
 +
{{key|E}}, {{key|S}}, {{key|SHIFT-Z}}, {{key|LMB}}          extrude scale x/y a bit smaller
  
 
{{key|ALT-M}}, {{key|A}}              merge at center
 
{{key|ALT-M}}, {{key|A}}              merge at center
  
{{key|CTRL-TAB}}, {{key|F}}            face select mode
+
{{key|CTRL-TAB}}, {{key|F}}            face select mode   [[Image:blender_tut_face_select.jpg]]
  
 
{{key|SHIFT-RMB}}              manually select alternate outside faces
 
{{key|SHIFT-RMB}}              manually select alternate outside faces
  
{{key|E}}, {{key|S}}, {{key|SHIFT-Z}} 1.1     extrude scale x/y 1.1
+
{{key|E}}, {{key|S}}, {{key|SHIFT-Z}}, {{key|1}}, {{key|.}}, {{key|1}}, {{key|ENTER}}      extrude scale x/y 1.1
  
effect individual origins
+
[[Image:blender_tut_individual_origins.jpg]]  Select Individual Origins for center of scale/rotation 
 
   
 
   
{{key|S}}, .5                  scale end faces
+
{{key|S}}, {{key|.}}, {{key|5}}, {{key|ENTER}}                 scale end faces
  
effect pivot center
+
[[Image:blender_tut_median_point.jpg]]  Select Median Point for center of scale/rotation 
 
   
 
   
{{key|A}}, {{key|G}}, {{key|Y}}, 10           select all, grab and move out of the way
+
{{key|A}}, {{key|G}}, {{key|Y}}, {{key|1}}, {{key|0}}, {{key|ENTER}}           select all, grab and move out of the way
  
  
Line 72: Line 105:
 
{{key|CTRL-N}}                recalculate normals
 
{{key|CTRL-N}}                recalculate normals
  
{{key|TAB}}                    object mode
+
{{key|TAB}}                    Select object mode [[Image:blender_tut_object_mode.jpg]]
  
 
Object>Transform>Origin to 3DCursor
 
Object>Transform>Origin to 3DCursor
Line 85: Line 118:
 
Open a new windoid and set it to display the UVImage Editor
 
Open a new windoid and set it to display the UVImage Editor
  
{{key|TAB}}                  edit mode
+
{{key|TAB}}                  Select edit mode [[Image:blender_tut_edit_mode.jpg]]
  
 
{{key|CTRL-TAB}}, {{key|E}}          edge select mode
 
{{key|CTRL-TAB}}, {{key|E}}          edge select mode
Line 115: Line 148:
  
 
== Boning Up ==
 
== Boning Up ==
{{key|TAB}}                      object mode
+
{{key|TAB}}                      object mode [[Image:blender_tut_object_mode.jpg]]
  
 
Cursor to origin
 
Cursor to origin
{{key|KPD3}}                      select view 3 Y/Z
+
{{key|NUM3}}                      select view 3 Y/Z
 
   
 
   
 
ADD Armature> Single Bone    This will create 'Armature Bone'
 
ADD Armature> Single Bone    This will create 'Armature Bone'
  
{{key|TAB}}                      edit mode
+
{{key|TAB}}                      edit mode [[Image:blender_tut_edit_mode.jpg]]
  
 
{{key|Z}}                        wireframe mode (easier to position bones)
 
{{key|Z}}                        wireframe mode (easier to position bones)
Line 128: Line 161:
 
{{key|RMB}}                      select top end of 'Armature Bone'
 
{{key|RMB}}                      select top end of 'Armature Bone'
  
{{key|E}}, {{key|Z}}, 1                    extrude new bone 'Armature Bone.000'
+
{{key|E}}, {{key|Z}}, {{key|1}}, {{key|ENTER}}                     extrude new bone 'Armature Bone.000'
  
 
Deselect the 'Connected' checkbox to disconnect from its parent
 
Deselect the 'Connected' checkbox to disconnect from its parent
Line 134: Line 167:
 
{{key|G}}, {{key|Y}}                      grab and center on big gear
 
{{key|G}}, {{key|Y}}                      grab and center on big gear
  
{{key|G}}, {{key|Z}}, -1                  embed bone into the gear (not necessary but clean)
+
{{key|G}}, {{key|Z}}, {{key|-}}, {{key|1}}, {{key|ENTER}}                 embed bone into the gear (not necessary but clean)
  
 
{{key|RMB}}                      select top end of original 'Armature Bone'
 
{{key|RMB}}                      select top end of original 'Armature Bone'
  
{{key|E}}, {{key|Z}}, 1                    extrude new bone 'Armature Bone.001'
+
{{key|E}}, {{key|Z}}, {{key|1}}, {{key|ENTER}}                     extrude new bone 'Armature Bone.001'
  
 
Deselect the 'Connected' checkbox to disconnect from its parent
 
Deselect the 'Connected' checkbox to disconnect from its parent
Line 144: Line 177:
 
{{key|G}}, {{key|Y}}                      grab and center on smaller gear
 
{{key|G}}, {{key|Y}}                      grab and center on smaller gear
  
{{key|G}}, {{key|Z}}, -1                  embed bone into the gear (not necessary but ...)
+
{{key|G}}, {{key|Z}}, {{key|-}}, {{key|1}}, {{key|ENTER}}                 embed bone into the gear (not necessary but ...)
  
{{key|TAB}}                      object mode
+
{{key|TAB}}                      object mode [[Image:blender_tut_object_mode.jpg]]
  
 
{{key|RMB}}                      select the mesh
 
{{key|RMB}}                      select the mesh
Line 154: Line 187:
 
{{key|CTRL-P}}                    parent the mesh to the armature with empty groups
 
{{key|CTRL-P}}                    parent the mesh to the armature with empty groups
  
{{key|TAB}}                      edit mode
+
{{key|TAB}}                      edit mode [[Image:blender_tut_edit_mode.jpg]]
  
{{key|RMB}}, {{key|CTRL-KPD+}}            select all of the faces in just the big gear
+
{{key|RMB}}, {{key|CTRL-NUM+}}            select all of the faces in just the big gear
  
 
set vetex group as Bone.000, assign
 
set vetex group as Bone.000, assign
 
   
 
   
{{key|RMB}}, {{key|CTRL-KPD+}}            select all of the faces in just the small gear
+
{{key|RMB}}, {{key|CTRL-NUM+}}            select all of the faces in just the small gear
  
 
set vetex group as Bone.001, assign
 
set vetex group as Bone.001, assign
Line 168: Line 201:
 
Lets check out our work...
 
Lets check out our work...
 
 
{{key|TAB}}                      object mode
+
{{key|TAB}}                      object mode [[Image:blender_tut_object_mode.jpg]]
  
 
{{key|RMB}}                      select Bone.000
 
{{key|RMB}}                      select Bone.000
Line 184: Line 217:
  
 
Animation Pane
 
Animation Pane
Pose mode
+
RMB  Right click on the Armature to select it.
 +
TAB  To get to Pose mode if not already there. [[Image:blender_tut_pose_mode.jpg]]
 +
 
 
Frame 1
 
Frame 1
 
select bone.001, set ROT keyframe, set interpolation to linear
 
select bone.001, set ROT keyframe, set interpolation to linear
Line 221: Line 256:
  
 
Return framecounter to 1
 
Return framecounter to 1
Object mode
+
Object mode [[Image:blender_tut_object_mode.jpg]]
 
Play animation.  Cheer!
 
Play animation.  Cheer!
 
'''SAVE FILE'''
 
'''SAVE FILE'''
  
 
== Export, QC, and Compile ==
 
== Export, QC, and Compile ==
Object mode
+
Object mode   Make sure Blender is in Object mode.  [[Image:blender_tut_object_mode.jpg]]
Select mesh
+
RMB  Right click on the mesh (the gears)
SHIFT-Select Armature
+
SHIFT-RMB  The shift-right-click on the Armature
 
File->Export->SMD->selected
 
File->Export->SMD->selected
 
Voom.  
 
Voom.  
Line 272: Line 307:
  
 
--[[User:Tehrasha|Tehrasha]] 10:12, 4 February 2011 (UTC)
 
--[[User:Tehrasha|Tehrasha]] 10:12, 4 February 2011 (UTC)
 +
--[[User:Tehrasha|Tehrasha]] 00:51, 5 February 2011 (UTC)

Revision as of 16:51, 4 February 2011

Blender :: Animated Modelling for Source A Quick-n-Dirty Tutorial

Examples given in this tutorial are based on Blender 2.56a, the Blender SMD Tools add-on and the exportation into Source for use in TeamFortress2.

This tutorial will not include detailed instruction on basic modelling and assumes that the user has at least a very basic knowledge of Blender and 3D modelling in general.

Software Requirements

{Blender 2.5} 3D Modelling program

Blender SMD Tools Addon for Blender to allow import and export of SMD files

{SourceSDK} Software Developers Kit for Valve's Source engine

{VTF Edit} Handy editor for Valve's VTM and VTF files

{ConText} For editing and running QC files to compile models


Optional Software

{GIMP} Free image editor for texturing, not covered in this tutorial.

{GCFScape} For browsing and extracting models/textures/sounds from Valve's GCF files.

Keys reference

Key
LMB Left Mouse Button
MMB Middle Mouse Button
RMB Right Mouse Button
MW Mouse Wheel
MWUp Mouse Wheel Up
MWDown Mouse Wheel Down
9 9 on the main keyboard
Num9 9 on the Number Pad

Basic Model

Tab To select object mode if not already there. Blender tut object mode.jpg

RMB Right-click on the starter cube to select it.

Tab Swtch to edit mode. Blender tut edit mode.jpg

A, DEL, F Select the entire cube, and delete it.

Blender tut add mesh cylinder.jpg Blender tut object cylinder.jpg

Add a new cylinder mesh to the project, and set its properties to 32 verticies, radius 4, depth 1, uncapped.

CTRL-TAB, E Select edge select mode Blender tut edge select.jpg

RMB Right-click on one of the edges of the top-most ring.

CTRL-E, L Then use edge-loop to select all of the edges in the top ring.

E, S, SHIFT-Z, LMB extrude and scale x/y much smaller

E, G, Z, ., 5, Enter extrude and grab +z .5

E, S, SHIFT-Z, LMB extrude scale x/y a bit smaller

ALT-M, A merge at center

CTRL-TAB, F face select mode Blender tut face select.jpg

SHIFT-RMB manually select alternate outside faces

E, S, SHIFT-Z, 1, ., 1, Enter extrude scale x/y 1.1

Blender tut individual origins.jpg Select Individual Origins for center of scale/rotation

S, ., 5, Enter scale end faces

Blender tut median point.jpg Select Median Point for center of scale/rotation

A, G, Y, 1, 0, Enter select all, grab and move out of the way


Repeat steps above with an uncapped cylinder of 16 sides, size 2, depth 1

select all of the large gear and position it so that the teeth barely mesh together.

A select all

CTRL-N recalculate normals

Tab Select object mode Blender tut object mode.jpg

Object>Transform>Origin to 3DCursor

Object>Transform>Geometry to Origin

SAVE FILE as tut.blend

Unwrap, UV Map, and Texture

Unwrapping can be a challenge. While you can select to have Blender automatically unwrap your model, Try to think how you would unfold the object if it were entirely made of folded paper.

Open a new windoid and set it to display the UVImage Editor

Tab Select edit mode Blender tut edit mode.jpg

CTRL-TAB, E edge select mode

SHIFT-RMB select edges

CTRL-E, A mark seams

U, U unwrap

If your layout looks like complete chaos, add/remove seems until you can easily identify the pieces. These gears, and most mechanical items with lots of flat planes, are not too difficult to unwrap. Organic items, such as heads or animals are considerably more difficult.

Use G grab, and S scale to reposition and resize the UV islands in the UVImage Editor for optimal use of texture space.

export UV Layout as a 512x512 tut_uv.png

Note.png Note:  For purposes of this tutorial, the UV map we have just exported will be used as the texture. Yes, it is very blah to look at, but texturing, Abient Occlusion, Normal maps, etc.. are better handled in their own tutorials.

add material name the material tut_uv (no need for filename extension) add texture Texture Type: Image of Movie Open the tut_uv.png that we just exported Mapping Coordinates: UV center scene in camera and F12 to RENDER for a look ESC to return 3D window SAVE FILE

Boning Up

Tab object mode Blender tut object mode.jpg

Cursor to origin NUM3 select view 3 Y/Z

ADD Armature> Single Bone This will create 'Armature Bone'

Tab edit mode Blender tut edit mode.jpg

Z wireframe mode (easier to position bones)

RMB select top end of 'Armature Bone'

E, Z, 1, Enter extrude new bone 'Armature Bone.000'

Deselect the 'Connected' checkbox to disconnect from its parent

G, Y grab and center on big gear

G, Z, -, 1, Enter embed bone into the gear (not necessary but clean)

RMB select top end of original 'Armature Bone'

E, Z, 1, Enter extrude new bone 'Armature Bone.001'

Deselect the 'Connected' checkbox to disconnect from its parent

G, Y grab and center on smaller gear

G, Z, -, 1, Enter embed bone into the gear (not necessary but ...)

Tab object mode Blender tut object mode.jpg

RMB select the mesh

SHIFT-RMB select the armature

CTRL-P parent the mesh to the armature with empty groups

Tab edit mode Blender tut edit mode.jpg

RMB, CTRL-NUM+ select all of the faces in just the big gear

set vetex group as Bone.000, assign

RMB, CTRL-NUM+ select all of the faces in just the small gear

set vetex group as Bone.001, assign

SAVE FILE

Lets check out our work...

Tab object mode Blender tut object mode.jpg

RMB select Bone.000

R, Z, move mouse and only the large gear should spin in the z-axis, RMB to ignore changes

RMB select Bone.001

R, Z, move mouse and only the small gear should spin in the z-axis, RMB to ignore changes

Excellent!

Time for Timing

The large gear is going to spin in the opposite direction and at 1/2 the speed of the smaller gear. For sake of ease and sanity with rotating objects, set the animation stop at frame 360.

Animation Pane RMB Right click on the Armature to select it. TAB To get to Pose mode if not already there. Blender tut pose mode.jpg

Frame 1 select bone.001, set ROT keyframe, set interpolation to linear select bone.002, set ROT keyframe, set interpolation to linear

Frame 91 (90 degrees +1) select bone.001, rotate +90z degrees, set ROT keyframe select bone.002, rotate -90z degrees, set ROT keyframe

Frame 181 (180 degrees +1) select bone.001, rotate +90z degrees, set ROT keyframe select bone.002, rotate -90z degrees, set ROT keyframe

Frame 271 (270 dergees +1) select bone.001, rotate +90z degrees, set ROT keyframe select bone.002, rotate -90z degrees, set ROT keyframe

Frame 361 (360 degrees +1) select bone.001, rotate +90z degrees, set ROT keyframe select bone.002, rotate -90z degrees, set ROT keyframe

SAVE FILE

But wait! The smaller gear should spin twice as fast!

Deselect Bone.001 Select Bone.002 Select one of its f-curves Select all CTRL-C to copy the keyframes move framecounter to 362 CTRL-V to paste in identical keyframes Select all Scale X by .5 Grab X and SHIFT -180

Return framecounter to 1 Object mode Blender tut object mode.jpg Play animation. Cheer! SAVE FILE

Export, QC, and Compile

Object mode Make sure Blender is in Object mode. Blender tut object mode.jpg RMB Right click on the mesh (the gears) SHIFT-RMB The shift-right-click on the Armature File->Export->SMD->selected Voom. Exit Blender


Personal Preference:::

I use a command line compiler rather than a point and clicky GUI interface. I use ConText, which is a text editor that can also run scripts. Interlopers has a wonderful tutorial on how to set it up for compiling QC files.


File Names, and File Locations:::

Correct file paths and naming is probably the cause of the majority of failures in compiling QC files.

Models :: Materials :: SMD ::

My model compiles, but the texture doesnt show up!? My model is invisible!?

Example:: QC FILE SMD FILE File Locations

If all of these are correct and you still have problems.... Have you ever considered knitting as a hobby?

Hope this helps.

See Also

External Links

{Interlopers -- QC Compiling Tutorial using ConText}

--Tehrasha 10:12, 4 February 2011 (UTC) --Tehrasha 00:51, 5 February 2011 (UTC)