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
path: root/source
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-11-04 21:37:03 +0300
committerAntonioya <blendergit@gmail.com>2018-11-04 21:37:03 +0300
commit665efe401aa91b3b90dc03dac2df187c249f3ae6 (patch)
tree6afb9c1eee245d22af84dcf304fad95d62f68a64 /source
parent807b460a11622e75127cabe00c3ff01b1ea6dfcc (diff)
Fix T57611: Crash on entering Grease Pencil Sculpt Mode
The problem was when some layers was locked in multiedit. The cache size was not checked and gets an segment fault.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index abf1940ad4a..79ad855108e 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -891,19 +891,23 @@ static void gpencil_draw_strokes(
/* edit points (only in edit mode and not play animation not render) */
if ((draw_ctx->obact == ob) && (src_gps) &&
- (!playing) && (!is_render) && (!cache_ob->is_dup_ob) &&
- ((gpl->flag & GP_LAYER_LOCKED) == 0))
+ (!playing) && (!is_render) && (!cache_ob->is_dup_ob))
{
- if (!stl->g_data->shgrps_edit_line) {
- stl->g_data->shgrps_edit_line = DRW_shgroup_create(e_data->gpencil_line_sh, psl->edit_pass);
+ if ((gpl->flag & GP_LAYER_LOCKED) == 0) {
+ if (!stl->g_data->shgrps_edit_line) {
+ stl->g_data->shgrps_edit_line = DRW_shgroup_create(e_data->gpencil_line_sh, psl->edit_pass);
+ }
+ if (!stl->g_data->shgrps_edit_point) {
+ stl->g_data->shgrps_edit_point = DRW_shgroup_create(e_data->gpencil_edit_point_sh, psl->edit_pass);
+ const float *viewport_size = DRW_viewport_size_get();
+ DRW_shgroup_uniform_vec2(stl->g_data->shgrps_edit_point, "Viewport", viewport_size, 1);
+ }
+
+ gpencil_add_editpoints_shgroup(stl, cache, ts, ob, gpd, gpl, derived_gpf, src_gps);
}
- if (!stl->g_data->shgrps_edit_point) {
- stl->g_data->shgrps_edit_point = DRW_shgroup_create(e_data->gpencil_edit_point_sh, psl->edit_pass);
- const float *viewport_size = DRW_viewport_size_get();
- DRW_shgroup_uniform_vec2(stl->g_data->shgrps_edit_point, "Viewport", viewport_size, 1);
+ else {
+ gpencil_batch_cache_check_free_slots(ob);
}
-
- gpencil_add_editpoints_shgroup(stl, cache, ts, ob, gpd, gpl, derived_gpf, src_gps);
}
GP_SET_SRC_GPS(src_gps);