MTS has all free content, all the time. Find out how YOU can help to keep it running. Tell me how...

[UPDATE] Sims 2 GMDC Import/Export for Blender 2.79

by SmugTomato Posted 22nd May 2018 at 3:43 PM - Updated 23rd Feb 2021 at 7:56 PM by SmugTomato
68 Comments / replies (Who?) - 15 Feedback Posts, 1 Thanks Posts
Picked Upload! This is a picked upload! It showcases some of the best talent and creativity available on MTS and in the community.
This add-on will not work with any Blender version more recent than 2.79b and there are no plans of upgrading it to 2.8x in the foreseeable future.

Over the past few weeks I've been working on a fully featured GMDC Importer Exporter for Blender 2.79, It has now reached the point where it has reached a stable point from a user perspective.
This means that it should be fully functional and no major changes should be happening, though if you find something broken feel free to tell me in the comments.

Quote:
Update version 0.2.1B [26/05/2018]
  • Fixed the 'Add Morph' button creating the wrong morph names in some cases.
  • Morphs are now synchronized across groups, Make sure to press 'Synchronize Morphs' before exporting.
  • Added support for custom bounding meshes on unrigged objects, to create one add a mesh object parented to the container. the name must contain '__bounds__' without quotes, or it will be ignored by the exporter. This step is not required but is recommended on higher poly meshes, as it can drastically lower the polycount of the invisible mesh.


Supported
- Objects (Including Shadow Meshes)
- Rigs
- Sim Meshes
- Bounding Meshes (Static and Animated)
- Morphs
- Changing vertex order (Adding/Removing vertices)

Limitations
- Face meshes are not supported
- Only one UV layer is supported

Installation
In Blender go to "File > User Preferences > Install Add-on from File"
Navigate to and select the add-on zip you've downloaded, then still inside the add-ons section, look for "Sims 2 GMDC Tools" and activate it by clicking the checkbox.


Scene Structure
The imported scene consists of an empty container object, one or more mesh objects and on rigged meshes an armature object.


How to Use
Import a GMDC file, either through the newly added UI panel or the Import/Export menu.
Make any edits you want to make, taking note of the information below.

Morphs
Editing of morphs is done through shape keys, you can either manually add them through the shape keys panel or by clicking 'Add Morph' inside the add-on's panel.
I recommend adding morphs through the add-on's panel as this will ensure proper naming.
As an added note to working with morphs, make sure all shape keys have the same order on every group.
For example, if one mesh has this order: [0] base [1] botmorphs, pregbot [2] botmorphs, fatbot, make sure every other mesh follows this order. I may implement a feature to automate this in the future.


Rigged meshes
Before exporting a rigged mesh, make sure to limit and normalize all bone weights.
First, make sure to limit the amount of bone weights to 4.
This can be done by selecting an object, pressing spacebar, typing 'limit' and selecting 'Limit number of Weights per Vertex' and setting the limit to 4.
After that you'll want to normalize all weights.
This can be done by selecting an object, pressing spacebar, typing 'normalize' and selecting 'Normalize All Vertex Groups'.

If you're working with a bodyshop mesh, you can apply a neck fix to all required objects. This will prevent sharp lines in a sim's neck.

Hard edges can be defined with marking them as sharp, the exporter will then make sure to split the edges when required.

Exporting
To export your finished mesh, select either the container object or anything inside it from the hierarchy.
With the aforementioned selected, click export from the menu or the add-on's panel and save.
Then simply continue as if you were using Milkshape.

GITHUB LINK

I hope someone finds it useful.
Tags: #gmdc, #blender, #2.7x, #2.79, #import, #export, #add-on

Operating System: Windows Linux Mac OS X
Utility Type: CC Editors Meshing Tools
Plugin Type: Blender

You must have the expansion or stuff packs listed below installed to use this custom content. Please see the post text for any exceptions.

Sims 2
Key: - File was updated after upload was posted
Filename - Tip: You can click the magnifying glass to see the archive contents Size Downloads Date
sims2gmdc_0.2.1B.zip | Update

Size: 47.8 KB · Downloads: 1,599 · 25th May 2018
47.8 KB 1,599 25th May 2018
Don't forget to Thank the creator after downloading! Use the Thanks button located above the screenshots above.
Basic Download and Install Instructions:

1. Download: Click the download link to save the .rar or .zip file(s) to your computer.

2. Extract the zip, rar, or 7z file.

3. Place in Downloads Folder: Cut and paste the .package file(s) into your Downloads folder:
  • Origin (Ultimate Collection): Users\(Current User Account)\Documents\EA Games\The Sims™ 2 Ultimate Collection\Downloads\
  • Non-Origin, Windows Vista/7/8/10: Users\(Current User Account)\Documents\EA Games\The Sims 2\Downloads\
  • Non-Origin, Windows XP: Documents and Settings\(Current User Account)\My Documents\EA Games\The Sims 2\Downloads\
  • Mac: Users\(Current User Account)\Documents\EA Games\The Sims 2\Downloads
  • Mac x64: /Library/Containers/com.aspyr.sims2.appstore/Data/Library/Application Support/Aspyr/The Sims 2/Downloads
Need more information?
 
68 Comments / Replies (Who?) - 43 Feedback Posts, 18 Thanks Posts
Hide Thanks Posts for this thread (Show only feedback)
Page 3 of 3
Lab Assistant
Original Poster
#51 Old 30th Apr 2019 at 3:06 PM
Quote:
Originally Posted by mixa97sr
So from little experimentation that I was doing with face morphs (documentation in here calls them face blends, which is how EA also named them but they are actually valid morphs just like body morphs are), it seems that both milkshape and blender have few problems importing and even more problems exporting them.

So I don't know if this is new, but I managed to export all of the low poly face (LOD15) face anim morphs, and I managed to get most of the high poly ones (the rest I restored precisely using all the broken ones and the two SMD ones that were all of them merged together nicely). However, which is also a problem with import probably, I wasn't able to export them from both milkshape and blender because, well numbering reasons.

Documentation on this says that there can't be more than 4 morphs per vertex in a group, which is exactly what the export errors say. But I'm wondering, why and how? Because the face in game obviously has more than 4. In fact it has 27 of them, and I will make a documentation on what each of them does and how it looks and works).

What I'm wondering is if the plugin can somehow be changed to include more than just 4 morphs on export per group? This would make change of sims face mesh and import of custom face animation possible, and even ability to add alpha detailed lashes (which is why I even started this and made this discovery). That's why I would like to see modding tools somehow include this. But if it's impossible, it's impossible I guess.


It's as the documentation says, you can't have more than 4 morphs per vertex in a group. Technically you could have more than 4 morphs per group but this is unsupported by either the Milkshape plugin or my Blender plugin. The reason you can only have 4 per vertex is because morph data is stored as 4 bytes per vertex.
That being said, at the time I was trying to decipher the GMDC file structure while also being new to python and trying to maneuver the Blender API, this all led to some questionable coding decisions and spaghetti code that's pretty hard to maintain sadly.

I'd probably have to do a complete rewrite at this point to add big new features like supporting face morphs, which is something I don't see happening anytime soon.
Lab Assistant
Original Poster
#52 Old 30th Apr 2019 at 3:26 PM
Quote:
Originally Posted by d4RE
This all may be moot, since I was using version 0.2.0B, but I'll leave the info in case the update I just downloaded doesn't fix it:

I extracted some recliner GMDCs using SimPE , then used your importer to get them into Blender. Got this error message for each one: {{see attached picture}}
Basically, what happened was that it imported the GMDC, minus the groundshadow mesh and minus the larger chair mesh (there are two chair meshes with the same subset name).

I was curious if this was related to the lack of support for more than one UV layer, or if it's something that can be corrected in your code. If not, then is there some way to workaround it, like maybe renaming one of the chair meshes, or altering the UV mapping with a third party program before importing the GMDC?


Unrelated ( maybe ) - I successfully used the importer to put an armoire GMDC into Blender, and everything seems to be exactly as should be; EXCEPT, the tails of all the joints are at (0,0) instead of the coordinates of their parent joints. Any way to add support for parent-child relationships of the joints during the import/export of the GMDC? Or, is that purely info from the CRES, and I need to stay mindful to edit it myself for each mesh imported?

Thanks again for the great program, and for your time answering my questions.

P.S. I would also love to see an ANIM exporter, if that's ever on your agenda.


From what I can see it's got something to do with morphs, I haven't really looked at the code in about a year now though.

As for the tails of the bones being at (0,0,0), that's normal behaviour. Bone hierarchy is stored in CRES files and there's no way to determine it from the GMDC as it only contains the transform(location/rotation) data, since Blender doesn't allow for 0 length bones the best I could do was put the tails at 0 and the heads at their proper position.

An ANIM importer/exporter is not on my agenda, it is on my list of 'maybe sometime' though.
Field Researcher
#53 Old 16th May 2019 at 6:40 AM
Quote:
Originally Posted by SmugTomato
From what I can see it's got something to do with morphs, I haven't really looked at the code in about a year now though.

As for the tails of the bones being at (0,0,0), that's normal behaviour. Bone hierarchy is stored in CRES files and there's no way to determine it from the GMDC as it only contains the transform(location/rotation) data, since Blender doesn't allow for 0 length bones the best I could do was put the tails at 0 and the heads at their proper position.

An ANIM importer/exporter is not on my agenda, it is on my list of 'maybe sometime' though.



@SmugTomato
OK, that gives me some perspective on how things should work. Thanks for looking into it.
Looks like I'm off to learn more about morphs.

___________________________

We have been stuck too long with "New Mesh" as the apex of creation.
_ WesHowe
Field Researcher
#54 Old 7th Jun 2019 at 8:32 AM
I'm not sure what this could mean, but sometimes when I go to mesh using parts from another creator, the base mesh they used shows up, instead of what it *should* be. Just now I found a dress with a top perfect for a vintage wedding gown, but when I got it into Blender, it showed up as a tracksuit. So, to make sure, I went through the process again (create recolor, create new package, link the two), and when I checked in Bodyshop, the thumbnail is correct but the model now shows a tracksuit.

This isn't happening with meshes from the game itself, only those made by other creators. Any idea as to what could be going on?
Lab Assistant
Original Poster
#55 Old 7th Jun 2019 at 10:23 PM
Quote:
Originally Posted by Joselle
I'm not sure what this could mean, but sometimes when I go to mesh using parts from another creator, the base mesh they used shows up, instead of what it *should* be. Just now I found a dress with a top perfect for a vintage wedding gown, but when I got it into Blender, it showed up as a tracksuit. So, to make sure, I went through the process again (create recolor, create new package, link the two), and when I checked in Bodyshop, the thumbnail is correct but the model now shows a tracksuit.

This isn't happening with meshes from the game itself, only those made by other creators. Any idea as to what could be going on?


The add-on just imports what it can read. If it loads a tracksuit the GMDC was a mesh of a tracksuit, probably something on the SimPE side or a mixup with filenames.
Test Subject
#56 Old 1st Oct 2019 at 9:39 PM
Hello! First of all, thanks a lot for the addon, it's really helpful and you did an amazing job. I have a question about normals though. If it isn't possible to not recalculate the normals, would it be possible to at least export custom normals? It's possible to transfer them from .obj files exported from SimPE (I've tried successfully), so it would be wonderful to be able to use them. Also I don't know if it will be helpful at all, but I've noticed that the .fbx import/export plugin can read and write custom normals without resetting them, maybe there's some code you could check out?
Lab Assistant
Original Poster
#57 Old 4th Oct 2019 at 10:10 AM
Quote:
Originally Posted by Sai Vi
Hello! First of all, thanks a lot for the addon, it's really helpful and you did an amazing job. I have a question about normals though. If it isn't possible to not recalculate the normals, would it be possible to at least export custom normals? It's possible to transfer them from .obj files exported from SimPE (I've tried successfully), so it would be wonderful to be able to use them. Also I don't know if it will be helpful at all, but I've noticed that the .fbx import/export plugin can read and write custom normals without resetting them, maybe there's some code you could check out?


To be honest, I don't expect to be working on this plugin anymore in the future. the GEOM file format is just too much of a pain to deal with. That being said, since it's GPL licensed anyone is free to change the code and redistibute it without asking me for permission.
Test Subject
DELETED POST
15th Nov 2019 at 2:46 PM Last edited by 3ttu : 15th Nov 2019 at 3:00 PM.
Default Problems with hair
This message has been deleted by 3ttu. Reason: oh nevermind
Test Subject
DELETED POST
1st Mar 2020 at 3:50 PM Last edited by 3ttu : 1st Mar 2020 at 4:00 PM.
Default medicine cabinet
This message has been deleted by 3ttu.
Field Researcher
DELETED POST
22nd Feb 2021 at 1:49 AM
This message has been deleted by Deastrumquodvicis.
Field Researcher
#58 Old 22nd Feb 2021 at 1:58 AM
Unfortunately, this addon is telling me it needs to be updated for 2.8x+ and it looks like nobody's done any work on that.

Requests? Yes! See my journal entry for palette options! (Shameless plugging of my Sim site)
Lab Assistant
Original Poster
#59 Old 23rd Feb 2021 at 7:51 PM
Quote:
Originally Posted by Deastrumquodvicis
Unfortunately, this addon is telling me it needs to be updated for 2.8x+ and it looks like nobody's done any work on that.

This is correct, the add-on will not work on Blender 2.8x+ and has been made specifically for 2.79 before 2.8 even got to beta.
Unfortunately updating this to 2.8 would require almost a complete rewrite due to Blender API changes and some questionable choices I made while I was inexperienced both with Python and the Blender API.
That, paired with the fact that GMDC files are quite complex to read/write compared to Sims 3 GEOM files has made this project quite a mess.
Mad Poster
#60 Old 10th Mar 2021 at 4:43 PM
OK, I have a probably super stupid question, but I can't find the answer anywhere - HOW do I add a fat/preg morph to a mesh with this? I usually do it in Milkshape, but I've downloaded some high-poly meshes that flatly refuse to be duplicated, so I thought this would be the perfect solution, but I have no idea what I'm doing. At all.
Lab Assistant
Original Poster
#61 Old 24th Mar 2021 at 3:41 PM
Quote:
Originally Posted by sushigal007
OK, I have a probably super stupid question, but I can't find the answer anywhere - HOW do I add a fat/preg morph to a mesh with this? I usually do it in Milkshape, but I've downloaded some high-poly meshes that flatly refuse to be duplicated, so I thought this would be the perfect solution, but I have no idea what I'm doing. At all.


Am I understanding correctly that you want to apply existing variations on the base mesh as shape keys? to do that you'd have to use the shrinkwrap modifier with project mode and apply as shape key, then rename the shape key appropriately.
Feel free to send me a PM if that didn't clear anything up
Test Subject
#62 Old 31st Mar 2021 at 11:00 AM
Default I can't export my mesh and it's killing me.
Firstly I love this since I have a much easier time working on things in blender. However, I have been working on a custom car model for days and have finally gotten the bones properly aligned and was ready for export, but it keeps throwing error messages like this one at me and I honestly have no idea what to do.

Side note, I didn't realize how easy modding for the Sims 4 was until I started playing the Sims 2. How did we ever get by back then?
Lab Assistant
Original Poster
#63 Old 31st Mar 2021 at 2:59 PM
Have you made sure to have the root GMDC object (The empty object containing all GMDC related things) selected when exporting?
Test Subject
#64 Old 1st Apr 2021 at 8:52 AM
Quote:
Originally Posted by SmugTomato
Have you made sure to have the root GMDC object (The empty object containing all GMDC related things) selected when exporting?


Yes, I have tried variations of selections. Whether it's the root container, everything inside the container, or everything INCLUDING the container, I still get the same error.
Lab Assistant
Original Poster
#65 Old 1st Apr 2021 at 9:25 AM
Can you send me the files in a PM so I can take a look at them?
Test Subject
THANKS POST
#66 Old 1st Apr 2021 at 10:00 AM
Okay, it's been sent. Thanks!
Page 3 of 3