Difference between revisions of "User talk:Tehrasha"
m |
m |
||
Line 2: | Line 2: | ||
A Quick-n-Dirty Tutorial | A Quick-n-Dirty Tutorial | ||
− | Examples given in this tutorial were performed with Blender 2.56a, the Blender SMD Tools add-on written by Tom Edwards and should work with future releases of the Blender 2.5x series. Much of the basic modelling | + | Examples given in this tutorial were performed with Blender 2.56a, the [[Blender SMD Tools]] add-on written by Tom Edwards and should work with future releases of the Blender 2.5x series. Much of the basic modelling instruction also applies to older versions of Blender, but some of the menus have moved and keyboard shortcuts have changed. The SMD Tool will not work with older 2.4x series of Blender, and there is currently SMD export plugin which supports animation for that series. |
Examples of model exporting and compiling in Source will use Team Fortress 2 as the platform, however, it should work with any Source based game. (CS:S, GMod, DoD, HL2, L4D, etc..) | Examples of model exporting and compiling in Source will use Team Fortress 2 as the platform, however, it should work with any Source based game. (CS:S, GMod, DoD, HL2, L4D, etc..) | ||
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. | 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. | ||
+ | |||
+ | {{toc-right}} | ||
== Software Requirements == | == Software Requirements == | ||
Line 18: | Line 20: | ||
[http://www.contexteditor.org/ {ConText}] An enhanced text editor for the editing and running QC files to compile models. | [http://www.contexteditor.org/ {ConText}] An enhanced text editor for the editing and running QC files to compile models. | ||
− | |||
=== Optional Software === | === Optional Software === | ||
Line 125: | Line 126: | ||
export UV Layout as a 512x512 tut_uv.png | export UV Layout as a 512x512 tut_uv.png | ||
− | {{note | For purposes of this tutorial, the UV map we have just exported will be used as the texture. | + | {{note | For purposes of this tutorial, the UV map we have just exported will be used as the texture. It is not very much to look at, but full texturing, Ambient Occlusion, Normal maps, etc.. are better handled in their own tutorials.}} |
add material | add material | ||
Line 149: | Line 150: | ||
{{key|Z}} wireframe mode (easier to position bones) | {{key|Z}} wireframe mode (easier to position bones) | ||
− | {{key|RMB}} | + | {{key|RMB}} Right click on the top end of 'Armature Bone' to select it |
− | {{key|E}}, {{key|Z}}, {{key|1}}, {{key|ENTER}} extrude new bone 'Armature Bone.000' | + | {{key|E}}, {{key|Z}}, {{key|1}}, {{key|ENTER}} This will extrude a new bone 'Armature Bone.000' |
Deselect the 'Connected' checkbox to disconnect from its parent | Deselect the 'Connected' checkbox to disconnect from its parent | ||
− | {{key|G}}, {{key|Y}} | + | {{key|G}}, {{key|Y}}, {{key|LMB}} Grab and center the bone over the big gear. This will its axis of rotation. Click to release the grab and accept its current location |
− | {{key|G}}, {{key|Z}}, {{key|-}}, {{key|1}}, {{key|ENTER}} | + | {{key|G}}, {{key|Z}}, {{key|-}}, {{key|1}}, {{key|ENTER}} This will embed the bone into the gear (not necessary but cleaner) |
− | {{key|RMB}} | + | {{key|RMB}} Right click on the original 'Armature Bone' to select it |
− | {{key|E}}, {{key|Z}}, {{key|1}}, {{key|ENTER}} extrude new bone 'Armature Bone.001' | + | {{key|E}}, {{key|Z}}, {{key|1}}, {{key|ENTER}} This will extrude new bone 'Armature Bone.001' |
Deselect the 'Connected' checkbox to disconnect from its parent | Deselect the 'Connected' checkbox to disconnect from its parent | ||
− | {{key|G}}, {{key|Y}} | + | {{key|G}}, {{key|Y}}, {{key|LMB}} Grab and center the bone over the smaller gear. |
− | {{key|G}}, {{key|Z}}, {{key|-}}, {{key|1}}, {{key|ENTER}} | + | {{key|G}}, {{key|Z}}, {{key|-}}, {{key|1}}, {{key|ENTER}} Embed the bone into the gear (not necessary but ...) |
− | {{key|TAB}} object mode [[Image:blender_tut_object_mode.jpg]] | + | {{key|TAB}} Switch to object mode [[Image:blender_tut_object_mode.jpg]] |
− | {{key|RMB}} | + | {{key|RMB}} Right-click the mesh to select it |
− | {{key|SHIFT-RMB}} | + | {{key|SHIFT-RMB}} Shift-right-click the armature |
− | {{key|CTRL-P}} | + | {{key|CTRL-P}} Parent the mesh to the armature with empty groups |
− | {{key|TAB}} edit mode [[Image:blender_tut_edit_mode.jpg]] | + | {{key|TAB}} Switch back to edit mode [[Image:blender_tut_edit_mode.jpg]] |
− | {{key|RMB}}, {{key|CTRL-NUM+}} | + | {{key|RMB}}, {{key|CTRL-NUM+}}..etc.. Right click one face or edge in the large gear, and press {{key|CTRL-NUM+}} repeatedly until all of the large gear is selected. |
− | set vetex group as Bone.000 | + | Under Object Data, set the vetex group as Bone.000 and click Assign |
− | {{key|RMB}}, {{key|CTRL-NUM+}} | + | {{key|RMB}}, {{key|CTRL-NUM+}} Right click one face or edge in the small gear, and press {{key|CTRL-NUM+}} repeatedly until all of the small gear is selected. |
− | + | Set vetex group as Bone.001 and click Assign | |
'''SAVE FILE''' | '''SAVE FILE''' | ||
Line 193: | Line 194: | ||
{{key|TAB}} object mode [[Image:blender_tut_object_mode.jpg]] | {{key|TAB}} object mode [[Image:blender_tut_object_mode.jpg]] | ||
− | {{key|RMB}} select | + | {{key|RMB}} select '''bone.000''' |
{{key|R}}, {{key|Z}}, move mouse and only the large gear should spin in the z-axis, {{key|RMB}} to ignore changes | {{key|R}}, {{key|Z}}, move mouse and only the large gear should spin in the z-axis, {{key|RMB}} to ignore changes | ||
− | {{key|RMB}} select | + | {{key|RMB}} select '''bone.001''' |
{{key|R}}, {{key|Z}}, move mouse and only the small gear should spin in the z-axis, {{key|RMB}} to ignore changes | {{key|R}}, {{key|Z}}, move mouse and only the small gear should spin in the z-axis, {{key|RMB}} to ignore changes | ||
Line 206: | Line 207: | ||
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. | 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 | + | Change screen layout from Default to Animation. [[Image:blender_tut_animation_layout.jpg]] |
− | 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]] | + | {{key|RMB}} Right click on the Armature to select it. |
+ | |||
+ | {{key|TAB}} To get to Pose mode if not already there. [[Image:blender_tut_pose_mode.jpg]] | ||
+ | |||
+ | Set Active Keying to 'Rotation' [[Image:blender_tut_keyframe_rotation.jpg]] | ||
+ | |||
+ | === Large Gear Clockwise === | ||
+ | |||
+ | Set frame counter to Frame 1 | ||
+ | |||
+ | {{key|RMB}} Select '''bone.000''' | ||
+ | |||
+ | [[Image:blender_tut_set_keyframe.jpg]] Set a keyframe | ||
+ | |||
+ | Set Framecounter to Frame 91 (90 degrees +1) | ||
+ | |||
+ | {{key|R}}, {{key|Z}}, {{key|9}}, {{key|0}}, [[Image:blender_tut_set_keyframe.jpg]] Rotate +90 degrees on the Z-axis and set a ROT keyframe. | ||
+ | |||
+ | Set Framecounter to Frame 181 (180 degrees +1) | ||
+ | |||
+ | {{key|R}}, {{key|Z}}, {{key|9}}, {{key|0}}, [[Image:blender_tut_set_keyframe.jpg]] Rotate +90 degrees on the Z-axis and set a ROT keyframe. | ||
+ | |||
+ | Set Framecounter to Frame 271 (270 degrees +1) | ||
+ | |||
+ | {{key|R}}, {{key|Z}}, {{key|9}}, {{key|0}}, [[Image:blender_tut_set_keyframe.jpg]] Rotate +90 degrees on the Z-axis and set a ROT keyframe. | ||
+ | |||
+ | Set Framecounter to Frame 361 (360 degrees +1) | ||
+ | |||
+ | {{key|R}}, {{key|Z}}, {{key|9}}, {{key|0}}, [[Image:blender_tut_set_keyframe.jpg]] Rotate +90 degrees on the Z-axis and set a ROT keyframe. | ||
+ | |||
+ | === Small Gear Counterclockwise === | ||
+ | |||
+ | Set frame counter to Frame 1 | ||
− | + | {{key|RMB}} Select '''bone.001''' | |
− | |||
− | |||
− | + | [[Image:blender_tut_set_keyframe.jpg]] Set a keyframe | |
− | |||
− | |||
− | Frame | + | Set Framecounter to Frame 91 (90 degrees +1) |
− | + | ||
− | + | {{key|R}}, {{key|Z}}, {{key|-}}, {{key|9}}, {{key|0}}, [[Image:blender_tut_set_keyframe.jpg]] Rotate -90 degrees on the Z-axis and set a ROT keyframe. | |
− | Frame | + | Set Framecounter to Frame 181 (180 degrees +1) |
− | |||
− | |||
− | Frame | + | {{key|R}}, {{key|Z}}, {{key|-}}, {{key|9}}, {{key|0}}, [[Image:blender_tut_set_keyframe.jpg]] Rotate -90 degrees on the Z-axis and set a ROT keyframe. |
− | + | ||
− | + | Set Framecounter to Frame 271 (270 degrees +1) | |
+ | |||
+ | {{key|R}}, {{key|Z}}, {{key|-}}, {{key|9}}, {{key|0}}, [[Image:blender_tut_set_keyframe.jpg]] Rotate -90 degrees on the Z-axis and set a ROT keyframe. | ||
+ | |||
+ | Set Framecounter to Frame 361 (360 degrees +1) | ||
+ | |||
+ | {{key|R}}, {{key|Z}}, {{key|-}}, {{key|9}}, {{key|0}}, [[Image:blender_tut_set_keyframe.jpg]] Rotate -90 degrees on the Z-axis and set a ROT keyframe. | ||
'''SAVE FILE''' | '''SAVE FILE''' | ||
Line 250: | Line 283: | ||
'''SAVE FILE''' | '''SAVE FILE''' | ||
− | == | + | == Getting the Model into Source == |
+ | === Exporting === | ||
Object mode Make sure Blender is in Object mode. [[Image:blender_tut_object_mode.jpg]] | Object mode Make sure Blender is in Object mode. [[Image:blender_tut_object_mode.jpg]] | ||
RMB Right click on the mesh (the gears) | RMB Right click on the mesh (the gears) | ||
Line 258: | Line 292: | ||
Exit Blender | Exit Blender | ||
+ | {{note|These examples use a command line executing text editor, [http://www.contexteditor.org/ {ConText}], to compile QC files. This saves on lots of repetitive typing of long directory trees into a console command line. Interlopers has a well designed and easy to follow tutorial on the setting up ConText for compiling models via their QC file. See: External Links}} | ||
− | + | === QC, File Names, and File Locations === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Correct file paths and naming is probably the cause of the majority of failures in compiling QC files. | Correct file paths and naming is probably the cause of the majority of failures in compiling QC files. | ||
Line 279: | Line 308: | ||
SMD FILE | SMD FILE | ||
File Locations | File Locations | ||
+ | |||
+ | === Compiling and Viewing === | ||
Line 292: | Line 323: | ||
[http://www.interlopers.net/tutorials/24774 {Interlopers -- QC Compiling Tutorial using ConText}] | [http://www.interlopers.net/tutorials/24774 {Interlopers -- QC Compiling Tutorial using ConText}] | ||
− | + | --[[User:Tehrasha|Tehrasha]] 02:59, 5 February 2011 (UTC) | |
− | --[[User:Tehrasha|Tehrasha]] | ||
− |
Revision as of 18:59, 4 February 2011
Blender :: Animated Modelling for Source A Quick-n-Dirty Tutorial
Examples given in this tutorial were performed with Blender 2.56a, the Blender SMD Tools add-on written by Tom Edwards and should work with future releases of the Blender 2.5x series. Much of the basic modelling instruction also applies to older versions of Blender, but some of the menus have moved and keyboard shortcuts have changed. The SMD Tool will not work with older 2.4x series of Blender, and there is currently SMD export plugin which supports animation for that series.
Examples of model exporting and compiling in Source will use Team Fortress 2 as the platform, however, it should work with any Source based game. (CS:S, GMod, DoD, HL2, L4D, etc..)
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} Free, Open source 3D modelling program.
Blender SMD Tools An animation supporting addon for Blender to import and export SMD files.
{SourceSDK} Software Developers Kit for Valve's Source engine.
{VTF Edit} Handy editor for Valve's VTM and VTF files.
{ConText} An enhanced text editor for the editing and running QC files to compile models.
Optional Software
{GIMP} Open source image editor for texturing, not covered in this tutorial.
{GCFScape} For browsing and extracting models/textures/sounds from Valve's GCF files.
Key reference
Key | |
---|---|
![]() |
Left Mouse Button |
![]() |
Right Mouse Button |
9 | 9 on the main keyboard |
Num9 | 9 on the Number Pad |
Building the Basic Model
Tab ⇆ To select object mode if not already there.
Right-click on the starter cube to select it.
A, DEL, F Select the entire cube, and delete it.
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
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, extrude and scale x/y much smaller
E, G, Z, ., 5, ↵ Enter extrude and grab +z .5
E, S, SHIFT-Z, extrude scale x/y a bit smaller
ALT-M, A merge at center
SHIFT-RMB manually select alternate outside faces
E, S, SHIFT-Z, 1, ., 1, ↵ Enter extrude scale x/y 1.1
Select Individual Origins for center of scale/rotation
S, ., 5, ↵ Enter scale end faces
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
Object>Transform>Origin to 3DCursor
Object>Transform>Geometry to Origin
SAVE FILE as tut.blend
Unwrapping, UV Mapping, and Texturing
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
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

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
Rigging the Model
Cursor to origin NUM3 select view 3 Y/Z
ADD Armature> Single Bone This will create 'Armature Bone'
Z wireframe mode (easier to position bones)
Right click on the top end of 'Armature Bone' to select it
E, Z, 1, ↵ Enter This will extrude a new bone 'Armature Bone.000'
Deselect the 'Connected' checkbox to disconnect from its parent
G, Y, Grab and center the bone over the big gear. This will its axis of rotation. Click to release the grab and accept its current location
G, Z, -, 1, ↵ Enter This will embed the bone into the gear (not necessary but cleaner)
Right click on the original 'Armature Bone' to select it
E, Z, 1, ↵ Enter This will extrude new bone 'Armature Bone.001'
Deselect the 'Connected' checkbox to disconnect from its parent
G, Y, Grab and center the bone over the smaller gear.
G, Z, -, 1, ↵ Enter Embed the bone into the gear (not necessary but ...)
Right-click the mesh to select it
SHIFT-RMB Shift-right-click the armature
CTRL-P Parent the mesh to the armature with empty groups
Tab ⇆ Switch back to edit mode
, CTRL-NUM+..etc.. Right click one face or edge in the large gear, and press CTRL-NUM+ repeatedly until all of the large gear is selected.
Under Object Data, set the vetex group as Bone.000 and click Assign
, CTRL-NUM+ Right click one face or edge in the small gear, and press CTRL-NUM+ repeatedly until all of the small gear is selected.
Set vetex group as Bone.001 and click Assign
SAVE FILE
Lets check out our work...
select bone.000
R, Z, move mouse and only the large gear should spin in the z-axis, to ignore changes
select bone.001
R, Z, move mouse and only the small gear should spin in the z-axis, to ignore changes
Excellent!
Animating the Model
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.
Change screen layout from Default to Animation.
Right click on the Armature to select it.
Tab ⇆ To get to Pose mode if not already there.
Set Active Keying to 'Rotation'
Large Gear Clockwise
Set frame counter to Frame 1
Select bone.000
Set Framecounter to Frame 91 (90 degrees +1)
R, Z, 9, 0, Rotate +90 degrees on the Z-axis and set a ROT keyframe.
Set Framecounter to Frame 181 (180 degrees +1)
R, Z, 9, 0, Rotate +90 degrees on the Z-axis and set a ROT keyframe.
Set Framecounter to Frame 271 (270 degrees +1)
R, Z, 9, 0, Rotate +90 degrees on the Z-axis and set a ROT keyframe.
Set Framecounter to Frame 361 (360 degrees +1)
R, Z, 9, 0, Rotate +90 degrees on the Z-axis and set a ROT keyframe.
Small Gear Counterclockwise
Set frame counter to Frame 1
Select bone.001
Set Framecounter to Frame 91 (90 degrees +1)
R, Z, -, 9, 0, Rotate -90 degrees on the Z-axis and set a ROT keyframe.
Set Framecounter to Frame 181 (180 degrees +1)
R, Z, -, 9, 0, Rotate -90 degrees on the Z-axis and set a ROT keyframe.
Set Framecounter to Frame 271 (270 degrees +1)
R, Z, -, 9, 0, Rotate -90 degrees on the Z-axis and set a ROT keyframe.
Set Framecounter to Frame 361 (360 degrees +1)
R, Z, -, 9, 0, Rotate -90 degrees on the Z-axis and set a 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
Play animation. Cheer!
SAVE FILE
Getting the Model into Source
Exporting
Object mode Make sure Blender is in Object mode.
RMB Right click on the mesh (the gears)
SHIFT-RMB The shift-right-click on the Armature
File->Export->SMD->selected
Voom.
Exit Blender

QC, 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
Compiling and Viewing
See Also
- Blender
- Modelling props with Blender
- Blender Modelling Walkthrough
- Is Blender 3D Good for Source? - How to Start
- Model Creation Overview
External Links
{Interlopers -- QC Compiling Tutorial using ConText}
--Tehrasha 02:59, 5 February 2011 (UTC)