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:
authorAntonioya <blendergit@gmail.com>2018-10-26 10:02:28 +0300
committerAntonioya <blendergit@gmail.com>2018-10-26 10:02:28 +0300
commit9b7dd0a93f93641778948c83a6090027242b6446 (patch)
treeaa7d1e5930624bcab2f58ef681f98c16110a444b /source/blender/blenkernel
parent6be7a98906b769c1496127552b524124a0e70c5a (diff)
GP: Assign new materials to brushes
When create a new material, this must be set to the brushes automatically.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/material.c7
1 files changed, 5 insertions, 2 deletions
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;
}