Here are the steps for creating a .mif file for an exstisting mesh to edit the attachments in the Viewer.
For those unfamiliar with the purpose of all this…If a model is adjusted or created, the attach points will need to be in the correct positions to hold a weapon or just about anything to be attached to a model. It may seem like a lot to do at first just to enable editing but once the process is understood its not much at all.
A text editor such as Notepad++ is needed.
***Injecting the new .mif data into a mesh to be used in game is beyond the scope of this tutorial. So this is mainly for Viewer use.
okay deep breath…
Open the Viewer and load a mesh that has attachments like a creature.
If you go to menu options: View and check “Attachments” or press F4, you will see the attach points are displayed as red and not able to be edited.
Depending if you do not have a “source” directory already, you will then need to manually create the same folder directory for the .msh you have selected.
The mesh I have selected in this case is: hero_00.msh
In Windows, go to Grim Dawn’s installation path:
C:\Program Files (x86)\Steam\SteamApps\common\Grim Dawn
create a folder called: source
For the mesh I’ve selected the created or existing directory would be:
C:\Program Files (x86)\Steam\SteamApps\common\Grim Dawn\source\creatures\pc
Now back in the Viewer go to File\Save MIF Data
A file with the .mif extention will then be (forced) created in the appropriate path:
C:\Program Files (x86)\Steam\SteamApps\common\Grim Dawn\source\creatures\pc
***If the folder dir. wasn’t previously created or existing, a dialogue will give you an error while trying to save to the correct file path. Luckily, the error also gives you the path where its trying to save it. This is why the source directory has to be manually created if not already present.
The Viewer can now be left open.
***This is when a text editor is needed such as: Notepad++
Locate the newly created .MIF file you’ve created an open it in Notepad++
In most cases it will be blank for a newly created one.
Now you will need to go to where the original mesh is located:
for me: C:\Program Files (x86)\Steam\SteamApps\common\Grim Dawn\resources\creatures\pc
Open the original .msh file using a text editor. (A backup of the mesh is not necessary as long as the data is unedited and saved)
Locate the text data portion in the file (usually at the end).
A whole series of attach points, joint, and rigidbody data will be found here.
Example:
AttachPoint
{
name = “SpecialHit04”
parent = “Bip01 Spine1”
origin = (0.000000, -0.000000, -0.000000)
xAxis = (1.000013, 0.000000, -0.000000)
yAxis = (-0.000000, 1.000013, 0.000000)
zAxis = (-0.000000, 0.000000, 1.000000)
}
…
For this tutorial it is best that the entire text data portion is kept intact.
All related to attach points, joint, and rigidbodies should be copied to the clipboard. (ctrl+c)
Paste the clipboard data into the blank .MIF file.
Save(replace) the file with the same name using the .mif extension.
note It is important the the .MIF file retains the same file name because it is referenced in the .msh file.
Now make a backup copy of the .MIF file in case you are unsatisfied with any future modifications.
At this point it is okay to close mesh file and the .MIF in the text editor.
Once you have the associated .mif file for the mesh, go to: File/Reload Resource in the Viewer.
Make sure under: View/Attachments is checked.
Double click on the .msh you are working on in the Viewer browser.
The attach points will display green for the particular mesh in the Viewer. Each point will able to be moved around by clicking on one that is present and using the 3D sliders.
Switching to the rotational mode (the circular arrow button at the top of the 3D view) allows any point to be rotated in any direction.
Toolbar/Attachpoint
Select… This will allow selection of an existing point from a list. Useful when a particular point is obscured by another.
Properties… This will allow you to name/rename a point. This becomes important to discover which bone (if any) an attach point is parented to. Existing attach points can also be swapped to another bone location by using the Parent: drop down list.
The panel that pops up also allows you to Add… any .dbr entity that is displayable/attachable in the Viewer to the currently selected attach point.
New/Delete Attach points are created at location: x0 y0 z0 or can be deleted at any time.
After making adjustments, File/ Save MIF Data will save all changes made into the .MIF file.
*If a mistake is made while editing, you can simply double click on the the .msh in the browser. This will revert back to the last saved .MIF of the mesh.