edit normals

I want to edit the normals of a mesh, so that they all will face upward (0,0,1).

here is what I came up with:


import Blender

mesh = Blender.Mesh.Get('name')

for vert in mesh.verts:
    vert.no = Blender.Mathutils.Vector(0,0,1)

Um, why isnt this working??
And what are the “face normals” in reality? Im not allowed to edit those.

Also, how can I tell in the script to work with the Active selection( the mesh which is selected) instead?

Blender automatically recalculates the normals to defaults at each frame update, i don’t know how to turn that off. This would be helpful to control and animate hair however. Anyone know how to prevent the normals to reset themselves?

Looks like you are dealing with blender 2.4x

This is how to do it in 2.5:

bpy.context.active_object.data.vertices

would be useful with a “per face” constraint maybe.

Thats bad if i cant modify the normals. really bad… :spin: I cant think of a workaround for my situation. :spin:
basically I need some objects in the file to have their normals facing upwards before export from Blender. I could do it in the exported text format file with a simple python script, but not all objects will be like that. And theres no way to know which ones will. Unless I have specific naming conventions for some objects which do. But that is very inconvenient in my case.