Blender Source Tools Help

From Valve Developer Community
Revision as of 13:48, 1 August 2012 by Artfunkel (talk | contribs)
Jump to navigation Jump to search

Blender Models are imported and exported from Blender with the Blender SMD Tools. Any type of object with 2D surfaces can be exported. For details on creating animations for export, see Animation in Blender.

Importing

The "Import SMD/VTA, DMX, QC" operator is used to import models. You can find it:

  • By searching the Space menu (try "SMD")
  • Under File > Import

You can import a whole QC at once to save time.

Options

These can be set in the lower-left area when selecting a file.

Extend any existing model
Adds meshes and animations to the armature of the active object, or of the first object found in the scene if none are active. Otherwise a brand new armature is created. Ignored during QC import.
Import animations
SMD animations are very large. They take a lot of time to import and take up a lot of disc space. You can skip them when importing a QC by unchecking this box. Ignored during SMD import.
Up axis
Rotates everything so that it points upward in Blender if it didn't originally, and configures the Target Up Axis property of the current scene. Automatically set during QC import.
Make camera at $origin
Helpful when importing viewmodels. If this is not set, an (Icon) Empty is created instead.
Rotation mode
How keyframes are created. Euler is human-readable, Quaternion avoids Gimbal lock.

Exporting

The "Export SMD/VTA" operator is used to export models, animation and shape keys. You can find it:

  • By searching the Space menu (try "SMD")
  • Under File > Export
  • On the export configuration panel seen below

The SMD Tools are designed to make repeat exports as painless as possible. To that end, once you have set up an Export Folder (see below) objects/groups are exported there using their Blender names.

The export panel

Blender smd export prefs.png

The export configuration panel can be found under (Icon)+(Icon) Scene Properties. Due to the way Blender's addon system works it will start off at the bottom of the area, but you can drag it higher with the grip in the top right.

General

This area applies to all exports.

pyroMeshShape.smd (Export Current)
Exports the active object to <Output Folder>/<Object Subfolder>/<Object Name>. You will be prompted for an Output Folder if there isn't already one. This button's name and icon changes to reflect the current object.
Scene as configured
Exports everything selected for export in the big list further down the panel.
Output Folder
The root folder into which objects will be exported.
Tip.pngTip:If you start the path with //, it will be relative to the location of the .blend file.
Target Engine
The engine branch for which you are making a model. This will be used to select the correct version of studiomdl when compiling QCs.
Target Up Axis
Use for compatibility with existing models. You will want to set this if the QC you are compiling with uses $upaxis (e.g. the TF2 player models are all Y-up).

Scene Exports

This is where batch exports are configured.

  • All items in the list can be excluded from batch exports by clicking their names.
  • Export subfolders can be entered in the right-hand column.
(Icon) Groups
Objects which have been grouped together in Blender are merged into the same SMD file. You can expand the list of objects in the Group for inspection, and exclude certain ones by clicking on them.
Tip.pngTip:To have the SMD Tools ignore a Group entirely and return its contents to the Objects section, use the new options found on the Groups panel under (Icon)+(Icon) Object Properties.
(Icon) Objects
Objects not in a Group are listed here. They will all be exported to their own SMDs.
(Icon) Actions
Actions are the source of skeletal animations. This section lists all the (Icon) Armatures in the scene and exposes their Actions. You can either export the current Action, a filtered list of all Actions in the .blend, or the Actions used in the Armature's NLA tracks. (There is currently no good way of associating multiple Actions with any one Object.)
Note.pngNote:Only armature bone animation created in (Icon) Pose Mode can be exported. See Animation in Blender.
Ignore materials
The SMD Tools will usually export the name of the (Icon) Material assigned to each face, or a face-assigned (Icon) Texture if none is found. Checking this box makes the Tools ignore materials at all times.
Visible layer(s) only
Restricts the Scene Exports list to objects in the 3D View's active layers.

QC Compiles

The SMD Tools can automatically run studiomdl on demand or after an export. They will not actually generate a QC for you, however!

QC file path
This is where the Tools should look for QCs to run. You can use the // syntax to make the path relative to the .blend file, and you can also use the * and ? to perform a wildcard search for multiple files.
pyro, pyro legacy (QC List)
This is where any QCs found at the QC path are displayed. You can compile one at any time by clicking its button.
Compile all on export
Automatically compiles all QCs when anything is exported.
Compile all now
Does exactly what it says.

Utility

Operators that aren't directly related to exporting.

Clean all SMD data
The SMD Tools will store data on each object for use when exporting. Some of these, like name overrides, don't have their own section in the UI. You can remove all of these properties at once with this button.
Help
Open this web page.
Check for updates
Connects to the Tool's Google Code website and downloads any updates, as long as they are compatible with your version of Blender.

Troubleshooting

Animation

My animations are messed up!
Version 1.1 of the Tools changed the way bones are exported. You can fix the problem by re-exporting everything, but if that isn't an option see the (Icon)+(Icon) Armature Properties panel and enable "Legacy rotation".
My animation won't export!
Only armature bone animation created in (Icon) Pose Mode can be exported. See Animation in Blender.

Meshes

My mesh is in the wrong place!
The SMD Tools export each object relative to its own origin, not the scene's, unless it is parented to another object. If you need to align meshes with each other (e.g. collisions, gibs) then make sure that they are all parented. Create an (Icon) Empty if need be; the parent itself doesn't have to be exported.
Studiomdl always says my collision mesh has "2-dimensional geometry"!
The edges of collision geometry must be smooth. Use the "Shade Smooth" operator on your object. Also, there cannot be any holes in the mesh. See Collision mesh#Caveats.

Export filename

My object/bone is exporting with the wrong filename!
The filename I want is too long for Blender!
Names of Blender datablocks have an annoying 32-character limitation. You can get around this by going to (Icon)+(Icon) Object Properties or (Icon)+(Icon) Bone Properties and adding a Custom Property called smd_name, which the tools will then use instead of the actual datablock name.
Likewise, removing that property will cause the Tools to start using the actual datablock name again. smd_name will often be set by the Tools during import.
I don't want my animations in a subfolder!
You can use a subfolder of . (which means "current directory") to prevent anims from being inserted.

DMX

How can I import DMX models?
Download DMX-Model and put it in your root Blender folder, alongside blender.exe.
How can I export DMX?
You can't. Yet.

I found a bug

Super! Please report it on Google Code.