Fix T59546: Grease Pencil Edit: Rotation around individual origins error
authorAntonioya <blendergit@gmail.com>
Fri, 4 Jan 2019 16:01:39 +0000 (17:01 +0100)
committerAntonioya <blendergit@gmail.com>
Fri, 4 Jan 2019 16:01:39 +0000 (17:01 +0100)
Thanks to Habib Gahbiche (@zazizizou) for helping fixing this bug. See D4156.

source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c

index f7a27571b64ec48591e9bb8bcf907acf7695ac9f..2b2de65db15616788122771e380c3a83ec493edb 100644 (file)
@@ -223,7 +223,7 @@ static bool transdata_check_local_center(TransInfo *t, short around)
        return ((around == V3D_AROUND_LOCAL_ORIGINS) && (
                    (t->flag & (T_OBJECT | T_POSE)) ||
                    /* implicit: (t->flag & T_EDIT) */
-                   (ELEM(t->obedit_type, OB_MESH, OB_CURVE, OB_MBALL, OB_ARMATURE)) ||
+                   (ELEM(t->obedit_type, OB_MESH, OB_CURVE, OB_MBALL, OB_ARMATURE, OB_GPENCIL)) ||
                    (t->spacetype == SPACE_IPO) ||
                    (t->options & (CTX_MOVIECLIP | CTX_MASK | CTX_PAINT_CURVE)))
                );
index 1d63291d3132a2933f222ee92cc3d23719a8f815..47624293a0b33680b13d8162e508d18ebb5789c7 100644 (file)
@@ -8588,7 +8588,7 @@ void createTransData(bContext *C, TransInfo *t)
        }
        else if (t->options & CTX_GPENCIL_STROKES) {
                t->options |= CTX_GPENCIL_STROKES;
-               t->flag |= T_POINTS;
+               t->flag |= T_POINTS | T_EDIT;
 
                initTransDataContainers_FromObjectData(t, ob, NULL, 0);
                createTransGPencil(C, t);
index 882ef9e730168c80a1add76e9de13e927431eb20..8ae23737e5e49887c097b9a6e95f63a69cd80542 100644 (file)
@@ -1292,7 +1292,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
 
        t->flag = 0;
 
-       t->obedit_type = (object_mode == OB_MODE_EDIT) ? object_type : -1;
+       t->obedit_type = ((object_mode == OB_MODE_EDIT) || (object_mode == OB_MODE_EDIT_GPENCIL)) ? object_type : -1;
 
        /* Many kinds of transform only use a single handle. */
        if (t->data_container == NULL) {