[Addon] Recalc Vertex Normals

Recalc Vertex Normals

This addon manipulates vertex normals, stores them into an object property and
displays them in OBJECTMODE.

http://www.mediafire.com/conv/6b32c1c9654d418789641b9a65c69ec7be217e805d52de655e442dfb89c035634g.jpg

Usage:

First apply rotation and scale to the (mesh)object and set its shading to smooth.
Then go into editmode, toggle Autoreload/Autosave on and start editing.

Reload Normals:

Reloads previously saved normals.

Save/Autosave:

Every manipulation of the normals has to be saved, either manually with the
Save Button or by toggling Autosave on.

Size:

Changes normal display size.

Show / Hide:

Toggles the drawing of normals for visual feedback while editing.

Inv Sel:

Inverts vertices selection.

Cycle Sel:

Cycles through vertices on by one.

Copy / Paste:

Copies the normal of one selected vertex and pastes it to one or more selected vertices.

Translation / Direction thingies:

This controls can be used to assign a specific normal to selected vertices.
Normals will be saved directly after editing when Autosave is on.

Tree button:

For trees place the 3d cursor inside the tree, select the leaf vertices. The
unselected vertices will be skipped by the script, so the tree trunk and branches
will keep their unedited normals.
The leaf vertices normals will all point away from the 3d cursor location.

Foliage button:

For ground foliage select the vertices which will have ground contact, their
normals will be aligned to global z axis. The unselected vertices normals will
be pointing away from the 3d cursor.

Tested with blender 2.63

DL: http://www.mediafire.com/?vq7lckbu7q2uvo0

EDIT: Updated version for Blender 2.66:

DL: http://www.mediafire.com/view/?j8jla56bla0cae4

EDIT: New Version for Blender 2.66:

DL: http://www.mediafire.com/view/?xg2ozzdfk88a9ix

Looks great! It would be nice if Blender didn’t recalc the normals when edit mode is activated.
Maybe someone could write a modifier that freezes or saves the normals when applied.

Ditto as above, i’d love to import MoI 3D models without loosing vertex normals!

The new version could be a bit more useful. It was quite a struggle to
implement the modal operator for drawing the normals, but since blender 2.63
recalcs the normals already on entering editmode the addon was useless without
any visual feedback.

@ rebellion:
Your script inspired me to write mine :stuck_out_tongue:

@ metalliandy, Carozza:
Well, Blender still recalcs the normals but now you can save them before switching
into editmode and reload them in objectmode.
So if your imported model comes with custom normals the addon should be able to
save them.

Thanks adsn, that sounds like a step toward the right direction.
I’ll give it a try in a few days and report back.
Cheers! :slight_smile:

Damn, I don’t seem to be able to reproduce a mesh with critical vertex normals, to test this plug-in.
In the past I had a “standard” shape that, produced with MoI 3D, gave normal issues in Blender.
Will keep trying…

I’ll try to use you’r method to store vertex normal, in my Ase exporter so i can export the edited normals in UDK

This addon kicks all the ass ! Thanks.

I was having some puzzlement as to how to get the manipulated normals out of Blender using COLLADA.
It appears that the Blender COLLADA implementation will only send out vertex normal data on polygons that are ‘Shade Smooth’.

I really can’t think of a scenario when I would want to skew the normals on flat shaded polys, but I was confounded briefly when I was testing this addon and neglected to set shading to smooth on the exported object[s].

FBX works on flat and smooth shaded.

I just tried it. I wrote a simple obj importer that imports MOI’s normals correctly. The problem is that even if the normals are correct in the viewport they are recalculated when rendering in BI or cycles. I don’t think a script can change that.

So much appreciate addon ! I was so so so missing this feature. Thanks a lot!
PS. Works perfect.

This sucks! :frowning:

Sadly, this is the showstopper for me right now. I’d love to use Blender more and more, especially Cycles. But this shortcoming makes rendering CAD models impossible :frowning:

Thanks for this tool! Has anyone been in contact with the foundation about getting this recalculation-on-render stuff fixed in the trunk? It’s a serious bug and I found a patch for it in the patch tracker, but it’s possible it will never get into the trunk if it goes unnoticed…

http://projects.blender.org/tracker/?func=detail&atid=127&aid=33009&group_id=9

Hum does this addon work anymore? It seems to me that while normals are shown properly in object mode Blender does not use these normals in viewport lighting calculations…

Just tested it with official blender 2.64 build and it works fine in the viewport and gameengine.
The only case where it doesn’t seem to work is when the object is flat shaded.

Thanks, I had a flat shaded test object.

There are clearly some things the Blender Foundation stubbornly clings to, and this seems to be one of them. Have you considered implementing this as a modifier, if that’s at all possible?
Also, using another mesh from which to deduce normal direction, as in this image: http://dl.dropbox.com/u/5913234/normalthief_tests.jpg
The grey shape on the left is another mesh which is used to guide the normals, and allows for more complex shapes than your current 3d cursor method (although that one’s really effective as well for certain shapes, good idea!)

Lovely work, I’ll be using this from now on.

My kingdom for a custom normals modifier! (and split vert. normals too…)

i really like this addon and i use it alot. But in 2.66 it has a little error on line 481: ‘Region’ object has no attribute ‘callback_remove’.
It occurs when i want to hide the normals again after clicking ‘show’. Except that, as far as i use it everything still works.

Hi, I fixed it. Check first post for download link.