The Game Modding Community - Since 2001

Blender to Insurgency

A Tutorial for Insurgency

model hacking/compiling using blender

[Original link](http://euanm.com/tutorials/insurgency#tut) ========================================================== * * * edit 15/09/15: this is outdated, and a bad idea. I'll do a new version uh... soon. ========================================================== * * *

Introduction

This tutorial will explain how to edit or replace models for Insurgency using Blender.

In general, the process for importing into Insurgency is the same as for most Source engine games. However, because Insurgency uses a new-ish feature of the Source model format that most decompilers don't know how to deal with yet, recompiled models tend to have problems with their animations. To deal with that, instead of re-compiling our decompiled animations, we instead borrow the animations from the original, undecompiled file.

What this means, essentially, is that we have to fiddle with some boring text files before hitting the go button.

Necessary Files

Before we start, we'll need some important files and programs.

To extract the files we want to replace, we'll need GCFScape.

To decompile those extracted files, we'll need Crowbar.

To edit the necessary files, we'll need a decent text editor, like Notepad++.

To export and compile our edited model, we'll need the Blender Source Tools.

We'll also need certain important files:

Extraction

The first step is extracting the files you want to replace. To do this, we use GCFScape to open up the .VPK files newer source games store stuff in.

We're going to replace the M45 pistol, so those are the files we'll need. They're stored in steam\steamapps\common\insurgency2\insurgency\insurgency_models_dir.vpk and within that they are stored in root\models\weapons\upgrades

There are three files; A .vtx, a .mdl and a .vvd .

The next step is to decompile the model into its constituent parts, using Crowbar.

Select the .mdl file, set your output folder, and hit 'Decompile MDL File'.

Once decompiled, you should have a .qc file, a reference.smd, and the animations in a folder.

Editing text files

At this point we are ready to set up the files we need to recompile our model.

Copy over the bonemerges.qci, compile.bat and compile.qc files.

bonemerges.qci doesn't need editing, but we need to edit the name of our decompiled .qc file into compile.bat.

We should also make sure the folder structure matches.

Once that's done, we can simply double click compile.bat to run it, and generate the 'definebones.qci' file.

'definebones.qci' will contain a bunch of junk we don't need at the start of the file. Go ahead and delete everything before the first '$definebone' line.

Now we edit our compile.qc. This is the qc we will use to compile our edited model.

We need to change a few lines. I've edited the file into what should be an easy to understand template. Several of the details will be found in the original v_m45.qc file.

With that done, we don't need to edit any more text files.

Editing the model

Now that's out the way, we can make our changes to the model.

Here, I have the model I want to replace the pistol with.

We need to import the file we want to replace.

Go to File > Import > Source Engine, then select the v_m45.qc. This will import the model, its skeleton, and the animations automatically.

We need to scale our model appropriately, assign the correct vertex groups, and set the correct model and material names.

Our model is a little longer, so the silencer won't look right. But you don't need to silence a lightgun, do you? At least the handle is about right.

The next step is to assign the correct vertex groups. The quickest way to do this is to duplicate the original pistol mesh, move it out the way, and combine it with your new model. To make sorting through all the vertex groups a little easier, you can remove all the unused vertex groups using this script.

Because the model we are using doesn't really have any moving parts, it's a pretty easy job. All we have to assign is the trigger and some batteries pretending to be a magazine, with the rest all assigned to the 'Weapon' group.

With that done, we can add an armature modifier to our model and preview the animations. If all our groups are assigned correctly, it should all work.

Next, we need to make sure the name of the model matches what we put in the .qc before.

Also make sure that you have applied the Location of the model, so that it's origin is at 0,0,0. Otherwise, we will get funny results later on. You can do this with Ctrl-A in Object Mode.

We also need to give the material a good name- that will be the name of the .vmt file that controls the material later on.

Compiling

Almost there. All we need to do is compile the model. We did the hard work earlier, so there are just a few settings to change.

The export path should be the path all the rest of our files are- the original .qc, .smd files etc. The 'Engine Path' is X:\Steam\steamapps\common\insurgency2\bin\ and the 'Game Path' is X:\Steam\steamapps\common\insurgency2\insurgency\, where X is the correct drive on your computer. Finally, the QC path is our compile.qc file.

With those set, we can hit Export > NesZapper.smd. Because we are using the animations from the original file, we don't actually need to export the animations. Although you can if you really want.

If you get an error message, open the Blender console for more information. It's under Window > Toggle System Console.

If all is well, we can compile the model. Hit 'compile.qc' down the bottom.

With that done, we should now find a folder called 'models' inside X:\Steam\steamapps\common\insurgency2\insurgency

However, they're not much good there. We need to move them into the custom folder, inside their own folder. You can call it whatever you like.

Remember we were going to borrow the animations from the original file? Time for that. Rename the original .mdl we got out of GCFScape to 'v_m45_anims.mdl'. That's what we put in the '$includemodel' line of the .qc. Then we need to copy it alongside our exported model.

At this point, our model is done, and you can preview it in the Half Life Model Viewer (theres a handy dandy link inside the blender source tools panel) or simply ingame.

It worked! Well at least the model did- we haven't sorted the material out yet.

We need to create a .vmt file with the right name and the right location. The name is easy- it's what we called the material in blender. 'neszapper.vmt' it is then. As for the location, we already set that in the .qc file. "$cdmaterials "models\weapons\neszapper\" means it needs to go in X:\Steam\steamapps\common\insurgency2\insurgency\custom\pewpewlasers\materials\models\weapons\neszapper

Edit your .vmt to your liking. This is a good reference, but the easy way is to copy one from another model and just change the filenames.

You'll also need to put your textures in as .vtf files. These can be created using VTFEdit, or using the Photoshop or Gimp plugins.

Et Voilà!

Common Problems and Notes

If the model you are replacing does not use animations, for example sights and other attachments, you don't need to bother with all those text files- just compile the same as you would for any other source engine game. You can still do it this way if you want- it's just unneccessary.

Credits

Model by Yogensia

Based on a tutorial by Mr. Brightside

Posts

  • 3y
    2REK avatar
    2REK username pic Joined 6y ago
    Offline
    1,526 points Ranked 3397th
    10 medals 1 rare
    • 2nd Place - Famous Landmarks Mapping Contest Medal icon
    • Unlocked Treehouse VIP clearance Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • 1 year a member Medal icon
    • 2 years a member Medal icon
    Finally some good stuff for Dlender users :)

    10

  • 3y
    Odec3D avatar
    Odec3D Joined 3y ago
    Offline
    > **Posted by Se7en.** > > > **Posted by Odec3D** > > > > > **Posted by Se7en.** > > > > > > Be careful when replacing guns, unless the sights are aligned you will run into that problem, also attachments > > > > > > Is there any way to go around this? Some sort of path that can be edited to allign the new weapon/sights? > > Not without editing the existing animations, and atm it's possible but very painful, as you'd have to recreate the iron sight animations Understood, thanks!

    10

    Kiwinite
  • 3y
    Se7en. avatar
    Se7en. username pic Joined 8y ago
    Offline
    586 Studios Flag Affiliation: 586 Studios
    3,854 points Ranked 1296th
    21 medals 4 rare
    • 2nd Place - Summertime Skinning Contest Medal icon
    • 6 years a member Medal icon
    • Returned 1000 times Medal icon
    • Reached 50 subscribers Medal icon
    • 6-10 Entries! GameBanana’s Christmas Giveaway 2014 Medal icon
    • Became a Studio Leader Medal icon
    Se7en. avatar
    Se7en.
    586 Studios Flag
    Affiliation
    586 Studios
    > **Posted by Odec3D** > > > **Posted by Se7en.** > > > > Be careful when replacing guns, unless the sights are aligned you will run into that problem, also attachments > > > Is there any way to go around this? Some sort of path that can be edited to allign the new weapon/sights? Not without editing the existing animations, and atm it's possible but very painful, as you'd have to recreate the iron sight animations
    Whatever it is, idk avatar
    Mantra
    Whatever it is, idk
  • 3y
    Odec3D avatar
    Odec3D Joined 3y ago
    Offline
    > **Posted by Se7en.** > > Be careful when replacing guns, unless the sights are aligned you will run into that problem, also attachments Is there any way to go around this? Some sort of path that can be edited to allign the new weapon/sights?

    10

    Kiwinite
  • 3y
    Se7en. avatar
    Se7en. username pic Joined 8y ago
    Offline
    586 Studios Flag Affiliation: 586 Studios
    3,854 points Ranked 1296th
    21 medals 4 rare
    • 2nd Place - Summertime Skinning Contest Medal icon
    • 6 years a member Medal icon
    • Returned 1000 times Medal icon
    • Reached 50 subscribers Medal icon
    • 6-10 Entries! GameBanana’s Christmas Giveaway 2014 Medal icon
    • Became a Studio Leader Medal icon
    Se7en. avatar
    Se7en.
    586 Studios Flag
    Affiliation
    586 Studios
    Be careful when replacing guns, unless the sights are aligned you will run into that problem, also attachments
    Whatever it is, idk avatar
    Mantra
    Whatever it is, idk
  • 3y
    Kamsta99 avatar
    Kamsta99 Joined 5y ago
    Offline
    306 points Ranked 14080th
    I just wanted to do it; D
    Bananite

Embed

Share banner
Image URL:
HTML embed code:
BB embed code:
Markdown embed code:

Credits

Key Authors
tigg
Special Thanks
Mr. Brightside avatar
Mr. Brightside username pic Joined 11y ago
Offline
22,683 points Ranked 201st
22 medals 2 legendary 3 rare
  • Reached 100 subscribers Medal icon
  • 10 years a member Medal icon
  • 6 years a member Medal icon
  • Returned 1000 times Medal icon
  • Reached 50 subscribers Medal icon
  • Reached 1,000 Points Medal icon
original ins guide

Submitter

tigg avatar
tigg Joined 7y ago
Offline
7,023 points Ranked 677th
30 medals 2 legendary 5 rare
  • Submitted 30 Models Medal icon
  • Reached 100 subscribers Medal icon
  • Submitted 15 Models Medal icon
  • Returned 1000 times Medal icon
  • Reached 50 subscribers Medal icon
  • Received thanks 50 times Medal icon

tigg
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!
Sign up to access this!

Category

Details

Difficulty Level
Intermediate Difficulty

Attributes

Genre
Compiling

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Share on Google+

Stats

  • 8,503 Views
  • 6 Posts
  • 3y Submitted
  • 3y Modified

Scores

91 bScore
10 Rating

5 voters

Sign up to access this!

SEX! Ok, we got your attention. Mascot

GameBanana is one of the oldest mod sites on the net. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation - send modders points.
  • Post: Give modders your thoughts on their work.
  • Vote: Help your favorite modders win monthly awards.
  • Rate: Rate mods and help them stand out.
  • Flag: Alert moderators and warn members of problems with mods.
  • Watch: Get notified when mods are updated.

Interested? Sign up now!

Already a Bananite? Login

More from Submitter

WiPs by Submitter

bcp.crwdcntrl.net tracking pixel