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:
authorBastien Montagne <b.mont29@gmail.com>2020-04-01 11:15:13 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-04-01 13:39:06 +0300
commite790aa1f19ebed6d8135d8cc71003f490cbc219e (patch)
treef314acd36837bec337c55f72ef4caca8a01ffff3
parent27b9f1f626294173269af85ef0d928d059179598 (diff)
Writefile: Cleanup material runtime data.
-rw-r--r--source/blender/blenloader/intern/writefile.c4
1 files changed, 4 insertions, 0 deletions
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);