Editing Attach Points in Viewer

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.

is this creating a mod or is it adding something to the game’s main database and resource files ?

if its a mod wouldn’t the files go in
C:\Program Files (x86)\Steam\SteamApps\common\Grim Dawn\mods\mod_name\source\creatures\pc

Neither.
In this case the .mif file only serves the purpose for editing attach points in an existing mesh.
So the file needs to be where the Viewer can read it.

Nice guide, too bad about meshview though, perhaps you can talk to the developer and convince him to make a GD edition.

For now it I guess it shows what to expect during this portion of model adjustments unless the devs actually release a more direct approach in their import/export process.

I’m loading the Yeti mesh (path: creatures/enemies/yeti) named yeti01a.msh in the Viewer and I created this path in source folder (creatures/enemies/yeti/) and I’m able to save it but the file is called Yeti.mif in the source/creatures/enemies/yeti/ folder and when I reload the mesh in the Viewer, none of the attachments display green.

Am I missing a step?
Clearly I am doing something wrong, doesn’t seem too complicated.

EDIT: Just tried to use the file you mention in your tutorial (a player head) and I get the file created (.mif) in the appropriate directory but again it’s blank and reloading the mesh (relaunching the Viewer aswell) and/or saving the MIF doesn’t allow me to move the attachment and create a full (not blank) MIF file.

Okay, so I’m kinda disappointed.

I woke up really early expecting someone to have answered me back so I can start working on my animation and noone responded.
I understand not everyone is familiar with these tools so it might be why the response are slow.

So since I had a lot of time…
I did some more research on the Titan Quest and found out that you actually need to convert the mesh file into .cvs with an external tool.
“Mesh2CSV - This program will take a .msh file and convert it to a human readable .csv file. It can also optionally create a .tga file of the 2D texture mapping points. This can be overlayed onto an actual texture in order to visualize the actual triangles used in game.”

The program is called Mesh2CSV and there’s also instruction on how to use the program.
“The usage is as follows:
Mesh2CSV input.msh output.csv
Will read “input.msh” and create “output.csv”.”

The problem is that I can’t find this tool anymore on the web…
Every links are down.

But let’s say I can find this tool somewhere, then where would I enter the command line? Windows command promt?

Also, I’m trying to understand how come this wasn’t mentioned in this guide.
Unless I was doing something wrong like I previously said, but I did follow these instructions to the letter.

From what I learned (not actually learning anything when I can’t get anything done) you have to convert the meshes into a .cvs file, open that in a text editor and copy the code inside the created blank .mif corresponding to the mesh file you are trying to edit.

I also downloaded the MeshView from Tamschi but I can’t get the meshes to load in it.
Do I need to copy the program into a specific folder or create a folder so it can read Grim Dawn files?
I couldn’t find any “clear” instruction.

Please someone help me :frowning:
I’m losing my head with this nonsense.

I believe the the devs had to change the way meshes work from Titan Quest to Grim Dawn

I think it was part of the deal of them buying the game engine

so that tool wouldn’t work anyway (I think)

hey jamesL, thanks for the respone!

Have you been able to create a .mif file with information on the mesh file in it?
When I load the Viewer after saving the mif, the attachment points are still red. I’m able to create new one and save them into the mif but I can’t edit the current ones.

I wonder if the OP didn’t just copy paste instruction from TQ and adapted them without testing them. Maybe he also forget to copy a very important and crucial step!

We’ll see, most modders are not as early as I am :slight_smile:

Lux can probably provide a few information.
I’ll try to contact him/her.

OMFG!
I found it :smiley:

After saving the mif file, I opened the mesh file of the Yeti with Notepad++.
I had already tried that last night but it display weird characters…

I DIDN’T THINK ABOUT SCROLLING DOWN!
OH GOD! :rolleyes:

Scrolled down the text and on row 4327 I found what I was looking for!
The code with all the attach points, bones and rigid bodies… etc etc…

Copied all the code into the mif file, reloaded the mesh file in the Viewer.
:slight_smile: Now I can edit the Attach Point! Yeah! :slight_smile:

Aw man!..sorry i didn’t get to you sooner.

Just so that there’s no confusion…The main thing that allows you to edit attach points in the Viewer is to have the blank .mif file saved in the correct folder directory. Sometimes the .mif file output name doesn’t match the actual mesh name…(otherwise you would be able to simply manually create a blank .txt file and change the extension to a .mif file.)

Resaving the .mif after the points are green in the Viewer saves the data that is edited (or even unedited). No additional program is needed up to this point. To examine and copy/paste the data into a .msh is when Notepad++ and a functional .msh editor comes in.

Glad you made it up to the same roadblock the guide leads up to though!

I’ll edit the original post to reflect this recent message.

Not sure what you mean when you say “Sometimes the .mif file output name doesn’t match the actual mesh name…otherwise you would be able to simply manually create a blank .txt file and rename the extension to a .mif file.”

I did create the path to save the mif file and it created a yeti.mif blank file.
I tried to name it the save as the mesh file and it didn’t do nothing.
So I followed your example and same thing happened with your example… so you’re saying your provided a faulty example in the tutorial?
That’s kinda evil… :smiley:

Anyway, I still don’t get what you meant by that… because after copying the code from the mesh to the mif file called “yeti.mif”, the one that was auto-generated, I was able to edit the attachment correctly.
So it was indeed the right output name.

But it’s alright.
I am not mad… I know how to do it now at least. :wink:

Oh yeah, I know we can’t create or edit the mesh because we can’t save them but what about a modified .anm file?

Do you know where I would need to copy the file in my mod folder?

I tried the source folder and Auto-Generate Asset on it but it was not a valid file format for asset.
I noticed there’s a folder named ‘resources’ in my mod folder, just like the one in the game folder so I’m guessing I need to copy my file there but how do I build it into my mod?
Can’t find ‘resources’ in the AssetManager so I’m guessing I need to use another tool.
The information is probably somewhere on the Titan Quest forum… sigh

If you know something please share with me :confused:

Okay, I think I need to add the new .anm to Creatures.arc so I can use them in-game.
I think you do this with the ArchiveTool but when I launch it, it will instantly close.
So my guess is that it’s a command line program… (yeah! fake cheers)

I opened the file in Notepad++ (always notepad++ when in doubt) and in the last lines of code I found these commands below.


commands: 
        -add <directory> <base> [compression (0-9)]: add a file/directory
        -replace <directory> <base> [compression (0-9)]: replace a file/directory
        -update <directory> <base> [compression (0-9)]: update a file/directory
        -remove <file> : remove a file from the archive
        -extract <location> [file] : extract files
        -database <location> [file] : extract database files
        -compact : compact the archive removing unused files
        -removeMissing <file> <base> : remove files not in the specified directory
        -list : list the files in the archive
        -stats : display the archive statistics
        -totalStats -database   Failed to open archive file %s.
    Failed to open archive file %s.
    -add    -replace    -update -replace    -update -remove -extract    -database   (%u/%u) Extracting %s
  -removeMissing  -compact    -list   -stats  Unknown command %s.

This provide me with a few information on how to use the tool but I still don’t know how to do it for a mod instead editing the base file.

For example, the file I used in the guide was: “hero_00.msh” …but the .mif that is generated by the Viewer actually ends up named: “hero_00_body.msh” becuase of the header in the mesh’s .mif data.

Not sure what went wrong there on your end as it has been explained correctly…
You never want to rename the .mif or else the Viewer won’t relate it to the specific mesh. That’s the whole point of the Viewer generating it instead of making one from scratch so you get the correct file name.

I believe it was Rhis that stated they were looking into a .msh import/export tool for the next v1.0.0.4 patch. This would be sweet because once you wrap your mind around attachments, there are so many obscure uses for it. :smiley:

Yeah, saw that post too :slight_smile:

I can’t wait for it, gonna create a head movement in the animation so the Breath looks better (sweeping motion).
If I can get to figure out how the ArchiveTool work…
I read something that I am going to try (probably tomorrow, just felt asleep lying in my bed and feel so dizzy right now).
Apparently, If I copy the new animations to the resources folder of Grim Dawn (if you are using Default path in the AssetManager) and build the archive in your mod, you will “save” your changes and the AssetManager will build a new ARC file containing the animations (or whatever you added to that folder).

I still need to figure out if this is the correct way to do it.

For now, I’m just gonna move back to creating skill and playing with the DBREditor.
This whole meshes, animations things can give you a terrible headache!

The engine should at least accept a replaced .anm with the same name because it worked for a .msh that i had messed up.
It was that hero_00.msh
In game I had the player mesh running out of the camera view any time I tried to move…then it would snap back into view as soon as I tried to move again.:rolleyes:

Hahaha!
Thanks for the response :stuck_out_tongue:

I’d suggest that the replaced anm should at least start with the same geometry, and then alter it from there after you get the import working.

Yeah, the inconvenience compared to Titan Quest is that the majority of the creature meshes had compatible animations because the bone names were consistent.
(left forearm = Bone_R_ForeArm on most creature .msh)