[Bf-python] Vertex normal bug?

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Feb 27 16:53:48 CET 2013


On Tue, Feb 26, 2013 at 11:25 PM, Ryan Southall
<R.Southall at brighton.ac.uk> wrote:
> I have a script that uses
> Code:
> mesh = obj.to_mesh(bpy.context.scene, True, 'PREVIEW', calc_tessface=False)
> mesh.transform(obj.matrix_world)
>
> to give me world data for an object obj. This correctly returns world space
> face normals & position, and vertex position, but incorrect vertex normals.
> I have to accept first any rotation of the object to get correct vertex
> normals.

I think you have to call mesh.update() to recalculate the vertex
normals. This is not done on every operation for performance reasons.
The face normals are computed on the fly from vertex positions so
those would be up to date automatically.

Brecht.



More information about the Bf-python mailing list