Commit: 7567700b1567a3c16dce297477932540348ef9b4
Author: Charlie Jolly
Date: Tue Dec 11 16:48:34 2018 +0000
Branches: greasepencil-object
https://developer.blender.org/rB7567700b1567a3c16dce297477932540348ef9b4
GP: Remove cyclic option
Not compatible with new brush drawing.
===================================================================
M source/blender/editors/gpencil/gpencil_intern.h
M source/blender/editors/gpencil/gpencil_primitive.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_intern.h
b/source/blender/editors/gpencil/gpencil_intern.h
index 9e8660943d5..bc1ad680ab4 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -156,7 +156,6 @@ typedef struct tGPDprimitive {
struct bGPDframe *gpf; /* frame */
int type; /* type of primitive */
bool curve; /* type of primitive is a curve */
- short cyclic; /* cyclic option */
short flip; /* flip option */
tGPspoint *points; /* array of data-points for stroke */
int point_count; /* number of edges allocated */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c
b/source/blender/editors/gpencil/gpencil_primitive.c
index 4cdad0b9c5e..2468353f5e9 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -128,9 +128,6 @@ static void gp_session_validatebuffer(tGPDprimitive *p)
/* reset flags */
gpd->runtime.sbuffer_sflag = 0;
gpd->runtime.sbuffer_sflag |= GP_STROKE_3DSPACE;
- if (p->cyclic) {
- gpd->runtime.sbuffer_sflag |= GP_STROKE_CYCLIC;
- }
}
static void gp_init_colors(tGPDprimitive *p)
@@ -268,12 +265,9 @@ static void gp_primitive_set_initdata(bContext *C,
tGPDprimitive *tgpi)
gps->flag |= GP_STROKE_RECALC_CACHES;
gps->flag &= ~GP_STROKE_SELECT;
/* the polygon must be closed, so enabled cyclic */
- if (tgpi->type != GP_STROKE_LINE && tgpi->type != GP_STROKE_ARC) {
+ if (ELEM(tgpi->type,GP_STROKE_BOX ,GP_STROKE_CIRCLE))
gps->flag |= GP_STROKE_CYCLIC;
- }
- else {
- gps->flag &= ~GP_STROKE_CYCLIC;
- }
+
gps->flag |= GP_STROKE_3DSPACE;
gps->mat_nr = BKE_gpencil_get_material_index(tgpi->ob, tgpi->mat) - 1;
@@ -581,15 +575,12 @@ static void gp_primitive_update_strokes(bContext *C,
tGPDprimitive *tgpi)
tGPspoint *points2D = tgpi->points;
switch (tgpi->type) {
case GP_STROKE_BOX:
- tgpi->cyclic = true;
gp_primitive_rectangle(tgpi, points2D);
break;
case GP_STROKE_LINE:
- tgpi->cyclic = false;
gp_primitive_line(tgpi, points2D);
break;
case GP_STROKE_CIRCLE:
- tgpi->cyclic = true;
gp_primitive_circle(tgpi, points2D);
break;
case GP_STROKE_ARC:
@@ -601,13 +592,6 @@ static void gp_primitive_update_strokes(bContext *C,
tGPDprimitive *tgpi)
break;
}
- if (ELEM(tgpi->type, GP_STROKE_ARC, GP_STROKE_BEZIER)) {
- if (tgpi->cyclic)
- gps->flag |= GP_STROKE_CYCLIC;
- else
- gps->flag &= ~GP_STROKE_CYCLIC;
- }
-
/* convert screen-coordinates to 3D coordinates */
gp_session_validatebuffer(tgpi);
gp_init_colors(tgpi);
@@ -1289,16 +1273,6 @@ static int gpencil_primitive_modal(bContext *C,
wmOperator *op, const wmEvent *e
/* canceled! */
return OPERATOR_CANCELLED;
}
- case CKEY:
- {
- if ((event->val == KM_RELEASE) && tgpi->type ==
GP_STROKE_ARC) {
- tgpi->cyclic ^= 1;
-
- /* update screen */
- gpencil_primitive_update(C, op, tgpi);
- }
- break;
- }
case FKEY:
{
if ((event->val == KM_RELEASE) && tgpi->type ==
GP_STROKE_ARC) {
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs