[Bf-blender-cvs] [d2afdf3c205] master: GP: Use matrix location instead of loc

Antonioya noreply at git.blender.org
Thu Jan 24 11:33:41 CET 2019


Commit: d2afdf3c205b544b93dfdb3de61e3a9524e99978
Author: Antonioya
Date:   Thu Jan 24 10:46:10 2019 +0100
Branches: master
https://developer.blender.org/rBd2afdf3c205b544b93dfdb3de61e3a9524e99978

GP: Use matrix location instead of loc

===================================================================

M	source/blender/draw/engines/gpencil/gpencil_cache_utils.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list