Blender Git Commit Log

Git Commits -> Revision e6e69a2

Revision e6e69a2 by Sybren A. Stüvel (master)
July 16, 2019, 13:06 (GMT)
Fixed crash when adding/removing custom normals from pinned mesh

When a mesh is pinned in the properties panel, Blender crashes when you
click the "Add Custom Split Normals Data".

The code calls `ob = ED_object_context(C)` which returns NULL when the
mesh is pinned in the properties panel, causing a segfault when trying
to get the mesh via `ob->data`.

A new function `ED_mesh_context(C)` avoids this by first checking
whether a mesh was pinned in the context. If not, it checks the pinned
object's data. If that's not there, or it's not a mesh, it returns the
active object's mesh. Finally it returns NULL if there is no active
object, or if the active object is not a mesh object.

Reviewed By: brecht, mont29

Differential Revision: https://developer.blender.org/D5223

Commit Details:

Full Hash: e6e69a28ab28631b2b1b99f55fb618459e7671ad
Parent Commit: dd3e347
Lines Changed: +37, -8

4 Modified Paths:

/source/blender/editors/include/ED_mesh.h (+3, -0) (Diff)
/source/blender/editors/include/ED_screen.h (+1, -0) (Diff)
/source/blender/editors/mesh/mesh_data.c (+26, -8) (Diff)
/source/blender/editors/screen/screen_ops.c (+7, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021