Things Named Veazie Places Named Veazie People Named Veazie The Site for All Things Veazie!

A Simple Half-Life 2 Model

Using XSI EXP v4.2

Create a model to use as a prop_static

This tutorial assumes that you have XSI EXP v4.2 (from Softimage) installed, including the ValveSource addon. It is a very basic tutorial, walking you step-by-step through:
-
basic navigation inside XSI  
- creating a simple polygon mesh cube model  
- texturing the cube using UV mapping  
- exporting a Half-Life Source reference smd file which you can compile into a model using Source SDK tools  
This tutorial does not:
- teach you how to compile smd files into model files  
- teach you how to create texture files for use in XSI  
- teach you how to compile your texture files into vtf files for use with your compiled models  
- teach you how to create an HL2 map in which to place your models  
- teach you how to create a prop_static entity and choose your model as a property  

 

My preference for screen resolution when I use the XSI program is set to 1152x864 with a Standard XSI Mod Tool layout. Some of the toolbar buttons in XSI are hidden at this resolution but I don't normally use the hidden buttons for model-making and the resolution suits me. For this tutorial, I'll assume you're using the same resolution and layout and see and can access the buttons I mention. In addition, I'll assume you're using a three-button mouse. Many of the selections you make in XSI will depend on whether you use the left, middle or right mouse button to activate them. If you have a scroll mouse with a scroller as the middle button, pressing the scroller to "click" as a middle button will work fine.
If you just started up XSI, you should see a vertical buttonbar on the left titled Model, a horizontal row of buttons across the top under the main menu above four windows, and a vertical button bar on the right with Select and Transform sections. For this tutorial, you won't be using the other features you may see, such as the Animation and playback horizontal toolbar, at the bottom.
  Note: If you don't see a ValveSource menu item in the main menu bar just under the Softimage window title bar (probably to the right next to the menu items Window and Help, you don't have the ValveSource addon for XSI EXP v4.2 and you won't be able to export Half-Life compatible smd files. Download the ValveSource addon from Softimage and install it!  
  Before we get started into the modeling..  
I'm going to use some abbreviations to make things a little simpler. LMB means "click the left mouse button." If I say something like LMB drag that will mean to click and hold down the left mouse button while you move the mouse to a desired position and then release it. Similarly, MMB means "click the middle mouse button" and RMB means "click the right mouse button."
I'm going to use those abbreviations rathering than saying "click" because XSI provides different functions for the mouse depending on which window the mouse pointer is in, and which mouse button is used to perform the function.
If you need (or want) to change the layout, go to the menu underneath the Softimage title bar, LMB Application->Layouts and select a layout from the list. The layout Laptop 1280*800 may suit you as well and should work well with this tutorial.
The vertical buttonbar on the left can be changed by LMB on the bar title (Model as shown below) to get a popup menu with four choices: Model, Animate, Render and Simulate. Choose Model if needed to set the bar to that array of buttons. We won't be using any of the other choices in this tutorial.
  Create a cube model..  
We'll create a cube as our model to keep things simple.
LMB Model->Get->Primitive->Polygon Mesh->Cube as shown below.
A property dialog box for the cube pops up. Just for practice, change the Length "8" to "12" by either: LMB in the box with the "8" in it and editing it; or LMB in the slide bar on the right of the Length property and drag it back and forth. You may have to edit the value in any case to set exactly 12 as the length.
Close the dialog box by LMB the little "x" button in the upper right corner of the dialog box.
In the upper right window (of the four view windows in XSI) labeled Camera, you should now see a white wireframe cube in 3d perspective over a grid. You've just created your cube model! This is called "creating the geometry" for your model.
Some more navigation tips in XSI..  
Your probably can't see the entire cube in any of the views. Position the mouse pointer over the cube in the Camera view and press "F" to frame the selected object in that view. Position the mouse pointer somewhere inside the Top view window (the view at the upper left) and press "F" to frame the cube in that view. With the pointer inside any of the views, press shift-F to frame the object in all views.
Look at the buttons along the top of the Camera view from left to right. You won't use all of them in this tutorial but it can't hurt to familiarize yourself with what they do.
LMB the little "B" button to hide the other views. The windows are still there but nothing is shown. LMB the "B" button again to restore all four views. RMB the "B" button to toggle mute and solo. mute hides the view and restores it. solo hides the other three views and restores them.
LMB the button labeled Camera (with the little downarrow) to popup a menu of the various views you can select for that view window. Without selecting anything from the popup menu, LMB somewhere other than on the menu to make the popup menu disappear.
LMB the little camera icon to popup a menu of the various tools we can use in this view. We'll use some of those tools later. I call this the navigation tool menu. LMB elsewhere to erase the menu.
LMB the little eye icon to see a menu of things you can make visible or invisible in various views. We won't be using that menu in this tutorial. LMB elsewhere to erase the menu.
LMB the "x" icon to toggle the camera's view from whereever it's currently pointed, to a view along the X axis of the scene. LMB again to return to the previous camera view.
LMB the Wireframe pulldown menu button to see the various types of camera views (and other options) you can select. We'll be using this menu later when we texture the cube to make our model look better.
LMB the "box within a box" at the far right to toggle the camera view from one-of-four-views to full view. LMB again to restore the four view layout. This is similar to the normal Windows maximize and restore functions.
Position the mouse pointer over the camera view and press "o" (the letter oh) to select the orbit tool. When this tool is selected (note how the mouse pointer looks), you can LMB drag to move the camera around the cube freely while maintaining the center of the view on the object. RMB drag constrains the camera movement in the vertical direction. MMB drag constrains the camera movement in the horizontal direction. Try it out.
You can toggle the orbit tool on and off by pressing the "o" again. You can toggle any of the navigation tools I describe this way. You can also select any of these tools from the camera icon dropdown menu, the navigation tool, or navtool, menu. That menu also tells you what key or you can press (at any time with the mouse pointer over the window) to select the corresponding tool.
With the pointer over the camera view, press "p" to select the dolly tool or select it from the navtool menu. When this tool is selected, you can LMB drag to dolly the camera back and forth to change the view. MMB dragging and RMB dragging dolly the camera back and forth at different rates.
With the pointer over the camera view, press "z" to select the pan tool or select it from the navtool menu. When this tool is selected, you can LMB drag to move the camera in the horizontal and vertical directions without staying centered on the object. RMB dollies the camera back automatically. MMB dollies the camera forward automatically.
  A few more buttons..  
In the button bar above the Camera view are six important buttons. In this tutorial, you'll only use a couple of the buttons but I think it's wise you learn about their functions in case you click the wrong button and "do something" to the model. By learning these buttons, you'll be able to recover and get back on track.
The first button on the left is the object select button. This button is used to put the camera view into the object select mode. To use it, LMB the object select button and LMB drag over a portion of an object in the camera view to select the object for manipulation. To deselect objects, LMB drag in the camera view over a portion of the view where there are no objects.
LMB the object select button and LMB drag in the camera view away from the cube's wireframe. The cube will turn to a black wireframe to show that it's not selected. LMB drag over any part of the cube's wireframe to select it. The cube turns to a white color to show it's selected.
We won't be using the next two buttons in the camera view but you should learn their functions to familiarize yourself with the concept of selecting parts of the selected cube.
The second button, the one with the arrow pointing to a small red box, is the vertex selection button. When the camera view is in the vertex selection mode, you can LMB drag over the selected object to select individual vertices or groups of vertices which make up the object. If you're not sure what a vertex is right now, don't worry about it.
To try it out, make sure the cube is selected by LMB the object select button, and LMB drag over the cube wireframe somewhere in the camera view. The cube wireframe should be white. Now LMB the vertex select button. The cube's wireframe is now drawn as vertices (the small boxes at the corners of the cube) and edges (the lines connecting the vertices).
LMB drag a box around one or more of the vertices (the boxes at the corners of the wireframe). They change color to show they're selected. LMB drag another vertex or several more vertices. When you LMB drag additional vertices they're added to the current selection of vertices.
Now RMB drag one or two of the selected vertices. They change color to show they're not selected. When you RMB drag a selected vertex, it's subtracted from the current selection of vertices. RMB drag one of the vertices that's not currently selected. It changes color to show that it's not selected. When you RMB drag an unselected vertex, it's added to the current selection. If you RMB drag both selected and unselected vertices, each vertex changes from its current selection state to the other - if it's selected before you drag, it becomes unselected and vice-versa.
MMB drag some selected vertices and some unselected vertices. An MMB drag deselects vertices from the current selection.
In summary, LMB drag selects vertices; MMD drag deselects vertices; RMB drag toggles vertex selection (changes from selected to unselected, or unselected to selected). You'll be using this method of selecting vertices later in the tutorial when you use the Texture Editor window.
The third button is the edge select button. When you LMB that button, you put the camera view into the edge selection mode. Instead of adding, subtracting or toggling vertices from the selected group, you can add, subtract or toggle edges from a group. Edges are the lines that connect vertices in the wireframe.
LMB the edge select button and try selecting, unselecting and toggling edges in the cube's wireframe using LMB, MMB and RMB drags.
The fourth button, the one with the arrow pointing to an entire side of an object, is the face select button. When you LMB this button, you put the camera view into the face selection mode. In this mode, you click (LMB, MMB or RMB) to add, subtract or toggle the selection of a single face of the cube nearest the camera. If you drag, each face the mouse pointer goes over will be selected, deselected or toggled, depending on which mouse button you have down.
LMB the face select button and try selecting, unselecting and toggling the selection of faces in the cube's wireframe.
The last two buttons are the undo and redo buttons. If you make a mistake, LMB the undo button to recover. Click it several times if you've made several mistakes. If you don't like what you've undone, LMB the redo button to perform the operation you just undid.
  Get a texture to apply to our model..  
In the next section of this tutorial, you'll apply a texture that looks like the texture below to your cube model. A texture, in this case, is just an image from a file.
Textures applied to Half-Life 2 models must be in the targa format, that is, an image file with the extension .tga. Connect to the Internet and download a copy of the image above by clicking here. Save the downloaded zip file to disk, to a location you can remember! Open Windows Explorer, navigate to the folder where you saved the zip file and open it. Save testimage.tga to disk, again to a location you can remember.
  Apply the texture to our model..  
This is the part of model-making I enjoy most: applying a texture to the model. Make sure the cube object is selected. If needed, LMB the object select button and LMB drag a part of the cube to select it (the wireframe turns white).
With the cube selected, LMB the Render menu item in the main menu above the camera window. From that menu, LMB Get-Texture. From that menu, LMB Image.
When asked to save local copies of the material, click Yes.
What you see in the Scene Material dialog box that pops up is the default texture that XSI selects. You want to use the testimage.tga file you downloaded. LMB the Edit button to the right of the Image property where it says "noIcon_pic."
A similar dialog box replaces the Scene Material dialog where you can set the image properties. Using the vertical scroll bar on the right, scroll down until you can see the portion of the dialog box with tabs labeled General, Info and Video above an edit box with the folder path to the noIcon image in it.
To the right of that edit box, LMB the button with the "..." label.
A file selection dialog will pop up. Use the Up button to navigate to the folder into which you unzipped testimage.tga. The edit box to the left of the Up button shows you the currently selected folder. The folder list below the Up button shows you the folders in the current Windows path on your disk.
In the example below, I've navigated "up" to the root directory on the C: drive and LMB'd the Images folder in the folder list below the Up button to list the files in that folder in the window to the right. LMB on the file "testimage.tga," check that testimage.tga is in the Filename box at the bottom of the dialog and LMB the OK button at the bottom right of the dialog.
The file selection dialog will close. Back in the noIcon_pic property dialog, scroll up to see testimage.tga as the selected texture in the Clip property window. LMB the left arrow near the top of the dialog near the middle to navigate back to the Scene Material properties.
Below the clip of our texture, find the portion of the dialog labeled Texture Projection. You've selected a texture for the model. Now you'll choose a starting layout to texture the cube. You'll see what that means as you continue the tutorial. LMB the New button to the right in the Texture Projection section of the dialog.
From the popup menu, select Cubic as the texture projection. Close the Scene Material dialog box by clicking the "x" in the upper right corner of the dialog.
In the camera view, LMB the pulldown list which should currently be labeled Wireframe and select Textured Decal from the list. You should see that the texture has been applied to our model cube. With the mouse pointer over the camera view, press "o" (select the orbit tool) and look your model over.
Because you chose a cubic mapping for the texture, the entire texture has been applied to each face of the cube. At this point, you could export the Source files necessary to compile a model. However, model texturing normally involves applying just portions of the texture to different parts of the model.
  Getting Ready to "UV Map" the model..  

The term "uv mapping" means to select portions of a texture to apply to individual polygons making up the model. It's not particularly important to understand "uv coordinates" to texture map your model. XSI does it all graphically. Those are terms you will see, however, in articles and tutorials around the Web if you want to search for more information.

As a goal, let's map just the word "Test" to just one face of the cube and map different solid colors to the other fives faces of the cube. To do this, you'll select one face of the cube at a time and adjust the texture projection for just that face to the portion of the texture you want.

For ease of editing and to practice navigating in the camera view, maximize the camera view by LMB the min-max button (the "box-within-a-box" button) in the upper-right corner of the camera view. Adjust the camera view so that the cube occupies the upper half of the window. Move the mouse pointer over the camera view; select the pan tool (press "z"); RMB to zoom the camera back until the cube is about half the size of the view; LMB drag to move the view of the cube to the upper half of the view. Deselect the pan tool (press "z" again) to exit the pan navigation mode and return the mouse pointer icon to an arrow.
Texture mapping is most easily done using the Texture Editor in XSI. Press alt-7 (hold down the alt key and the 7 key on the main keyboard at the same time) to bring up the Texture Editor. If you need to, LMB drag the title bar of the Texture Editor window (labeled Texture Editor) to move the editor window down to the bottom half of the screen. You want to be able to see most of the model in the camera view and most of the texture layout in the Texture Editor. Even with the texture editor (tex-ed) window showing, you can still use the navigation tools in the camera window to make adjustments. You can also resize the tex-ed window by moving the mouse pointer over an edge of the window (top, bottom, left or right edges) until the mouse pointer turns into a right-left arrow or an up-down arrow pointer. LMB drag the tex-ed to a suitable size.
You can use the pan tool ("z") in the tex-ed to adjust your view of the texture and texture projection polygons. Just move the mouse pointer over the tex-ed window, press "z"; LMB to zoom out; MMB to zoom in; and RMB drag to move the image in the window up-down and left-right. Press "z" again to go back to the arrow mouse pointer.
  Texture Editor Buttons..  
Depending on your screen width and the texture editor ("tex-ed") window width, your buttons may not be in exactly the same arrangement as shown below. However, they're all there at the top of the tex-ed window. Locate them and read the description of each. We'll be using these buttons a lot!
This button (vertex mode) puts the tex-ed into the vertex component mode. In this mode you can select and move the vertices (the little boxes) in the tex-ed. In this tutorial you'll be in the vertex mode all the time.  
This button (show-selected) causes the tex-ed to show only the texture selection polygon for the face currently selected in the camera view when the correct sequence as described below has been followed. More on that in a minute.  
This button (show-all) causes the tex-ed to show all the texture selection polygons for all the faces of the selected object whether the face is selected or not.  
This button (translate) puts the tex-ed into the translate mode for the components currently selected in the tex-ed. Say what? Since you'll be in vertex (component) mode all the time, that means, when you LMB this button, you can translate (move) the selected vertices around in the tex-ed.  
It may sound more complicated than it is. With just a little practice, you'll be adjusting the texture projection for your model quickly and easily.
First, LMB the tex-ed vertex button (the first button shown above, the one with the "v" and the two crossing lines in it) to make sure the tex-ed is in the vertex mode.
Now, about the important sequence I mentioned in the description of the show-selected button above. This sequence ensures that the texture selection polygon in the tex-ed matches the face you've selected in the camera view. If you get into a situation where you don't see what you expect in the tex-ed, follow this sequence to get yourself straightened out again.
  LMB the show-all button in the tex-ed.  
  LMB the face select button in the camera view.  
  With the mouse pointer over the camera view, press ctrl-shift-A (simultaneously hold down the ctrl key, the shift key and the "A" key on the keyboard). It's awkward, I know. As an alternative, in the main menu above the camera window, LMB the Select menu item and select "Deselect All." That may be a little easier. This will deselect any currently selected faces in the camera view.  
  LMB the face select button in the camera view. Review the button descriptions in the A Few More Buttons.. section of the tutorial above if needed.  
  LMB the desired face of the cube you want to texture.  
  LMB the show-selected button in the tex-ed.  
When you've repeated this sequence several times, it'll become more second-nature.
  Texture Mapping the Cube.. (finally)  
In the camera view, make sure the cube is selected.
Using the "important" sequence above, select one of the faces of the cube. It doesn't really matter which one. To make sure you've selected just one face of the cube, change to Wireframe in the camera view, select the orbit tool (press "o") and move the camera around to see that just one face of the cube is highlighted. Press "o" again to exit the orbit tool. You can switch back and forth between Wireframe and Textured Decal displays in the camera view, as desired, to make face selection easiest for you. Face selection works the same in either display mode.
The tex-ed may not seemed to have changed a lot, but it shows four selected vertices (they're red instead of blue normally) connected by lines. This four-sided polygon is the texture selection polygon for the face you have selected in the camera view.
As stated above, part of our goal is to map just the word "Test" onto one face of the cube. The following steps will move the polygon in the tex-ed around to do that.
With the mouse pointer over the tex-ed, make sure the mouse pointer is an arrow. If it's not, press "v" until the pointer turns to an arrow. In the vertex mode with the mouse pointer as an arrow, you can select vertices.
RMB drag the bottom two vertices in the tex-ed to deselect them. There should be two red vertices (selected) at the top of the polygon and two blue vertices (unselected) at the bottom of the polygon.
LMB the translate button in the tex-ed or, with the pointer over the tex-ed, press "v." The mouse pointer will change into a four-pointed arrow.
With the mouse pointer anywhere in the tex-ed, MMB drag until the selected vertices are just above the word "Test" in the light green area but not into the darker green area above. LMB the translate button or press "v' to exit the translate mode.
For practice, using the pan tool ("z") to zoom in tight on the upper left hand corner of the polygon. Press "z" to exit the pan tool. Translate the vertices close to the top of the light green section.
Zoom back out. Deselect the upper vertices and select the lower vertices.
Translate the lower two vertices up until they're just under the word "Test" and close to the bright pink area of the texture. Zoom in, translate, zoom out as necessary.
Take a look at the cube in the camera view with a Textured Decal display.
Congratulations! You've uv-mapped a portion of a texture to your cube model!
LMB show-all in the tex-ed. Notice that the polygon for the face you just mapped covers the portion of the texture that is textured on the face of the polygon in the camera view.
Let's achieve the rest of our goal: map different solid colors to the other faces of the cube.
Follow the "important" sequence of steps to select another face of the cube. Use the navigation tools in the camera view as necessary to show a face to click on. Use either the Wireframe or Textured Decal display, whichever suits you. The tex-ed should show a polygon covering the entire texture.
Using the techniques you learned mapping the "Test" portion of the texture to a face, adjust the polygon so that it covers just the portion of the texture with the bright pink color.
For this face of the cube, since you mapping just a solid color, the polygon doesn't have to be close to the top of bottom of the pink portion of the texture. Everything inside the polygon is pink, anyway.
For practice: with the mouse pointer over the tex-ed, select just the two vertices to the left, select translate and RMB drag that side of the polygon to the right a little. Deselect translate.
In the tex-ed in translate mode, RMB drag translates the selected vertices only left-right. Even if you move the mouse pointer up-and-down, the movement is still only left-right. MMB drag translates the selected vertices only up-down. LMB drag translates the vertices in any direction.
Select just the two vertices on the right and translate them to the left a little.
In the camera view, you should now see that the face you selected is entirely covered with a shocking pink color.
LMB show-all and see that two of the faces have been mapped to areas of the texture smaller than the entire image.
Follow the important sequence and map another face to one of the other color areas of the texture. You're going to learn a shortcut to mapping solid colors. You may not find mapping of solid colors a very useful technique for Half-Life 2 models as the whole idea is to make them look (sort of) realistic. But this adds another mapping technique to your modeling toolbag.
With one of the faces mapped to a solid color, select all the vertices.
Find and LMB the collapse-to-point button.
All four vertices have been mapped to a single pixel in the texture! The color of that single pixel is used to texture the entire selected face in your model. Take a look at your model in the camera view to verify.
You can move that collapsed vertex around in the tex-ed as you would any selected vertices. As you move it around (try it if you like - using translate), the color that it covers in the texture is mapped to the selected face of your model.
Now test what you've learned. One by one, select the other faces of the cube and map them each to a different color. You can use either the polygon technique we used for the pink color or the collapse-to-point technique you just learned. You may have to use the navigation tools (orbit, pan, dolly) in the camera view to select the various faces of the cube.
When you've completed mapping all the faces, LMB show-all and see that you've mapped each of the six sides of the cube to a different area of the texture. I used collapse-to-point for all but two of the mappings. If you did it differently but you ended up with the same result in the camera view, all is well!
  Exporting smd files..  
Having created the geometry (the cube) for your model and having textured it, you're almost ready to export your reference smd file to be compiled into a Half-Life 2 model.
In the main menu, LMB the Transform menu item and select Freeze all transforms. For this simple model, this isn't a necessary step. However, when you make more complicated models that require translation or rotation of objects, this is a necessary step.
Freezing all transforms ensures that the translations and rotations of your model are carried over into the smd files. For now, just get into the habit of freezing transforms before you export smd files.
In the main menu, LMB the ValveSource menu item and select Export smd...
In the save file dialog box that opens up, make sure Model (.SMD) is selected in the pulldown box under Options, File Type as shown below. LMB the button labeled "..." to bring up the filename box.
Navigate to your Steam sourcesdk_content/hl2/modelsrc folder. If there isn't a "models" folder in the modelsrc folder, create one and select it.
In the Filename edit box at the bottom of the filename dialog, type in a name for your smd file. In this case, just call it "box" and LMB OK to close the filename dialog.
LMB OK to close the SMDExportProperty box and save your model file as "box.smd" in the models folder.
Because this model will be used only as a prop_static in your HL2 map, you don't need any other smd files. In a later tutorial on creating an animated model, you'll need to export additional files.
  Congratulations, you just created an smd file for your textured box model!  
This may have seemed like a long, complicated procedure to create your model. However, once you've been through it just a couple of times and know which buttons to click and which mouse buttons to use for selection and translations, you'll find you can create a new model from scratch easily and quickly. I'm still an amateur using the XSI Mod Tool, but, in writing this tutorial, I created several simple cube models, textured them and exported the smd file in just minutes!

 


created 25-Aug-2005