diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_cache_utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c index 9642cec6201..8c825a5ae6e 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c @@ -75,7 +75,7 @@ tGPencilObjectCache *gpencil_object_cache_add( Object *ob_orig = (Object *)DEG_get_original_id(&ob->id); cache_elem->ob = ob_orig; cache_elem->gpd = (bGPdata *)ob_orig->data; - copy_v3_v3(cache_elem->loc, ob->loc); + copy_v3_v3(cache_elem->loc, ob->obmat[3]); copy_m4_m4(cache_elem->obmat, ob->obmat); cache_elem->idx = *gp_cache_used; @@ -97,10 +97,10 @@ tGPencilObjectCache *gpencil_object_cache_add( float zdepth = 0.0; if (rv3d) { if (rv3d->is_persp) { - zdepth = ED_view3d_calc_zfac(rv3d, ob->loc, NULL); + zdepth = ED_view3d_calc_zfac(rv3d, ob->obmat[3], NULL); } else { - zdepth = -dot_v3v3(rv3d->viewinv[2], ob->loc); + zdepth = -dot_v3v3(rv3d->viewinv[2], ob->obmat[3]); } } else { @@ -115,7 +115,7 @@ tGPencilObjectCache *gpencil_object_cache_add( mul_m4_v3(camera->obmat, vn); normalize_v3(vn); plane_from_point_normal_v3(plane_cam, camera->loc, vn); - zdepth = dist_squared_to_plane_v3(ob->loc, plane_cam); + zdepth = dist_squared_to_plane_v3(ob->obmat[3], plane_cam); } } cache_elem->zdepth = zdepth; |