-
17th October 2015, 18:15
#1
Corporal
[CoD2] How to export (almost) any playermodel from Source Engine to CoD
Hi, title says it, im going to show you how to export playermodels from source engine to cod(2) (Multiplayer only!!). Its not really a direct export since it requers some work, but its not too diffucult and im going to show you what you need to do.
Fits of all we will need some tools and addons to them:
1) Blender This is where we going to to most of our work.
1.1) Blender CoD Addon To export our models to CoD as .xmodel (Read readme inside repo on how to install )
1.2) Valve's Blender Source Tools To import source engine scene's and models into blender.
2) Gimp To edit and export/import textures for our models.
2.1) Gimp .dds Plugun To export color maps as .dds
2.2) Gimp .vtf Plugin To import textures from Valve's .vtf texture format
Or you can use something else to manage the textures, but i'm going to use Gimp in this tutorial.
3) Crowbar .mdl Decompiler To decompile Valve's .mdl model files back to it's referense
Now, when we all set up, let's get to work:
Let's get a playermodel, i'm going to use this Earthworm Jim model from Garry's mod Steam Workshop
earthworm_jim_player_model_508845623.zip
Now we need to use Crowbar tool to decompile this model: Just open Crowbar then navigate to the .mdl file and press Decompile:
Reference files will be placed in "Decompiled ($version_number)" folder
Now, we can proceed to a 'modelling'.
Open Blender, delete the annoying cube (also camera and lamp).
Now go to File-> Import-> Source Engine:
Now, navigate to your decompiled reference .qc file and import it:
Alright, you can see model now, but we still need to remove Source engine skeleton, select skeleton, go to Object mode and press Delete:
Okay, now let's import a skeleton from CoD2:
Download my CoD2 Skeleton blender project file
Go to Blender again and go to File -> Append:
Now navigate to my CoD2 armature project file and then select Object -> Armature:
Nice, but as you can see the mesh is slightly bigger than a CoD2 skeleton:
Have no fear, select model by pressing mouse 2 and then press 'S' and move your mouse down to scale it:
There we go, much better, now as you can see his arms does not match the CoD2 skeleton, let's fix it
Go to the Edit Mode and then to the Modifier tab and assign Armature as a modifier:
Now go to the Vertex Groups tab and find vertex groups related to his left/right arm:
Now select all vertex groups related to his arm (Clavicle, Forearm, UpperArm, Hand and all fingers), if you messed up with selecting you can always diselect or diselect all by pressing 'A' twice:
Good, good, now after you selected the whole arm, press the Pivot Center button and choose 3D Cursor
Now place the cursor above Jim's arm and Press 'R' to go to rotate mode and rotate the arm:
Try carefully rotate it so it would match the skeleton, if arm is too big/small feel free to scale it:
Remeber, it doesnt have to be a 100% match, but try doing as close as possible, now do the same for another arm:
Nice, but now comes the most annoying part, we have to rename every vertex group to its CoD2 reference, eeh.
Look at Armature bones and then to vertex groups, i hope this screenshots will help you understand which bone is which:
->
You can also look at this Perl script i made to rename bones automatically (to not redo this shit over and over again)
If you know how to run perl scripts, use it on a .smd file BEFORE importing it to Blender.
Now remove vertex groups that seems unnecesarry (in this case we got only 1 (ValveBiped.forward)) and now we need to create 3 more vertex groups: tag_origin, tag_weapon_left, tag_weapon_right
Tag origin must be the first, use arrows to move it and tag_weapons must come after j_whirst's:
That's it we done with the model, go to File->Export and export it as CoD .xmodel_export to your model_export folder but do not close Blender just yet.
Now let's do the textures, go to Materials tab:
Here you can see all materials this model are using.
Good, for Jim there only 2 materials, go to folder where your Source engine model was and go to Materials
Open .vtf file in Gimp (you may also assign this file extension to gimp):
No need to change anything just go to File -> Export As, and choose .dds and press Export
Select compression (if you don't know what that is then just use DXT5):
Now do the same for all the Materials you see in Blender.
And that's all, now all we have to do is convert everything using Asset Manager:
First - textures:
Then model (As Multiplayer Body):
And that's all! This is how it will look in the game:
Ugh, i hope i was clear enough with that tutorial, the way is not easiest on a planet but at least its possible.
Last edited by voron00; 17th October 2015 at 19:40.
-
The Following 9 Users Say Thank You to voron00 For This Useful Post:
filthy_freak_ (17th October 2015),hoek (18th October 2015),kung foo man (17th October 2015),Paho (30th January 2016),php (17th October 2015),serthy (18th October 2015),thOuMta (29th February 2016),Whiskas (10th January 2017),ysniper (28th March 2016)
-
17th October 2015, 20:31
#2
Well now, since we got this & a source map converter, it opens the door for people to make a CSS/TF2 remake/mod.
Nice work.
-
-
10th January 2017, 17:56
#3
Tried to compile my model.
bone 'j_mainroot' for bone controller 'pelvis' not found.
No idea, think im missing 3d model knowledge.
-
-
31st January 2024, 07:47
#4
very cool but there's no armature just for handmodel
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules