The Sims 2 GMDC Importer/Exporter for Blender 2.80+

SCREENSHOTS
749 Downloads 61 Thanks  Thanks 25 Favourited 5,220 Views
Uploaded: 19th May 2021 at 12:39 PM
Updated: 29th Sep 2022 at 10:10 PM
This add-on is only compatible with newer versions of Blender, that is, 2.80+.
(Official Blender website: https://www.blender.org/.)

It supports rigging data, two UV layers, morphs, custom normals (only for the basic shape), and bounding geometry.

Installation
1. Run Blender and change area to Preferences (see screenshot).
2. Choose "Add-ons" and press "Install...".
4. Install by selecting the io_ts2_gmdc.zip file.
3. Finally, enable "Import-Export: TS2 GMDC Importer/Exporter". (For easier navigation you may filter the list of add-ons by selecting "Import-Export" from the drop down list.

Now you can import GMDC files.

Importing
The importer works in two modes, Geometry and Skeleton.
To view the options, press the top right toggle button in the file selection window (if not already shown).

Geometry mode is used to import meshes from GMDC files, i.e., new mesh objects are added to the scene.
In Skeleton mode the importer loads data from CRES file, creates an armature object, and assigns armature modifiers to mesh objects.
In general, importing skeleton is not necessary for mesh editing, but may be helpful.

Some options here:
1. Remove doubles, which is useful for removing seams.
2. Importing bounding geometry (the one used for selection in the game).
3. Replacing inverse transforms previously stored in scene properties. (They are needed for animated meshes.)
4. Building an armature from all bones found in transform tree.

Bones are imported as vertex groups and initially named as "bone#{bone_idx}", that is, bone index is written after the number sign. Although bone names can be changed, do not delete or modify bone indices! Otherwise, the exporter will most likely throw errors, since bone indices are extracted from vertex group names.
Morphs are imported as shape keys.

By default, since version 0.91, the importer assigns custom normals.

Inverse transforms from GMDC files are saved in scene properties. This data is used by the exporter and included into generated GMDC file.

Exporting
Select "Rigging data" for animated meshes.
Depending on the material, your mesh may require tangent vectors.
Morphs can be exported in two modes (with and without normal vector differences).
If you want to export bounding geometry, you must specify the name of the mesh object.
New experimental feature: Aligning normals.
This is used to align normals of vertices on the edge of connection (e.g., neck, scalp). However, in order for this to work, you should place the GMDC files with target geometry (e.g., faces) into the target folder in add-on directory. (See add-on info to know the directory, screenshot #2). Then, the target list will display all files from the target folder. (Restart Blender to get the list updated.)

Be careful with morphs (i.e., shape keys). Maximum 4 morphs (and 4 bones) per vertex allowed!

Additionally, the gmdc_tools module is designed as a standalone. It is compatible with both Python 2 and Python 3. So, if you are familiar with Python, you can do things like:
Code:
>>> from gmdc_tools import load_resource
>>> res = load_resource('file.gmdc')
>>> geometry = res.nodes[0].geometry
>>> print(len(geometry.data_groups[0].vertices))
>>> 2368

In general, this add-on is an adaptation of my importer/exporter for Blender 2.49b.
Feedback on technical issues would be highly appreciated.

GitHub: https://github.com/djalex88/io_ts2_gmdc