Workflow Tutorial

If you haven’t installed Mesa, read the Installation page.

Introduction

This tutorial will try to explain how to set your maya scene to brings your creations to life into the Valve Source Engine and by using MESA to export your models.

The workflow is sectioned by steps

Workflow steps in order
Preparing the scene It include save your scene and your texture maps into the right location on your hard drive. MESA is case sensitive and if you do not respect the directories system in place the model will not being exported correctly.
Shading Diffuse , Normal and alpha texture maps usage and settings.
Layering Organize the scene components by layer to guide the exporter to do the job as well.
Collision model and ragdoll Simply attach a collision model and set the layer membership.
Cleaning the scene Clean up your scene to prevent any confusion.
Export the assets Set up the options of the exporter.

 

Preparing the scene

Mesa Set the project directory

Set the project directory.

 

  • Start Maya
  • On the top menu File > Set Project

You must set the “/ModName_source/” folder as project folder. It includes a workspace.mel file that defines the paths of the MESA scripts, the textures and the scenes.

 

 

 

 

 

Open your textured model in Maya

Open your Models in Maya.

 

 

 

  • Open your scene with your textured models.

This step is important because if your scene is not located into the “/scenes/” folder, the export will not being able to properly export the QC Script and SMD files in “/modelsrc/

 

 

 

 

 

MESA - save your scene to scene folder

Save your scene to scene folder

 

 

  • Now “Save as” the scene in the proper location “\Modname_source\scenes\props\” for example.

 

 

 

 

 

 


 Shading

MESA - apply a PhongE to the model

Apply a PhongE Shader to the model.

 

 

  • If your model already got a shader assigned, you must be sure that all shaders used on your model are Phong E shader type.
  • Select the object or the polygons,
  • Right holded click and Assign New Materials

 

 

 

The Color texture maps is a TGA file.

The Color texture maps is a TGA file.

 

 

 

  • Use a TGA format texture map into the Color Channel .

 

[stextbox id=”warning” caption=”Warning” color=”000000″ ccolor=”ffffff” bgcolor=”858585″ cbgcolor=”252525″ bcolor=”000″ mode=”css” float=”false”]

the name of the TGA will become the name of the VMT file, than the SMD Reference file will request.

example : here my vmt file will become “cube.vmt” the generated VTF will also get the same file name( cube.vtf)

[/stextbox]

 

 

 

 

 

 

 

 

mesa_add_attributes

Mesa Shelf Icons

 

 

  • Select your model and display the MESA shelf, and click on the “Add Att” icon (add attributes).

 

 

MESA Adding the Extra Attributes

Adding the Extra Attributes

 

 

It will add some attributes on the main node of your object in the attribute editor, extra attributes section.

You can change the name of the vtf file if you modify the content of the material file (vmt) and the name of the vtf in the window explorer. do not rename the vmt files, or the model will not get the textures in the model viewer and ingame.

 

 

 

 

 

 

 


Normal Mapping

[stextbox id=”alert” caption=”Important” color=”000000″ ccolor=”ffffff” bgcolor=”858585″ cbgcolor=”252525″ bcolor=”000″ width=”500″ mode=”css” ” float=”false”]

Do not use any normal maps texture with the Bump Mapping channel of the Phong E shader.

It as currently broken.

To remove the bump mapping channel, do a right click on the Bump Mapping label and do a Break connection.

[/stextbox]

Alpha channel

[stextbox id=”warning” caption=”Warning” color=”000000″ ccolor=”ffffff” bgcolor=”858585″ cbgcolor=”252525″ bcolor=”000″ width=”500″ mode=”css” ” float=”false”]

It preferable with source engine to have two separated material when some part of your model require alpha channel to display the transparency.

You must assign a new shader (phongE) to your selection sets separate a models that need alpha channel on a different material.

[/stextbox]

You get two choices :

  • use the alpha channel of the color texture map.
  • use a Mask texture in the transparency channel.

Don’t forget to check the extra attributes if you using transparency.

VertexLitGeneric : the type of shader that source engine handle to display the models materials.

nocull : the polygons will be displayed as Double Sided polygons

alphatest : will activate the alpha channel of your color texture map, and set the $alphatest command to 1 in the VMT file.

nonice : …

nomip : no mipmaps texture when VTEX convert the TGA into the VTF format.

 


Layering

mesa_emptylayer

Layer window icon

Display the MESA shelf and click on the “Empty Layer” Icon

 

 

 

mesa_ref_phys_layer

MESA – Create Layer Window

 

 

 

 

 

  • Just click on the “Ref/phy Layer” Button

 

 

 

 

 

 

 

 

Edit the Layer Membership

Edit the Layer Membership

 

 

 

  • From the Layer Editor do a right click on the reference layer and choose “Membership

 

 

 

 

 

 

mesa_ref_membership

Maya RelationShip Editor

 

 

  • On the left column, select Reference layer
  • On the right column, select the model node and the model Shape node.

Note : If the shape node is not included, the geometry will not be exported correctly in SMD Reference format.

 

 

 

 

 


Collision and Ragdoll model

Create your physic model, and as you did it for the reference model, you have to do a right click on the “Layer Physics” and then click “Membership”.

mesa_phys_membership

Maya Relationship editor – Set the physics layer relationship

 

 

 

 

  • on the left column, select the physics layer
  • on the right column, select the physics group node and the shape node that contains the geometry.

 

Select the object model in the view port, and do a right click on the viewport, choose then assign an existent material, to the physic model, and choose the same shader that the reference model already use.

 

 

[stextbox id=”warning” caption=”Warning” color=”000000″ ccolor=”ffffff” bgcolor=”858585″ cbgcolor=”252525″ bcolor=”000″ width=”450″ mode=”css” ” float=”false”]

If the shape node is not included, the geometry will not be exported correctly in SMD Physic format.

[/stextbox]

Textures maps

[stextbox id=”warning” caption=”Important” color=”000000″ ccolor=”ffffff” bgcolor=”858585″ cbgcolor=”252525″ bcolor=”000″ mode=”css” ” float=”false”]

The physic model require a shader material too or it will not work in game, here i just duplicated my cube and so the same shader is automatically applied.

[/stextbox]

Cleaning the scene

Do the usual task to clean up your mesh

  • Mesh > cleanup… ( 2 vertex polygons )
  • freeze transform ( translate, rotate, scale, normals)
  • Edit > Delete all by type > History
  • Combine ( if you are using several UV Sets)
  • Save your scene.

 

Export the assets

Configure the components to export

Now in that Stage we will see the most important panels to export a functional prop model.

 

The Export panel Icon.

The Export panel Icon.

 

 

 

We will only Export the SMD Reference and the SMD physic model.

  • Check all the option as on the screen below.
Export tab of the mesa option panel.

Export tab of the mesa option panel.

 

Description :

Freeze and Reset Transforms : can be usefull is you forget to freeze , but never use this with animated models or the skin cluster will be deleted.

Combine and Smooth the physics models : Combine will combine all the polysurface from the physics layer into one object group ( don’t forget the shape node)

Export 1 frame Idle Smd : will create an animation sequence with one frame, use this for prop models and donot duplicate the name sequence when you set new animations on the animation tab.

Export Animation SMDs : will export all the animation defined on the Animation tab.

Export Texture (Vtex) : will export the VMT (materials) and VTF ( textures map) , the texture map must be a TGA format file.

Generate a new QC script ( refresh it ) : Will write the QC script on the disk. If you modifying the QC manually into a text editor you can uncheck that option.

Compile QC : will compile the QC script when the full compile button is activated, don’t forget to have steam opens.

 

 

 


 Setup the paths

  • Display the Paths Tab
  • Click on Default button and the paths are updated , if the fields are empty the model will not being exported.
Path Tab after clicking on Default button.

Path Tab after clicking on Default button.

 

SMD /QC path : The default path is the same path than the scene location, but it will pointed on the “/modelsrc/” folder.

[stextbox id=”warning” caption=”Warning” color=”000000″ ccolor=”ffffff” bgcolor=”858585″ cbgcolor=”252525″ bcolor=”000″ mode=”css” ” float=”false”]
  1. you can change the name of the smd, it will affected the name of the final MDL file.
  2. The folder “/props/” must to exist into “/modName/models/” or you will get an error ( check for write enable )
  3. you must to save your scene when the path is changed, or the export will fail.
[/stextbox]

Materials / Textures Path : the path of the “/materialsrc/” directory where the TGA files are stored.

[stextbox id=”warning” caption=”Warning” color=”000000″ ccolor=”ffffff” bgcolor=”858585″ cbgcolor=”252525″ bcolor=”000″ mode=”css” ” float=”false”]

This path must always be “/modname_source/materialsrc/” do not edit the path is when you clicking on Default button the path is the right one.

if the path does not terminated by “/materialsrc/“, you probably have to Set the current project on “/modname_source/“.

[/stextbox]

 

The mod and sdk bin tools paths

The secondary area of the Paths tab show you what are the current environment variables set into the maya.env file.

[stextbox id=”info” caption=”Information” color=”000000″ ccolor=”ffffff” bgcolor=”858585″ cbgcolor=”252525″ bcolor=”000″ mode=”css” ” float=”false”]

If the Source Mod Name and Source VPROJECT is set to do not reflect the current project set for maya, it probably because source sdk is running in background and the engine version and Current game are different , so set the current game on “ModName” or close the sourcesdk.

[/stextbox]

 

 

The console Output log

So now that everything is all right

  • you must to save your scene again “CTRL+S
  • click on the Full Compile button
  • open the script Editor to see the Report.

The log :

 

One Comment

Comments are closed.