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>2019-01-24 12:46:10 +0300
committerAntonioya <blendergit@gmail.com>2019-01-24 13:33:35 +0300
commitd2afdf3c205b544b93dfdb3de61e3a9524e99978 (patch)
tree9d65503d1546320b1d7df1fc70829030b42e5b97 /source
parenta3261aad130eabdcdf4938144477e4d0dd574932 (diff)
GP: Use matrix location instead of loc
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_cache_utils.c8
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;