ScriptSpot

Forum topic · General Scripting

Normals flipped help.

By alexmbr · 2012-04-21

Description

Hi.

I have a mesh that when I load it, it appear with some normals flipped.
I already tried several scripts, but none is working the way I would like, because the mesh has some vertices not connected.
I need to force all the normal to be flipped to up or to select those normals that are flipped down.
If I manually select the flipped faces and apply a normal modifier, it works, but I would like to have the script doing that for me, since the mesh has lots of faces.

Does anyone knows how to do that?

Thanks

Comments (7)

alexmbr · 2012-04-22

Well, by hand I know how to do it.
But it is not a very good approach because it is a very very big mesh with several of those small elements flipped.
And that is why I was wanting to make this by script.

barigazy · 2012-04-22

By the hand :)
Select your model go to sub object mode
pick element that you nee to stay on scene
then Ctrl+i to invert and delete unwanted polys.
One suggestion: Read maxscript help all about
Editable mesh (meshOp Vert, Edge and Face methods)
and Editable Poly polyOp methods

alexmbr · 2012-04-22

Well, that didn't work either.

I just found out that those faces that I am trying to flip the normal, are being imported as separeted elements. That could be the reason for the welding part and the Unify normals not work.

Does anyone knows how can I select an element inside an editable poly?

weld verts by Threshold

barigazy · 2012-04-21

use this and then script that suggests br0t.
Change Threshold value if you need.

fn weldMeshVerts obj Threshold:0.1 =
(
meshop.weldVertsByThreshold obj #{1..(meshop.getNumVerts obj)} treshold
)
weldMeshVerts $

Well, that didn't work

alexmbr · 2012-04-22

to delete

alexmbr · 2012-04-21

Tried that. Unfortunaly it does not work. I think it is because it has some vertices not welded.