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-05-29 20:50:23 +0300
committerAntonioya <blendergit@gmail.com>2019-05-29 20:52:00 +0300
commit7fae3e375a6c3804dc986371d488675d0d4869cd (patch)
tree6799713c357459ff2faac864049c2386369a6397 /source/blender
parent9dafc8ee2c542949e87e5e81b0ba5088bbd46af9 (diff)
GPencil: Cleanup code to avoid double matrix copy
Thanks @fclem for catching the problem.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 7f979c4fed1..58cae5888a2 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1021,7 +1021,6 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache,
Scene *scene = draw_ctx->scene;
View3D *v3d = draw_ctx->v3d;
bGPDstroke *gps, *src_gps;
- float viewmatrix[4][4];
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
const bool playing = stl->storage->is_playing;
const bool is_render = (bool)stl->storage->is_render;
@@ -1035,12 +1034,13 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache,
Depsgraph *depsgraph = DRW_context_state_get()->depsgraph;
/* get parent matrix and save as static data */
- ED_gpencil_parent_location(depsgraph, ob, gpd, gpl, viewmatrix);
- copy_m4_m4(derived_gpf->runtime.viewmatrix, viewmatrix);
-
if ((cache_ob != NULL) && (cache_ob->is_dup_ob)) {
copy_m4_m4(derived_gpf->runtime.viewmatrix, cache_ob->obmat);
}
+ else {
+ /* get parent matrix and save as static data */
+ ED_gpencil_parent_location(depsgraph, ob, gpd, gpl, derived_gpf->runtime.viewmatrix);
+ }
/* apply geometry modifiers */
if ((cache->is_dirty) && (ob->greasepencil_modifiers.first) && (!is_multiedit)) {