From 5c0f1e1a4e88cbbfaf90691e7c642fa053dd5cc7 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Sat, 30 Nov 2019 11:46:24 +0100 Subject: [PATCH] GPencil: Fix unreported thickness does not scale when layer is parented The thickness was using the object scale always, but when the layer is parented, must use the parented object scale. --- source/blender/draw/engines/gpencil/gpencil_draw_utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 48912a914dc..cd96b21280f 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1816,7 +1816,6 @@ static void gpencil_shgroups_create(GPENCIL_e_data *e_data, for (int i = 0; i < cache->grp_used; i++) { elm = &cache->grp_cache[i]; array_elm = &cache_ob->shgrp_array[idx]; - const float scale = cache_ob->scale; /* Limit stencil id */ if (stencil_id > 255) { @@ -1858,6 +1857,8 @@ static void gpencil_shgroups_create(GPENCIL_e_data *e_data, break; } + const float scale = (!cache_ob->is_dup_ob) ? mat4_to_scale(gpf->runtime.parent_obmat) : + cache_ob->scale; float(*obmat)[4] = (!cache_ob->is_dup_ob) ? gpf->runtime.parent_obmat : cache_ob->obmat; switch (elm->type) { case eGpencilBatchGroupType_Stroke: {