[Bf-blender-cvs] [6aeb92ac95c] greasepencil-object: Fix draw on parented object
Antonio Vazquez
noreply at git.blender.org
Thu Oct 19 17:09:49 CEST 2017
Commit: 6aeb92ac95c69a3af20d39d9838f2b4269f6cf94
Author: Antonio Vazquez
Date: Thu Oct 19 17:09:38 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB6aeb92ac95c69a3af20d39d9838f2b4269f6cf94
Fix draw on parented object
When the gp object was parented, the location was not using obmatrix and the position was wrong.
===================================================================
M source/blender/editors/gpencil/gpencil_utils.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index bbffb045768..fe487918038 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1293,6 +1293,7 @@ void ED_gp_get_drawing_reference(ToolSettings *ts, View3D *v3d, Scene *scene, Ob
bGPDstroke *gps = gpf->strokes.last;
if (gps->totpoints > 0) {
copy_v3_v3(vec, &gps->points[gps->totpoints - 1].x);
+ mul_m4_v3(ob->obmat, vec);
return;
}
}
@@ -1305,7 +1306,7 @@ void ED_gp_get_drawing_reference(ToolSettings *ts, View3D *v3d, Scene *scene, Ob
}
else {
/* use object location */
- copy_v3_v3(vec, ob->loc);
+ copy_v3_v3(vec, ob->obmat[3]);
}
}
}
More information about the Bf-blender-cvs
mailing list