Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2019-08-16 15:36:57 +0300
committerSybren A. Stüvel <sybren@blender.org>2019-08-16 15:36:57 +0300
commitc70f975d5c3b961e0c77eba3a35c8a892f39214d (patch)
tree04dc64117f78b16f9e6aa47f040edfe9ad6677a2 /source/blender/blenkernel/BKE_material.h
parent82e719ff8764da6c48ba3de4e5c11226953002e8 (diff)
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
Diffstat (limited to 'source/blender/blenkernel/BKE_material.h')
-rw-r--r--source/blender/blenkernel/BKE_material.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 5bb69c7166e..44a8f98e994 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -104,9 +104,8 @@ void BKE_material_append_id(struct Main *bmain, struct ID *id, struct Material *
struct Material *BKE_material_pop_id(struct Main *bmain,
struct ID *id,
/* index is an int because of RNA. */
- int index,
- bool update_data);
-void BKE_material_clear_id(struct Main *bmain, struct ID *id, bool update_data);
+ int index);
+void BKE_material_clear_id(struct Main *bmain, struct ID *id);
/* rendering */
void ramp_blend(int type, float r_col[3], const float fac, const float col[3]);