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>2019-03-10 13:18:52 +0300
committerAntonioya <blendergit@gmail.com>2019-03-10 13:18:52 +0300
commit81958a13938ebcf76316b12a3fa81165ae3cf230 (patch)
treedddfe9bd5204b01946c394da3c7ed8494348a708 /source/blender/editors/gpencil/gpencil_add_monkey.c
parentb7bcc30329251f33f4b0b58689d5489f9c42299d (diff)
GPencil: Fix user count for autocreated materials
The user count was 2 when the value must be 1.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_add_monkey.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_add_monkey.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c
index 302a6fb10f6..a4fbd4002fa 100644
--- a/source/blender/editors/gpencil/gpencil_add_monkey.c
+++ b/source/blender/editors/gpencil/gpencil_add_monkey.c
@@ -31,6 +31,7 @@
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_gpencil.h"
+#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_material.h"
@@ -63,6 +64,7 @@ static int gpencil_monkey_color(
BKE_object_material_slot_add(bmain, ob);
ma = BKE_material_add_gpencil(bmain, pct->name);
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
+ id_us_min(&ma->id);
copy_v4_v4(ma->gp_style->stroke_rgba, pct->line);
copy_v4_v4(ma->gp_style->fill_rgba, pct->fill);