Blender Git Commit Log

Git Commits -> Revision c70f975

Revision c70f975 by Sybren A. Stüvel (master)
August 16, 2019, 12:36 (GMT)
Fix T67999: calling Mesh.materials.clear() crashes Blender

The `BKE_material_pop_id()` and `BKE_material_clear_id()` functions had
a parameter `update_data` that, when `false`, would cause the mesh polys
to keep their material index, even when the indexed material slots were
removed. This behaviour was never used in the C code and not supported
by the drawing code, making polygons disappear and causing crashes. The
Python binding in RNA, however, defaulted to `update_data=False`.

This commit removes the `update_data` parameter altogether, and makes
the functions always fix up the material indices.

Reviewed by: mont29, brecht

Commit Details:

Full Hash: c70f975d5c3b961e0c77eba3a35c8a892f39214d
Parent Commit: 82e719f
Lines Changed: +13, -25

4 Modified Paths:

/source/blender/blenkernel/BKE_material.h (+2, -3) (Diff)
/source/blender/blenkernel/intern/material.c (+5, -11) (Diff)
/source/blender/editors/mesh/editmesh_tools.c (+2, -2) (Diff)
/source/blender/makesrna/intern/rna_ID.c (+4, -9) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021