[Bf-blender-cvs] [9b7dd0a93f9] blender2.8: GP: Assign new materials to brushes

Antonioya noreply at git.blender.org
Fri Oct 26 09:04:40 CEST 2018


Commit: 9b7dd0a93f93641778948c83a6090027242b6446
Author: Antonioya
Date:   Fri Oct 26 09:02:28 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9b7dd0a93f93641778948c83a6090027242b6446

GP: Assign new materials to brushes

When create a new material, this must be set to the brushes automatically.

===================================================================

M	source/blender/blenkernel/intern/material.c

===================================================================

diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index d5558f64be8..5eb056ae69a 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -57,6 +57,7 @@
 #include "BLI_array_utils.h"
 
 #include "BKE_animsys.h"
+#include "BKE_brush.h"
 #include "BKE_displist.h"
 #include "BKE_global.h"
 #include "BKE_gpencil.h"
@@ -167,8 +168,10 @@ Material *BKE_material_add_gpencil(Main *bmain, const char *name)
 	ma = BKE_material_add(bmain, name);
 
 	/* grease pencil settings */
-	BKE_material_init_gpencil_settings(ma);
-
+	if (ma != NULL) {
+		BKE_material_init_gpencil_settings(ma);
+		BKE_brush_update_material(bmain, ma, NULL);
+	}
 	return ma;
 }



More information about the Bf-blender-cvs mailing list