[Bf-blender-cvs] [e790aa1f19e] master: Writefile: Cleanup material runtime data.
Bastien Montagne
noreply at git.blender.org
Wed Apr 1 14:27:36 CEST 2020
Commit: e790aa1f19ebed6d8135d8cc71003f490cbc219e
Author: Bastien Montagne
Date: Wed Apr 1 10:15:13 2020 +0200
Branches: master
https://developer.blender.org/rBe790aa1f19ebed6d8135d8cc71003f490cbc219e
Writefile: Cleanup material runtime data.
===================================================================
M source/blender/blenloader/intern/writefile.c
===================================================================
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index a8f219ccf84..4307d3c076f 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2361,6 +2361,10 @@ static void write_texture(WriteData *wd, Tex *tex, const void *id_address)
static void write_material(WriteData *wd, Material *ma, const void *id_address)
{
if (ma->id.us > 0 || wd->use_memfile) {
+ /* Clean up, important in undo case to reduce false detection of changed datablocks. */
+ ma->texpaintslot = NULL;
+ BLI_listbase_clear(&ma->gpumaterial);
+
/* write LibData */
writestruct_at_address(wd, ID_MA, Material, 1, id_address, ma);
write_iddata(wd, &ma->id);
More information about the Bf-blender-cvs
mailing list