- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Meshing >
- Blender - Aligning vertex normals? (blender 2.49)
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Meshing >
- Blender - Aligning vertex normals? (blender 2.49)
Posts: 11,006
Thanks: 423049 in 1121 Posts
I'm asking because of this kind of situation:
This is an EA mesh; it has a seam down one side which means there's two vertices and the edge will be slightly visible in game (depending on lighting). For all I know, aligning the vertex normals so they point in the same direction would be the only way to get rid of that seam completely (short of remaking the whole thing and mapping it cylindrically – with this object that would even be possible, but that's not always an option). Am I on the right track with this?
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.
Posts: 231
Thanks: 402 in 1 Posts
http://en.wikibooks.org/wiki/Blende...ices_on_a_plane
http://wiki.blender.org/index.php/D...pecific_axis.3F
Posts: 11,006
Thanks: 423049 in 1121 Posts
I want the light to be seamless so that the edge looks smooth under all circumstances (basically hide the fact that it is an edge at all), and to my knowledge that can only be done either by merging the vertices (i.e. removing the edge – which the game can't digest unless I remap so that the map is also seamless), or aligning the vertex normals. If there's any other way to acheive the same result, I'd be glad to know.
I don't know why EA mapped this like they did, but the current map isn't cylindrical like one might expect, it's flat (at least this round part is flat, didn't check the boxy bits since those can have seams all they want). For TS3 this means there has to be an edge in the mesh as well (see this thread where I'm quoting Wes explaining why: http://www.modthesims.info/showthread.php?t=389933 ). I'd prefer not to remap it because I want to use it as a default override, without shuffling around existing textures in game if I can avoid it.
On the other hand .. now that I can check this out textured in blender, I realise I only see the seam in Solid mode, not textured .. which gives me hope that the seam won't be visible in game. Maybe. I don't know what the game exactly does with the normals, of course.
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.
Posts: 4,419
Thanks: 2483 in 21 Posts
However, looking at the screenshots the nr1 looks alligned to me tho.
The only seam i see is the vertical line wich goes all the way up starting at nr2
The horizontal line is alligned correct.
Does Blender have a autosmooth function and if so can you turn it off?
Then you can weld the verts with autosmooth on, turn autosmooth off and ungroup the parts that need a seam, then regroup them all back.
This is not a good way when the mesh has morphs tho!
Posts: 2,832
Thanks: 6613 in 20 Posts
If you like to say what you think, be sure you know which to do first.
Posts: 11,006
Thanks: 423049 in 1121 Posts
The option of manual editing (or hopefully, a script) is exactly what I'm looking for =).
Blender has smoothing,
Problem is, blender knows nothing about the special needs of TS3 – it sees the user has made a seam, so the user wants a seam, so I'll give him a seam. I need a seam that acts as un-seam-like as possible, I just need to tell blender that somehow =P.
I'm not exactly sure what you mean by "turn autosmooth off and ungroup the parts that need a seam" but I believe it is also the exact opposite of what I'm trying to do – I want to visually get rid of the seam, while keeping two edges. I can't weld the vertices (that would be super easy) because the game can't deal with that in combination with how EA have mapped this object.
Also, this is a static object (it's the EA country column), no morphs involved.
Wes: I also suspect that blender has this =) .. I just need to find it. When I googled this I found a few discussions about how blender needs this, and they were all from 2004 or something so I hope someone has implemented it in the meantime. I've already looked through the Vertex, Edge, and Normals menus – I was hoping for a script or a yet-undiscovered button panel submenu or something. Most likely it's gonna be an easy to remember "N shift shift ctrl-E cmd-alt-F8" hotkey ..
I'm attaching another screenshot, perhaps this makes it easier to understand (rather than the two screenshots above) – I moved the selected faces away a little bit to show where the seam is.
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.
Posts: 4,419
Thanks: 2483 in 21 Posts
Just turn autosmooth on and weld those vertices on the seam wich makes it dissapear.
Then you should turn the autosmoothing off, and divide the object again on that spot.
Keep autosmooth off and regroup the parts back
Posts: 11,006
Thanks: 423049 in 1121 Posts
I don't know what you mean by "regroup the parts back" in this context – are you referring to the "smoothing groups" in Milkshape?
Exact steps that I took, maybe there is an alternative approach that would work better:
1. select two of the edges at the seam
2. Vertex > RemoveDouble (two are removed – this is the equialent to "weld" I would think) – now the vertex normals point where that of the righthand one was before
3. Normals > Recalculate – now the edge is smooth (just like I want it to look – but without the seam that I need)
4. Edge > Mark Sharp; Modifier: SplitEdge / From Sharp / Apply – now I have a seam but the normals are back where they were before.
..
I fiddled around a bit more and realised that when I have the whole object solid, the minimum I can set to smooth is one face. I can't select just an edge and make it smooth (technically I can, but nothing changes). Does that perhaps mean that the vertex normals in blender are calculated from the face normals? I don't know how this is in other editors – maybe Maya does it the other way around and that's why one can smooth individual edges there?
I also realised: when I select two vertices and Merge > At Center (or Merge > At Cursor), I get "Removed 1 vertex" and 1 vertex remains. When I select the same vertices and Merge > Collapse, I get "Removed 0 vertices" and 1 vertex remains. Is this a glitch or is there a deeper meaning behind that?
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.
Posts: 231
Thanks: 402 in 1 Posts
Posts: 11,006
Thanks: 423049 in 1121 Posts
.. is this what you mean? I see no Align, do you mean the Merge options? That's what I did above (Remove Double is just faster when you have more than one pair selected, since it removes doubles in each pair but without merging them all together. I also tested individual pairs and Merge (that's why I saw the "0 Removed" thing), but no difference).
Um, but .. I just googled again and looking at the date of the last post in this thread: http://www.blender.org/forum/viewtopic.php?t=5156 .. it's been bumped on Dec 11, 2009, with "Bumping again years later because 2.5 is being worked on and IMO this problem has persisted long enough" – this makes me think it might not have been implemented, at least not in 2.49 (2.49 was already out in December, wasn't it?). I'm not familiar with the blender forums though; maybe that's just one stray thread and the feature/ability/script exists, just under a different name (I was searching for align "vertex normals").
e: also http://www.blender.org/forum/viewtopic.php?p=75374 .. "I can't believe its been 4 years since this need has been put out there and this detailed discussion has happened and Blender STILL doesn't let you edit vertex normals." (also from late 2009)
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.
Posts: 231
Thanks: 402 in 1 Posts
EDIT:
My mistake... I was looking at some text in a PDF on my harddrive not taking into consideration that the area it described was UV not mesh. My bad
MORE EDIT:
The website below has a normal smoothing script. The text that surrounds it is also interesting (for me at least):
http://www.macouno.com/tag/blender/page/2/
Posts: 4,419
Thanks: 2483 in 21 Posts
– I believe what you mean by "divide the object" is, make a seam again, i.e. split the edge? When I do that, blender immediately adjusts the normals to where they were before – |
There must be a setting to avoid that, i thought turning autosmooth off in the mesh tab would prevent it.
I can not imagine there isn't a way to turn autosmooth off because it will mess up every mesh you import that has been edited on the normals, like sims 3 clothing meshes for example.
Here are 2 identical boxes, one with autosmooth on and one with alligned normals.
There is a huge diffrence between the 2, try if you can import them without changing the normals?
boxes.rar (621 Bytes, 14 downloads) - View custom content | ||
Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- boxes.obj 1837 553 30% 26-06-10 12:56 .....A. C65C87D6 m3b 2.9 ------------------------------------------------------------------------------- 1 1837 553 30% |
Posts: 231
Thanks: 402 in 1 Posts
Posts: 4,419
Thanks: 2483 in 21 Posts
Its something sims 2 meshers couldn't figure out and it prevents them from making clothing meshes as those have edited normals on the neck seam(same with sims 3)
Maybe this is helpfull?
http://www.insimenator.org/index.ph.../topicseen.html
Last post
Posts: 11,006
Thanks: 423049 in 1121 Posts
Ceixari: thank you, I looked through that page before, but unless I'm missing something major those scripts are about (what blender calls) "smoothing" the actual mesh, i.e. moving vertices around, and this script offers the option to do so along the angle of the vertex normal. It doesn't seem to be doing anything with the vertex normal itself. But thanks for the link, I wanted to bookmark it anyway =).
Base: when I import the boxes they look identical to me – on import I can either use the SmoothGroups option or not ("surrounds Smooth Groups with hard edges"), then they're either both smooth or both solid. There's other import options too but this is the only one that makes a difference with regards to smoothing. Screenshots below. I know nothing about clothing meshes and have never opened one in blender, so I don't know whether this is to be expected or not.
But I now realised that with "autosmooth" you didn't mean the Milkshape thing (duh! I thought you were talking about that since you were asking at first whether it even exists) – yes, there is one, it's off by default (can't remember I ever used it). I repeated the test above, turning it on before merging the edge and off after that like you said, but it doesn't change anything. I believe all this does is that it sets faces to smooth/solid automatically based on the angle the user defines (and since the faces in question have no neighbouring face on that side, the angle is 360° so it won't make them smooth). Here's the documentation of this feature: http://wiki.blender.org/index.php/D...eshes/Smoothing
I quickly tested another (would have been very laborious) approach: merging the edge and duplicating or extruding it, but that also recalculates the normals immediately. blender seems to like recalculating normals.
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.
Posts: 231
Thanks: 402 in 1 Posts
yes, but Blender still recalculates the normals on import |
It's calculating normals because I'm telling it to recalculate the normals on import.
It is possible for me to show a window for the users to choose whether they want to recalculate the normals or not, but many of the S3ObjTool .s3ascg files do not contain normal coordinates at all, so the script recalculating the normals during import is seen as a help at least for myself.
I'm thinking the same is occurring on the TS2 .smd files, but I haven't looked at the files themselves. I'm guessing that's why bobcatben was recalculating the normals in his scripts.
Posts: 4,419
Thanks: 2483 in 21 Posts
It gave plasticbox his seam on the collum wich prolly isn't there on the default mesh.
I agree that on objects it wont make much diffrence but you can not use this setup for clothing meshes.
You will end up with a ugly visible seam on the neck/head, the waist(tops and bottoms seperates) and were the calves meet the feet/shoes.
The boxes should look like this when imported.
Posts: 11,006
Thanks: 423049 in 1121 Posts
Edit: Base, um .. are you aware that the tone of your last post is rather harsh? I can't tell if that's how you mean it or not since English is apparently not your first language, so it might be unintended.
Also, Ceixari's scripts are s3ascg import/export .. I'm not aware that s3ascg is being used for body meshes.
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.
Posts: 231
Thanks: 402 in 1 Posts
I can provide you with a test import script where the normals are not recalculated, let's see how that works.
As PB mentioned, the scripts will only work for objects.
s3asc_import_test.zip (6.0 KB, 13 downloads) - View custom content | ||
19645 06-26-10 15:47 s3asc_import_test.py -------- ------- 19645 1 file |
||
Description: Import Script without the calcNormals |
Posts: 231
Thanks: 402 in 1 Posts
Posts: 4,419
Thanks: 2483 in 21 Posts
Ill keep my mouth shut for now
Posts: 231
Thanks: 402 in 1 Posts
Posts: 2,832
Thanks: 6613 in 20 Posts
It's calculating normals because I'm telling it to recalculate the normals on import. |
This is actually a new variant on an old issue.
Leaning on my experience in writing importers (back through TS2), I leave the normals unchanged. Generally, it is the shadow meshes that have no normals, they just display black. How I manage this is I set the normals to zero, then when the normals are parsed, I overwrite that with the actual value. When no normals are present, the values are always zero and the object shows black... users can smooth them, but on export what they are set to is discarded anyway.
We have done enough "user training" over the years that MilkShape users know not to use "Autosmooth", because it was designed to force a normal recalculation.
As for tweaking PlasticBox's issue, if you can determine the vertex index value of the two vertices, and the group index, you can tweak those two normals using a calculator and notepad at the .s3asg file level. Normals are lines in the 'vbuf' section that look like this:
0 1 -0.007813 -0.007813 0.992188 |
The first digit is the vertex index (starts at zero and goes to number of vertices-1).
The second digit is the data type, 1 is the normal. The last three numbers are the normal data; X, Y and Z.
For smoothing, average the two X values and then replace both with that. Ditto for Y and Z. Recompile and you should be good to go.
Standard disclaimers on backing up your work, etc. As long as you are careful to have properly formatted numbers, the compiler will happily use the supplied values.
I know this is not the optimal solution, but if there are not too many problem seams then it could help rescue the work done already while a new solution is found.
<* Wes *>
If you like to say what you think, be sure you know which to do first.
Posts: 2,932
Thanks: 15576 in 28 Posts
This makes it pretty tough to work with it so it conforms to my new object instead of the old one. I can see the thing properly in the TCE but I can't see what changes are gonna look like in the view screen since all I see is solid black. So it's a little bit of work-around to deal with it. I have to bring the mesh in with Autosmooth on to see the shadow. Am I missing a setting or something that would make this task easier? Sorry again to be OT.
Posts: 231
Thanks: 402 in 1 Posts
- 3ds_import
- ac3d_import
- import_dxf
- import_obj
- import_smd (not standard... this is the TS2 import scripts)
- import_web3d
- ply_import
In two of the scripts I found the following comments:
ac3d_import
Some objects may be imported with wrong normals due to wrong information in the model itself. This can be noticed by strange shading, like darker than expected parts in the model. To fix this, select the mesh with wrong normals, enter edit mode and tell Blender to recalculate the normals, either to make them point outside (the usual case) or inside.<br>
import_smd
9/12/2007 version 0.3: reAdded importing of normals(results in some duplicate vertices's but fixes the normal problem, still recalculating them, but this keeps it from merging vertices's with different normals)
get the vertex data, excluding normals as they dont like to import correctly so we will just have blender recalculate normals at the end, after we remove duplicate vertices
Other Info:
The scripts that did not to a CalcNormal() mostly ignored the normals outright during the import.
Please Note:
As Wes notes above, if the imported files (groups) did not contain normals to start with I'm not exporting anything out.
Who Posted
|