diff options
author | Antonioya <blendergit@gmail.com> | 2019-01-03 20:10:39 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-01-03 20:12:25 +0300 |
commit | a30bdcc142f1241a302107c637fd47be06073d76 (patch) | |
tree | fb35779851e20dc36984d8d41139298e65b720c4 /source/blender/editors/gpencil/gpencil_data.c | |
parent | 4b2198a96ac368fa5f2a353c7c148e015246cccf (diff) |
Fix T60022: Crash when adding grease pencil object to a collection disabled in viewport.
See D4163
Thanks to Habib Gahbiche (@zazizizou) for the fix.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_data.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_data.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index a8cfe91740c..8afb0cafeb9 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -137,7 +137,8 @@ static int gp_data_add_exec(bContext *C, wmOperator *op) *gpd_ptr = BKE_gpencil_data_addnew(bmain, DATA_("GPencil")); /* add default sets of colors and brushes */ - ED_gpencil_add_defaults(C); + Object *ob = CTX_data_active_object(C); + ED_gpencil_add_defaults(C, ob); /* add new layer */ BKE_gpencil_layer_addnew(*gpd_ptr, DATA_("GP_Layer"), true); @@ -245,7 +246,8 @@ static int gp_layer_add_exec(bContext *C, wmOperator *op) *gpd_ptr = BKE_gpencil_data_addnew(bmain, DATA_("GPencil")); /* add default sets of colors and brushes */ - ED_gpencil_add_defaults(C); + Object *ob = CTX_data_active_object(C); + ED_gpencil_add_defaults(C, ob); } } |