Notifications
Clear all

[Closed] Normals and Normals

Hey Guys,
I wanted to write a script which would allow me to flip the normals of the faces of every poly face in my scene whose normals are inverted(ie they look black in color)…Now I managed to write a script which would allow me to apply a normal modifier to my objects but not specifically say which faces to flip it.

Could someone point me in the right direction?

Here is the script I wrote


[color=white]rollout[/color] Normalflip “FLIPnSmooth It”

(

button aboutButton “About This Script” ——— The Message Box

on aboutButton pressed do

(

messagebox “Select all your objects with the select
button first and then apply the normal flipper to them.
Same thing goes for the smooth.

)

button selectButton “Select All” —————For Selecting All The Objects

on selectButton pressed do

(

select $*

)

button flipButton “Flip It” —————-Applies A Normal Modifier to the Selected Objects

on flipButton pressed do

(

modPanel.addModToSelection (Normalmodifier ()) ui:on

)

button smoothButton “Smooth It” —————–Applies a smooth modifier to the Selected Objects

on smoothButton pressed do

(

modPanel.addModToSelection (meshsmooth ()) ui:on

)

)

createdialog Normalflip width:200 height:120


Regards,
Entrancea

2 Replies

In reality you would need to 1) simply use the Unify feature of the Normal Modifier, 2) you would have to use some sort of testing to find out which faces normals are pointing the wrong way. Option 2 will require some sort of ray hitting and other tests to find the incorrect faces. I really have no idea how to go about doing that though.

-Eric

Thanks for the tip dude…Well see I was thinking that when I select an object in my scene which has both its normals in inverted and non-inverted state,Then what if I do a if else loop where I could enable an option like a select button which would allow the user to select the Normal non-inverted face and then run through the script where i=1(for i=1 do) …and it will go like

If Normal !=i then flip the face (you know…run the command that flips the selected poly faces from edit polygons)

else ignore.

Your thoughts?

Regards,
Entrancea