Search this Thread |
![]() |
![]() |
morgade |
Blender GEOM Import/Export (Work in Progress) This is a GEOM (body meshes) import/export plugin for Blender . - Import: All data is imported into Blender (Vertex, Faces, Normals, Tangents, UVs, Bone Weigths and Vertex Colors) - Export: It reads a template file (the original geom file) to find the original vertex ids and normals. (Normal are adjusted only on moved vertices). Added vertex will be exported with the same vertex id of the nearest original vertex How to use: - Extract and copy the python files to folder Blender\.blender\scripts - Export GEOM using Postal or sim3pe - On Blender, File => Import => Sims 3 GEOM - Edit the mesh (*) - File => Export => Sims 3 GEOM - To export, you need first to select the original GEOM file (to copy id references, original normals and other data), then select output file (*) Editing problems - Do NOT remove vertexes and/or faces (or anything that changes vertex order, like extruding faces): Original vertex ids and normals are copied using the mesh vertex order. Changing this order in any way will mess export file - Do not change verts at seams as this will make seams visible in the game. Export script copies normals of unmoved verts from the original file, so, if seams are not touched, everything will be fine (this can be fixed in future). - You can add new vertexes or subdivide edges, as the export script will assign to new vertices the same vertexid of the nearest original vertex, but do NOT extrude faces as this will change vertex order - Do not choose wrong GEOM template file when exporting (resulting geom will not work). Take a look at teen elf ears: ![]() ![]() UPDATE - Added a morph import beta (select morph geom, then mesh geom to import a morphed mesh) |
|
Last edited by morgade : 25th Jul 2009 at 3:12 AM.
|
![]() |
#2 |
cmomoney
|
YYYEEESS! I'm glad somebody is working on this. Thanks for sharing! |
"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕] |
|
|
|
![]() |
#3 |
jadaytime
|
Are the body mesh files close at all to the object mesh files? This is such a big step already... |
|
|
![]() |
#4 |
morgade |
Posted update 0.2. Everything (Vertex, Faces, Normals, UVs, Bone Weigths, Vertex Colors) is imported to Blender. Gonna try export now. Edit: 0.2 had a stupid debug absolute path. Sorry ! |
|
Last edited by morgade : 15th Jul 2009 at 12:10 AM.
|
![]() |
#5 |
morgade |
Posted update 0.2.2 It now imports EVERITHING (including tangents and vertex color). Export is almost working. Take a look at teen elf ears: ![]() ![]() Now, to really finish exporting, i just need to understand how the hell the TailOffset value are calculated. Any ideas ?? |
|
|
![]() |
#6 |
quetzilla
|
This is only slightly related to this but I figured I'd ask -- is there a limit on the texture resolution for clothing meshes for example? As with TS2, most of the default clothing is relatively low-res and I'd kill to have clothes with better textures... |
|
|
![]() |
#7 |
WesHowe
|
Code:
#define HEADERLONGS 11 #define BLOCK1ALONGS 4 tailseek=4+TailOffset-((HEADERLONGS+BLOCK1ALONGS)*4); fwrite(&tailseek, 1, 4, fp); TailOffset in the above code is the actual offset of the start of the tail data section in the generated file. So what we are doing above is generating the number of bytes between the start of the next field (the tailsize) and the start of the tail data. So after export, you can read the tailOffset value, and use that value to fseek() from the current location. The tail contains the reference tables, so it takes just a few reads and seeks to get to the reference table, without parsing the entire file again. I suspect this was put in to make the game more efficient at runtime. The #defines are related to my method of building the (scenegraph) header, because in practice only a few values are ever variant in a GEOM (has only one part). I retain the TailOffset by caching the filepos when I generate the file, and then I go back and fseek() to certain locations, such as that, and "backpatch" in the final values. <* Wes *> |
|
|
![]() |
#8 | |
jadaytime
|
Quote:
It looks like it's working to me... Also, amazing work. People like you are the backbone of modding, from all people who own the Sims 3, thank you for all your whard work that you have put into making TS3 a much better place. |
|
|
|
![]() |
#9 |
cmomoney
|
Good work, Morgade! (the ears look good, by the way ![]() |
"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕] |
|
|
|
![]() |
#10 | |
morgade |
Quote:
Yep. This is what i'm trying to do. Actually I think I got the problem. Sims2Wiki says that tail is formed by flags, count1, bonehasharray, numtgi and references. So, I was expecting that this offset is used to get to the position of flags value. But looks like it is used to get to the position of numtgi. ![]() |
|
|
|
![]() |
#11 |
Tashiketh
Warrior Gryphon
![]()
|
TailOffset is calculated from the GEOM chunk, not the start of the RCOL resource. If you want to go straight to the tail chunk from the beginning, use this: - Record the offset of the start of the GEOM chunk (say, 44) - Add this to the TailOffset value output.Seek(tailOffset + startOfGEOM, SeekOrigin.Begin); Obviously, the 44 can change depending on the size of the RCOL chunk, hence why you have to do it dynamically. This method should take you right to the Flags value. ![]() Note also that the TailLength seems to correspond more to the length of the TGI64 list, and doesn't include the Flags/count information just prior to it. |
Story books are full of fairy tales, of Kings and Queens, and the bluest skies. |
|
|
|
![]() |
#12 |
xanathon
|
Very nice work, Morgade, thanks for the effort. I fear I have to regrapple the heavily nonstandard Blender GUI... ![]() |
happy simming, Xanathon Xanathon's Laboratory :: WishList .: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :. |
|
|
|
![]() |
#13 | |
WesHowe
|
Quote:
Well, you can blame me, as I wrote the original parts of that spec. But yes, it goes to the TGI count, and the length would be ((4*number of tgis)+1)*sizeof(long); <* Wes *> |
|
|
|
![]() |
#14 |
morgade |
Export is now usable. Thanks for all your help ! To export, you need first to select the original GEOM file (to copy id references, original normals and other data), then select output file (*) Editing problems - Do NOT remove vertexes and/or faces (or anything that changes vertex order): Original vertex and normals ids are copied using vertex order. Changing this order in any way will mess export file - Do not change verts at seams as this will mess with normals. Export script copies normals of unmoved verts from the original file, so, if seams are not touched, everything will be fine (this restriction can be fixed in future detecting seams on export). - As i'm writing this text, i'm wondering what happens if some vertexes/faces are added to the mesh ... (testing later) - Do not choose wrong GEOM template file when exporting (resulting geom will not work). Well. A mesh modding tutorial with Blender is needed now. We also need the specs of MODL chunks to edit objects ! This one don't tell much :p |
|
|
![]() |
#15 |
AnnieBonnie |
YESSSSSSSSSS!!!!! Sorry...I over reacted.... |
|
|
![]() |
#16 |
mason666
|
Exellent ^^ |
|
|
![]() |
#17 |
morgade |
Updated to version 0.5 Now you can add new vertexes to the mesh or subdivide edges. The export script will assign to new vertices the same vertexid of the nearest original vertex (so, your new vertexes will deform with CAS sliders) Do NOT extrude faces as this will change vertex order I was able to add real nipples (with depth) to female meshes subdividing edges. I don't know if this kind of content is allowed here. Posted at the adult site (waiting in moderation queue) |
|
|
![]() |
#18 |
moondragon77
Lab Assistant
Join Date: Feb 2005 |
WOW. I may actually be able to create something worth sharing for sims 3. I'm certainly going to try with things like this making it possible. Thank you sooo much! |
|
|
![]() |
#19 |
AnnieBonnie |
Excuse me...are you going to release those elf ears? I do hope so....please? *puppy eyes* |
|
|
![]() |
#20 |
daluved1
Mother Function
|
Quick n00b question, where are the ".blender\scripts" folders? I checked under program files and I only have "Blender Foundation\Blender" no sub-folders. \ EDIT- Ah ha I feel dumb ![]() |
"Holy Shift! Check out the asymptotes on that mother function!" |
|
|
|
![]() |
#21 |
hisui_hana
|
All the meshes done using this program replaces the default? |
|
|
![]() |
#22 |
jmtmom
Forum Resident
Join Date: Oct 2005 |
Elf ears, you say!!?? I'm not too proud to beg for these. I am stunned that EA left them out of Sims 3. Excellent work everyone. This game will actually not suck once you talented folks are done with it. |
|
|
![]() |
#23 |
Sammy79
|
Hey wait, hold everything. With these ears, are you editing the sim's actual face in Blender? If so, how do you get the face back onto the sim? I've tried looking at the contents of a .sim file and can't figure it out :-\ |
Please don't PM/IM me with requests |
|
|
|
![]() |
#24 |
cmomoney
|
Have you considered doing a plugin for MODLs? |
"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕] |
|
|
|
![]() |
#25 |
daluved1
Mother Function
|
I seem to be having some import troubles. I extracted the GEOM scenegraph and everything, but when I try to import it into Blender, I get an error....and the mesh fails to load. I installed the scripts correctly and the Sims 3 GEOM extension importer shows up, but it just won't load =/ Any thoughts as to what's wrong? |
"Holy Shift! Check out the asymptotes on that mother function!" |
|
|
|
![]() |