[Bf-blender-cvs] [9b50448e0da] greasepencil-object: GPencil: Test the option to move the grid depending of mode.
Antonioya
noreply at git.blender.org
Sat Mar 16 17:40:23 CET 2019
Commit: 9b50448e0da902eebe68da9532357475023e1a29
Author: Antonioya
Date: Sat Mar 16 17:40:08 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9b50448e0da902eebe68da9532357475023e1a29
GPencil: Test the option to move the grid depending of mode.
===================================================================
M source/blender/draw/engines/gpencil/gpencil_engine.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index d67cca415fc..f3ed7fb2594 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -662,14 +662,24 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
}
}
- /* now move the origin to Object or Cursor */
- if ((ob->mode == OB_MODE_PAINT_GPENCIL) &&
- (ts->gpencil_v3d_align & GP_PROJECT_CURSOR))
- {
- copy_v3_v3(stl->storage->grid_matrix[3], cursor->location);
+ /* Move the origin to Object or Cursor
+ * In Draw mode the origin is defined by origin
+ * In other modes, the origin is defined by drawing plane */
+ if (ob->mode == OB_MODE_PAINT_GPENCIL) {
+ if (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) {
+ copy_v3_v3(stl->storage->grid_matrix[3], cursor->location);
+ }
+ else {
+ copy_v3_v3(stl->storage->grid_matrix[3], ob->obmat[3]);
+ }
}
else {
- copy_v3_v3(stl->storage->grid_matrix[3], ob->obmat[3]);
+ if (ts->gp_sculpt.lock_axis == GP_LOCKAXIS_CURSOR) {
+ copy_v3_v3(stl->storage->grid_matrix[3], cursor->location);
+ }
+ else {
+ copy_v3_v3(stl->storage->grid_matrix[3], ob->obmat[3]);
+ }
}
DRW_shgroup_call_add(
More information about the Bf-blender-cvs
mailing list