[Tutorial] Importing Diablo III models into Torchlight

JackalheadJackalhead Posts: 1,687
edited January 2016 in General Modding
Importing Diablo III Monster and Character Models Into Torchlight

Big thanks to SixShotOverdrive for being patient with me and explaining how to correctly export the models in a way that Torchlight can use them. :] Without his help, I never would have figured all this out. I apologize just in case it is written a little weird or doesn't make sense in certain parts. I wrote it while I was learning the process and haven't had a chance to review it yet, but I will soon.

What You Need:
1. Diablo MPQ Editor
2. D3AppConvert2Obj
3. D3TexConv_0.9
4. 3DSMax 2009
5. TorchED’s Official 3DSMax Exporter Scripts
6. ImportOgreXML_0.02 3DSMax Script
7. Ogre Command Line Tools 1.6.3
8. Diablo III Beta Client

STEP 1: MPQ EDITOR
1.) Open Diablo 3 MPQ Editor and load ClientData.mpq.
2.) Export the model you want from the ‘Appearance’ folder.
3.) Open Texture.mpq and extract the corresponding texture.

STEP 2: D3AppConvert2Obj.exe
1.) Put the .app model with D3AppConvert2Obj.exe under the C:\ root directory.
2.) Do a search for cmd.exe on your computer. Right click it and select ‘run as administrator.’
3.) Type in “cd..” twice or however many times it takes until the command line shows the main C:\ root directory.
4.) Type in “D3AppConvert2Obj.exe –f (exact name of the .app file)”
5.) Press enter. A new .obj file should be created.

STEP 3: D3TexConv_0.9
1.) Put the .tex file you got from Texture.mpq in the same directory as D3TexConv.exe.
2.) Drag and drop the .tex file onto the .exe file. It will open and process then tell you to press any key to close the application.
3.) Look in your C:\Documents and Settings\Compaq_Administrator folder to find the newly created .dds file.
4.) Open up the .material file in the monster’s that you’re replacing folder. Look next to where it says the .png file and rename the .dds file this exact name. Then open up the .dds file and save as a .png file of the same name.
5.) Put this new .dds and .png files with your new .obj file for now.


STEP 4: 3DS Max Part 1: Skeletons & Animations
1.) Navigate to your Torched\Media\Models folder and select a monster that has similar animations to the one you are importing from Diablo III.
2.) Copy and paste the entire monster’s folder to C:\Documents and Settings\User\Application Data\Runic Games\Torchlight\Mods\<your mod name>\media\models
3.) Grab the .MESH and .Skeleton files from this folder.
4.) Use OgreCommandLineTool’s OgreXMLConverter.exe to convert the .MESH and .Skeleton files into .XML files.
5.) Make sure the ImportOgreXml_0.02.ms is installed in 3DS Max’s plugin folder.
6.) Open the Mesh.XML file using the importer in Max. Import the skeleton as well and all of the animation skeleton files.
7.) Save this file as (name of monster).max.
8.) Click File -> Import and select the .OBJ file you created from the .APP file.
9.) Take a look at the name of the mesh’s name that you are replacing and take note of it.
10.) Delete the skin modifier to free the Torchlight monster’s mesh from the bones and then delete that mesh.
11.) Once the original mesh is deleted, rename the Diablo III mesh as “m_(monster’s name)”
12.) Rotate the Diablo III Mesh to line up with the bones that were just added and position them as close as you possibly can.
13.) Right click your mesh and select ‘object properties’. Check off both ‘Freeze’ and ‘See through’ then click okay.
14.) Align, rotate and resize the bones inside of the mesh so that they line up with it. When you are done, save the project.
15.) Unfreeze your mesh.
16.) Select your mesh and then go to the ‘modifiers’ tab with the button in the right-hand panel and from the drop down list select ‘Skin’.
17.) At the bottom of the screen, you’ll see ‘Bones’. Click ‘Add’ and select all of the bones and click ‘okay’.


STEP 6: 3DS Max Part 2: Weighting the Mesh
1.) Click ‘Edit Envelopes’
2.) Scroll down on the list of bones and look for the name of the bone that causes the model to distort when rotated. Select it. You should see it highlight in red in the display window.
3.) Make sure the check box ‘Vertices’ is checked under ‘Select’.
4.) Hold down the shift key and click and drag to highlight the vertices that distort.
5.) Once they are highlighted in white boxes, scroll down to ‘Abs Value’ and click in the box. Entering ‘1’, will make the vertices stick to the limb that is distorting and entering ‘0’ will make them hang loose.
6.) Continually try playing various animations to see all of the distortion and fix it.


STEP 7: Exporting the Mesh
1.) Export the .MESH file. This will create an .XML file in the 3DS Max \ export folder under My Documents. It will also create a .material file.
2.) Load up the animation called ‘Bind’. File -> Export and export it as the exact same name as the mesh file. For example, if you named your mesh file d3fetish, you will also want to name your skeleton file that. For the animation name, put ‘Bind’. Specify the frame range as ‘0-0’. This will create another .XML file.
3.) Export all of the animations one at a time, by double clicking them in Graboi’s plugin and then naming them appropriately and specifying the animation range (such as 0-60).
4.) Go under your 3DS Max Export folder and use the OgreXMLConverter to convert the new .MESH.XML and .SKELETON.XML files to .MESH or .SKELETON files.
5.) Copy the .MESH file, the .SKELETON files and the .material file and place them under a new media\models folder in your mods directory. Also, remember to copy and paste the monster’s .dds and .png files into this new folder as well.
6.) Copy and paste the .animation file from the original monster who’s skeleton you used. Rename it appropriately and put it in your mod’s model folder as well.
7.) Edit the monster's .material file to look like the following, in order to remove the blackness around the mesh:
material material_name
{
technique
{
pass
{
ambient 0.588 0.588 0.588
diffuse 0.588 0.588 0.588
specular 0 0 0 0
emissive 0 0 0
scene_blend alpha_blend
alpha_rejection greater 5

texture_unit
{
texture texture.png
}
}
}
}
8.) Copy and paste the entire model folder into your TorchED \ Media \ Models folder as well.

Now go into TorchED and swap out whatever model you want with your new model. :] Run the game and it should be in there. You should get something like this...

b6989v.jpg
«134

Comments

«134
Sign In or Register to comment.