Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Pettifogging Legalist!
retired moderator
Original Poster
#1 Old 1st Feb 2010 at 3:59 AM Last edited by plasticbox : 2nd Feb 2010 at 12:47 AM.
Default [SOLVED] Sims3 object import/export (Milkshape) breaking normals and UV maps
It would appear that exporting or importing from Milkshape with Sim3 Object Export / import is breaking the normals somehow.

I'm meshing/mapping in blender; I only do the Milkshape circus in order to get stuff into the game.


Here's how it looks after importing an obj (I can save it and re-open it, it always looks like this):


Here's how it looks after exporting to .sc3asc, making a new file and importing the same .sc3asc again (AutoSmooth was always off; I did not do anything in Milkshape – just imported, renamed the groups, and exported):


This is how it looks in game: normals are broken; smooth edges; also the UV seems messed up in places:




This is how it looks in blender – normals look OK; everything is expicitely set to Solid (and the stretched face on the one leg is definitely not in my map):


I tried to export without normals from blender; while that seems to get rid of the messy smoothing, it completely breaks the lighting so that's not a solution:


Is this a known issue? Any idea how to get rid of it? Is there any way to view/edit the normals in Milkshape at all? I didn't find anything, so all I can go by is the render preview.

This is blender 2.46, Milkshape 1.8.4, S3OC 0912-13-1531, S3PE 0912-13-1729.


Another, unrelated problem: how does one edit the shape/behaviour of the indoor dropshadow? This is one of the "0001" LODs, correct? See the "shadows" screenshot – seems like both my object and the one that I've cloned it from are using the wrong shadow (which is actually the right one for mine, only that it doesn't change direction with the actual object).

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Advertisement
Alchemist
#2 Old 1st Feb 2010 at 4:04 AM
View normals in MS:

Tools/Selection Editor

What is this issue you're having with the indoor shadow? It should be the one that is in the first MLOD. The normal looking model that has a shadow. This one is the one that's giving you trouble?

Which table is your clone?
Pettifogging Legalist!
retired moderator
Original Poster
#3 Old 1st Feb 2010 at 4:19 AM Last edited by plasticbox : 1st Feb 2010 at 3:03 PM.
Re. tools/selection editor: that gives me a message about how my computer "only has a reduced-functionality reference device installed. Install the DirectX SDK to get the full reference device", and then crashes. I'll look into finding and installing that if I have to .. but if I knew what to do/avoid to fix this, I could probably easier do it in blender.

Re. the indoor shadow, the issue I'm seeing is that on the maxis table (left), the shadow has both the wrong shape and the wrong orientation, and on mine (right) it has the wrong orientation. See how the table is at an angle, but the shadow isn't? (That said, I forgot to check whether this also happens with lighting/shadow on High – I had it on Medium when I took the screenshot)

ETA: i'm not talking about the static dropshadow texture – that one's fine –, but about the one that's calculated in-game.


My table is the one in all of the pics .. the small, square one.


ETA: re. the directX stuff, is it this one: http://www.microsoft.com/downloads/...&displaylang=en ?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#4 Old 1st Feb 2010 at 5:05 AM
What does the uv map look like after the "circus"?

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#5 Old 1st Feb 2010 at 5:41 AM Last edited by plasticbox : 1st Feb 2010 at 5:57 AM.
cmomoney: that was a good question, thank you. Seems like the UV map is damaged. I have no idea how I can see it in milkshape, but I exported an .obj (from the just-imported .sc3asc) and checked in blender … >.<

"Before" is the original map; the missing/stretched faces on the front left leg are selected on that one. "After" is the exported-imported-exported-imported one. Legs are haywire, and one of the faces of the table top side exploded all over the place (I didn't even see that in game, but it's on the backside ..).

The faces on the front side of the tabletop are intact on the UV map though, so I guess there must be something else still wrong. (With "front" I mean the side with the drawer.)


I have no idea how to fix this, if it's due to the export/import =/.


ETA: i just checked, for comparison: importing an obj in Milkshape, exporting as obj and importing in blender again leaves the UV intact. So it definitely has something to do with the Sims-3-exporting.

Is there any way to splice an UV map out of an obj and into the TS3 filepiles somehow?
Screenshots

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#6 Old 1st Feb 2010 at 6:20 AM
I think it has something to do with vertices being split in your map that aren't split in your mesh. Try remapping the table in Blender, but more like an unfolded box. In TS2, we could be creative with mapping to get everything to fit; not the same in TS3. I'm not sure, but it fixed it for me.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#7 Old 1st Feb 2010 at 6:37 AM Last edited by plasticbox : 3rd Feb 2010 at 3:52 AM. Reason: attachments removed
I unwrapped it with cube projection initially .. is that what you mean by "unfolded box"?

Also, if split vs. non-split vertices are the issue, could it help to split vertices in blender? I think I already tried that once, because the Sims 3 export thing always told me "123 vertices split" and I thought maybe it has a problem with that. I dont remember that I saw any effect, but at that time I was trying to fix a different problem so maybe I just didn't pay attention.

And a new UV map + texture wouldn't affect the borky normals and the smooth edges, or would it? I'm not really sure whether these are related problems or not.

Also, a blender question for you (cmomoney), if you don't mind: is there a way to tell blender to use less noise when baking a texture? If I knew how to do that, that would make it easier to experiment with remapping – right now I'm baking the shadows and then I blur/soften it in Photoshop (which means I'd have to go and re-blur every time I re-bake because the mapping is changed) – the noise was great for TS2, but in TS3 it looks a bit shitty.



I know that a blender export thingy is apparently in the works (yay!), but I don't think this is a blender issue. The files in question are fine as far as Milkshape is concerned, it's only the export/import that is the problem.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#8 Old 1st Feb 2010 at 5:39 PM
Wes explained it better in another thread (which I can't find for some reason, it's rather old), but if you split vertices in your uv map that aren't split in your mesh, the exporter tries to put them back together (because they share coordinates?). When it tells you you have split vertices, its not an error, its just letting you know. So when I'm mapping, I try to keep stuff together and with few seams ( I hope that makes sense).

As for the baking, are you using the "Approximate" method?

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#9 Old 1st Feb 2010 at 6:06 PM Last edited by plasticbox : 1st Feb 2010 at 6:28 PM.
I'm not sure what you mean by "seams" in regards to mapping (I may not be familiar enough with the proper terms – I basically map the way I think it makes sense, never looked at a tutorial or anything). I'll try looking for the thread you mean .. I honestly can't see any problem with my map nor do I have any idea how to make it better/simpler; if I'd re-do it I'd need to know what exactly to do or avoid. To me the fact that the map in the obj remains intact and only the exported/imported one is messed up (in a way that exactly corresponds to the messed-up-ness in game) seems to prove that there is something wrong with the exporting, not with the map.

What's "Approximate" method? I made the texture with Render > Bake Render Meshes > Ambient Occlusion. This was perfect for TS2, but for TS3 the noise is too much. Attaching a comparison of original vs. retouched, so that you can see what I'm after (I think the bottom of the "body" of the table was black in the original because those faces were underneath the bottom-of-tabletop faces on the map).

ETA: ooh, I think I found it! =) http://www.katsbits.com/htm/tutoria...ing_terrain.htm -- I didn't have the World panel enabled, that's why I never saw this. Cool cool.
Screenshots

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#10 Old 1st Feb 2010 at 6:28 PM
There's nothing wrong with the way your mapping, its the way the mapping is dealt with by the importer/exporter. And from my understanding, it has do this or it won't work in-game. I'll work up an example to explain better if you need me to (or you can crack open one of my objects).

"Mark seam" (CTRL+E in edit mode) tells Blender where to cut the mesh when unwrapping. You select an edge, mark seam, and Blender unwraps the mesh based on the edges you marked.

Under the World button and the AO tab, it gives you the setting for how to render the AO. The default method is Raytracing, which gives you very accurate results, and noise. Change that to Approximate and you should get the results your looking for. The other settings kinda depend on the difference between your high-res mesh and the low one.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#11 Old 1st Feb 2010 at 6:36 PM Last edited by plasticbox : 1st Feb 2010 at 6:51 PM.
Yay, found it! Somehow my edit is gone (or I forgot to actually post it =) -- http://www.katsbits.com/htm/tutoria...ing_terrain.htm -- I didn't have the World panel enabled at all, that's why I never saw these options. Setting it to 10 samples (with raytracing) is already nearly smooth, but I'll try Approximate as well. Thank you!


Re. seams: ah, you mean seams in the mesh. I didn't do that at all, since that mesh is basically just a couple of cubes (plus 2 cylinders for the handle) .. I just hit U > cube projection, then moved the faces where I wanted, then made the texture. The weird thing is that of the 4 sides of the tabletop, 3 work and one doesn't; of the legs (which are cubes minus the top and bottom faces) I think two are intact, the other two have one or two sides messed up .. but they're all mapped the same. For the legs I made one cube, then duplicated that 3 times, then removed the unnecessary faces of all .. and the whole thing is unwrapped all in one go. In other words, I can't find a difference between the legs that work and the ones that don't.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#12 Old 1st Feb 2010 at 7:06 PM
It's the "moved faces where I wanted them" part that causes the problem/splitting.

Marking seams isn't really necessary. It just helps you control the unwrap.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#13 Old 1st Feb 2010 at 7:23 PM
OK is this the post you mean (by Wes, then you, then Wes): http://www.modthesims.info/showthre...122#post2847122

".obj files are laid out differently from the way the game requires vertices to be laid out. You cannot share vertices in this game between faces if they do not share identical UV locations."

So in other words, when I move faces on the map, I must split the corresponding vertices in the mesh – is that right? So that instead of 2 triangles sharing one edge (2 verts) = 4 verts, I now make it 3 separate triangles (6 verts) with 2 verts each that just happen to be at the same location in space? Continuous planes in the mesh must be continous in the map too? (Just trying to make sure I understand it =)

I actually already tested splitting all vertices in the entire mesh .. but maybe I didn't notice that it fixed the map, because that was a version I exported without normals (which breaks the lighting) so I filed it under "not a solution".

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#14 Old 1st Feb 2010 at 8:30 PM
I don't do a lot of splitting, I just try to keep it continuous. For your table you could just fix the parts that are breaking on export. I've included a pic of the map of my recent upload (a clock). I really can't explain a "method" or why it works. Like you, I just do it 'til it works and remember what doesn't. I did use seams though.
Screenshots

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#15 Old 1st Feb 2010 at 9:08 PM
Turns out splitting doesn't help, because the resulting vertices seem to have no idea to what face they shold belong =P (so in effect the edge isn't split, only orphaned vertices are generated) .. I'm trying with the SplitEdge modifier now, and setting the edges to Sharp. Problem here is, if I'd simply map the legs as cylinders, the texture would be have to be mirrored at the outer edge which would be too obvious for my taste (it's very often going to be a wood texture which makes the mirroring very apparent). So I've got to split the mesh somehow.

Thanks for your help, so far … I'm curious to see whether it works (and maybe fixes the normals/smoothing problem too).

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Pettifogging Legalist!
retired moderator
Original Poster
#16 Old 1st Feb 2010 at 11:39 PM
Yayy I have acheived WORKINGNESS!



SplitEdges did the trick. The legs are now basically four separate planes each (just splitting them once wasn't enough apparently), which feels a bit silly .. but it's still just over 200 vertices which is OK for that kind of object, I guess.

The indoor shadows (not the static ones) are still weird though, but I'm not sure atm whether the EAxian ones aren't just as weird.

Now on to tweaking the presets ..
Screenshots

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#17 Old 1st Feb 2010 at 11:49 PM
Glad to hear it, and it looks great.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#18 Old 4th Feb 2010 at 9:59 AM
I've compiled my learnings into a small howto, here: http://www.modthesims.info/showthread.php?t=389933

Because those crucial bits of info (by Wes) are buried in an old thread on *body meshes* -- most likely object makers won't see it there.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Back to top