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-01-03 20:10:39 +0300
committerAntonioya <blendergit@gmail.com>2019-01-03 20:12:25 +0300
commita30bdcc142f1241a302107c637fd47be06073d76 (patch)
treefb35779851e20dc36984d8d41139298e65b720c4 /source/blender/editors/gpencil/gpencil_utils.c
parent4b2198a96ac368fa5f2a353c7c148e015246cccf (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_utils.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 4d6a7b547c6..f7fafb56d3a 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1221,16 +1221,15 @@ Object *ED_gpencil_add_object(bContext *C, Scene *UNUSED(scene), const float loc
/* define size */
BKE_object_obdata_size_init(ob, GP_OBGPENCIL_DEFAULT_SIZE);
/* create default brushes and colors */
- ED_gpencil_add_defaults(C);
+ ED_gpencil_add_defaults(C, ob);
return ob;
}
/* Helper function to create default colors and drawing brushes */
-void ED_gpencil_add_defaults(bContext *C)
+void ED_gpencil_add_defaults(bContext *C, Object *ob)
{
Main *bmain = CTX_data_main(C);
- Object *ob = CTX_data_active_object(C);
ToolSettings *ts = CTX_data_tool_settings(C);
/* first try to reuse default material */