diff options
author | Antonioya <blendergit@gmail.com> | 2019-03-29 13:58:28 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-03-29 13:58:28 +0300 |
commit | 7fc7e325efbb1ccab181e32873f3ad49ed42755d (patch) | |
tree | c6d9034181511d4b0f59acf8dcff8ed6e2ea052d /source/blender/editors/space_outliner | |
parent | 1def03d797fcba6f01d17596e9950e727e4b3037 (diff) |
Fix T63082: Outliner allows assign grease pencil materials to mesh
The grease pencil materials only can be assigned to objects of grease pencil type.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_dragdrop.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index 77821ec0990..647fdeccb40 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -649,6 +649,11 @@ static int material_drop_invoke(bContext *C, wmOperator *UNUSED(op), const wmEve return OPERATOR_CANCELLED; } + /* only drop grease pencil material on grease pencil objects */ + if ((ma->gp_style != NULL) && (ob->type != OB_GPENCIL)) { + return OPERATOR_CANCELLED; + } + assign_material(bmain, ob, ma, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF); WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C)); |