HIT Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Hands Change Tutorial  (Read 4343 times)

0 Members and 1 Guest are viewing this topic.

waqwarrior

  • prettier than the average
  • Gargantua
  • *******
  • Offline Offline
  • Posts: 872
    • View Profile
Hands Change Tutorial
« on: October 17, 2010, 06:59:33 PM »

One of the most common requests is for people to change the hands on a weapon. I requested the exact same thing a couple times. Now that I know myself, I’ll shed some light on the situation for all who don’t know.
1.   First things first, get Milkshape 3D. The trial won’t late you save stuff, so buy it or get it from a friend.
2.   Crucial to the success of this would be having Jed’s Half-Life Model Viewer. Install that. Then, download MDLDEC so you can decompile models. To use MDLDEC, place it in a directory (such as the HLMV installation directory), and, while in HLMV, go to Tools > Configure Tools, and point to the path of MDLDEC.exe. Don’t worry about StudioMDL, we’re going to be compiling with Milkshape.
3.    For this tutorial, we’re going to change the hands on this MP5 model. We’ll be converting from Ambient.Impact’s HEV arms to Sven Coop arms.
4.   Open the MP5 model on HEV arms in model viewer. Look at the animations, the way the arms move, etc. Get a feel for how the animations look when properly compiled.

(This is indeed the model, I just hacked a scope onto it, don’t worry that it’s not on yours.)

5.   Copy the v_9mmarHEV.mdl from the folder you viewed it in to a folder on your Desktop or work folder called “MDLDEC.” Now, open the model with HLMV, and go to Tools > Decompile model. In your MDLDEC folder, you will notice there are BMPs, SMDs, and a QC file. The QC file opens with Notepad, so set it up so that they open with it via a double click.
a.   The BMPs are set up to follow the model’s “UV Map,” that tells what parts of the 2D texture go on specific parts of the 3D model. It’s pretty intricate. We’ll mess with these later.
b.   SMDs can be references or sequences. Sequences are animations, and references are the different parts of the model. A reference SMD can only have so many vertices (around 2500) for a successful compile. Many “SD” models will have at least two reference SMDs. Sequences are animations. We don’t need to mess with those right now.
6.   For this tutorial, we will be converting this from HEV arms to SC arms, so decompile a model from Sven Coop (here the grenade), and copy the arm reference SMD and its textures to your MP5’s MDLDEC folder.
7.   Launch Milkshape 3D. Don’t let the screen overwhelm you, you’ll get used to it in no time. Now, you’ll want to import your HEV arm mesh first. Go to File > Import > Half-Life SMD. Navigate to your MDLDEC folder and click v_gordon_hands_ref. Next, a dialog box will come up, asking if you want to import Triangles, Skeleton, and/or Rename Bones. Here, import triangles and skeleton. You should get a screen like the one below.

a.   The blue lines are called joints, or the skeleton. The skeleton moves and bends in the animations. Certain parts of the model are assigned to certain joints to make the animations appear how they do when you see them.
b.   Also, if you want the screen to look exactly like mine, there are a couple steps you need to take. Right click on one of the four windows and look at the Projections option. I have it set up (starting from top left and going clockwise from there) as: Back, 3D, Left, Right.
c.   Finally, go to File > Preferences, the Misc tab, set Joint Size to “0.15.” The thinner the joints are, the easier they are to work with, in my experience.
8.   Next, import your Sven Coop arm mesh. When the dialog box appears for Import options, set it to import Triangles only. You’ll now notice that the Sven mesh is in the same place as the HEV mesh. Go to the Groups tab, and double click the group “V_Arm_Texture.” Now, go to the Model tab, and click Move so you can get it out of the way of the HEV mesh.

a.   I moved it out of the way. It’s a good idea to adjust the height of the arms on one side, so that on the left and right projections, when you select vertices, you only select them on one side rather than both.
b.   Also, in the Joints tab, click “Clear” while you have the Sven Coop arms selected.
9.   On the Model tab, click Select, then down below, under Select Options, click Vertex, and uncheck “Ignore Backfaces” if it’s checked.
10.   Go to the Joints tab. Since this is for a weapon model rather than an NPC, joints such as Bip01 and the Pelvis and Spine bones are typically not much of a worry. Scroll down until you get to the bone “Bip01 L Finger 0.” Click “SelAssigned.” This shows what vertices are assigned to that joint. Look at the bottom left window. You’ll see some vertices (dots) highlighted in red. Now, select the vertices in the same area on the SC thumb. (Holding shift when you select vertices allows you to select more vertices along with what’s already selected, rather than clearing what was previously selected.)
11.   When you’re satisfied with what you’ve selected, click “Assign.”

a.   Repeat this process for the rest of the bones. When you are satisfied with what you’re done, continue to step 12.
b.   Make sure no vertices go unassigned! To make sure everything is assigned to something, click “SelUnAssigned” and pray that no vertices are highlighted.
c.   After you’re done, save your work as an MS3D file (Ctrl+S).
12.   Now that you’ve got your vertices assigned (hopefully correctly), we have a couple more things to do before we export and compile.
a.   Select the HEV arms, and delete them. Now, select the Sven arms and move them so that they’re in line with the joints.
b.   Now, hit Ctrl+A or Select All, and hit Ctrl+T to open the Texture Coordinate Editor. While it’s open, click Move and place the UVs so they fit as closely as possible with the texture(s). When you’re satisfied, go to File > Export > Half-Life SMD. Name it v_sven_hands_ref or something of the like. When the Export Options dialog box comes up, make sure it’s set to Reference.
i.   Import one of the gun’s reference SMDs and adjust the UVs (They shift one pixel to the left when decompiled). Export. Do this one at a time, to assure a successful compile.
c.   Open your QC file in the MDLDEC folder. Find the line where it says “$body "studio" "v_gordon_hands_ref"”. Replace v_gordon_hands_ref with v_sven_hands_ref or whatever you named it.
13.   Ready to see how you did? Go to Tools > Half-Life > Compile QC File… and navigate to the QC you just edited. If you don’t get a successful compile, look back  at everything you did…

Success!

Feel free to ask further questions in this thread, especially if you're stuck or need something clarified.
Logged

DiamonD

  • Gonarch
  • ********
  • Offline Offline
  • Posts: 2566
    • View Profile
Re: Hands Change Tutorial
« Reply #1 on: October 17, 2010, 08:17:22 PM »

Logged

Long Nange {RUS}

  • Snark
  • **
  • Offline Offline
  • Posts: 18
    • View Profile
Re: Hands Change Tutorial
« Reply #2 on: December 16, 2010, 05:35:51 PM »

Does it works with all models?
 ???
Logged

waqwarrior

  • prettier than the average
  • Gargantua
  • *******
  • Offline Offline
  • Posts: 872
    • View Profile
Re: Hands Change Tutorial
« Reply #3 on: December 16, 2010, 07:18:04 PM »

Just about. You might have to rotate and/or move the model. If the hands ref you want to change it to isn't shaped onto the joints, you have to move parts of the mesh to fit the joints; I'd recommend assignments beforehand as not to make the task more difficult.

Also, you can repose the joints.
Logged

kkj1116

  • Snark
  • **
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Hands Change Tutorial
« Reply #4 on: December 17, 2010, 03:19:05 AM »

Hi,

The models on my screen are too far/small. How would I zoom up?
And would this work for Cs 1.6? I'm trying to add default hands to a shotgun model but the default hands have 3 textures (finger, glove, and skin)
« Last Edit: December 17, 2010, 03:21:51 AM by kkj1116 »
Logged

waqwarrior

  • prettier than the average
  • Gargantua
  • *******
  • Offline Offline
  • Posts: 872
    • View Profile
Re: Hands Change Tutorial
« Reply #5 on: December 17, 2010, 11:38:00 AM »

Scale tool. To scale down change X Y Z to 0.95. Make them 1.05 if you're scaling up.
Logged