Page MenuHome

Clarify BMesh operator documentation: normal_update
ClosedPublic

Authored by Jon Denning (gfxcoder) on Mar 17 2022, 2:59 PM.

Details

Summary

The normal_update methods of BMVert, BMEdge, BMFace, and BMesh are not clear on some behaviors. These behaviors are listed below and are included in this diff.

Calling normal_update on a BMVert that has no adjoining faces (is_wire is True) will set the vert's normal to a zero vector. While this is not an unreasonable result, this can be unexpected and cause confusion. Also, normal_update for a vert does not update the normals of adjoining faces.

Calling normal_update on a BMEdge first calls normal_update on any adjoining faces, then calls normal_update on the two edge verts. An edge has no normal, yet it seemingly has a way to update it? Also, the vert normal will be a zero vector if the vert is_wire is True (see prev note).

Calling normal_update on a BMFace does not update the normals of face verts.

Finally, calling normal_update on BMesh will call normal_update on all faces and verts. (see note on vert normal when is_wire is True.

note: the normal_update for BMVert could include details on how the normal is computed (based on normals of adjoining faces).

Diff Detail

Repository
rB Blender

Event Timeline

Jon Denning (gfxcoder) requested review of this revision.Mar 17 2022, 2:59 PM
Jon Denning (gfxcoder) created this revision.
Aaron Carlisle (Blendify) requested changes to this revision.Mar 23 2022, 9:06 PM
Aaron Carlisle (Blendify) added inline comments.
source/blender/python/bmesh/bmesh_py_types.c
1255

Instead of

`is_wire`

Write:

:attr:`is_wire`

This will link to is_wire documentation, this change can also be applied elsewhere.

This revision now requires changes to proceed.Mar 23 2022, 9:06 PM

added :attr: to is_wire refs

This revision is now accepted and ready to land.Mar 24 2022, 4:52 PM

@Aaron Carlisle (Blendify) do I need to do anything else to get these changes in? thanks!

No feel free to commit.

Jon Denning (gfxcoder) updated this revision to Diff 51193.EditedMay 5 2022, 2:42 PM

re-uploaded patch using Arc.

rebased on master

amended commit message

This revision was automatically updated to reflect the committed changes.