LineArt: Fix unreported material user count error when apply modifier

The number of users was 0 after applying the modifier.
This commit is contained in:
Antonio Vazquez 2021-03-26 15:48:54 +01:00
parent 4bb70e0ba5
commit acc6e5c315
1 changed files with 3 additions and 0 deletions

View File

@ -1416,6 +1416,9 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op)
/* Only created one layer and one material. */
strcpy(md->target_layer, ((bGPDlayer *)gpd->layers.first)->info);
md->target_material = BKE_gpencil_material(ob, 1);
if (md->target_material) {
id_us_plus(&md->target_material->id);
}
/* Stroke object is drawn in front of meshes by default. */
ob->dtx |= OB_DRAW_IN_FRONT;