[Bf-blender-cvs] [1d3756d4f7e] greasepencil-object: GP: Remove orange line in primitives
Antonioya
noreply at git.blender.org
Tue Dec 11 13:15:10 CET 2018
Commit: 1d3756d4f7e52e315329fb2422f6eccc8e1d370c
Author: Antonioya
Date: Tue Dec 11 13:15:01 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB1d3756d4f7e52e315329fb2422f6eccc8e1d370c
GP: Remove orange line in primitives
After adding the preview of real stroke, this does not make sense.
===================================================================
M source/blender/editors/gpencil/drawgpencil.c
M source/blender/editors/gpencil/gpencil_intern.h
M source/blender/editors/gpencil/gpencil_primitive.c
===================================================================
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 3c81bbf2f7f..c16ea84ec81 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1430,64 +1430,6 @@ void ED_gp_draw_interpolation(const bContext *C, tGPDinterpolate *tgpi, const in
glDisable(GL_BLEND);
}
-/* draw interpolate strokes (used only while operator is running) */
-void ED_gp_draw_primitives(const bContext *C, tGPDprimitive *tgpi, const int type)
-{
- tGPDdraw tgpw;
- ARegion *ar = CTX_wm_region(C);
- RegionView3D *rv3d = ar->regiondata;
-
- /* if idle, do not draw */
- if (tgpi->flag == 0) {
- return;
- }
-
- Object *obact = CTX_data_active_object(C);
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
-
- float color[4];
- UI_GetThemeColor3fv(TH_GP_VERTEX_SELECT, color);
- color[3] = 0.6f;
- int dflag = 0;
- /* if 3d stuff, enable flags */
- if (type == REGION_DRAW_POST_VIEW) {
- dflag |= (GP_DRAWDATA_ONLY3D | GP_DRAWDATA_NOSTATUS);
- }
-
- tgpw.rv3d = rv3d;
- tgpw.depsgraph = depsgraph;
- tgpw.ob = obact;
- tgpw.gpd = tgpi->gpd;
- tgpw.offsx = 0;
- tgpw.offsy = 0;
- tgpw.winx = tgpi->ar->winx;
- tgpw.winy = tgpi->ar->winy;
- tgpw.dflag = dflag;
-
- /* turn on alpha-blending */
- GPU_blend(true);
- /* calculate parent position */
- ED_gpencil_parent_location(depsgraph, obact, tgpi->gpd, tgpi->gpl, tgpw.diff_mat);
- if (tgpi->gpf) {
- tgpw.gps = tgpi->gpf->strokes.first;
- if (tgpw.gps->totpoints > 0) {
- tgpw.gpl = tgpi->gpl;
- tgpw.gpf = tgpi->gpf;
- tgpw.t_gpf = tgpi->gpf;
-
- tgpw.lthick = tgpi->gpl->line_change;
- tgpw.opacity = 1.0;
- copy_v4_v4(tgpw.tintcolor, color);
- tgpw.onion = true;
- tgpw.custonion = true;
-
- gp_draw_strokes(&tgpw);
- }
- }
-
- GPU_blend(false);
-}
-
/* wrapper to draw strokes for filling operator */
void ED_gp_draw_fill(tGPDdraw *tgpw)
{
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index ce7c40fb494..3d271457b12 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -175,14 +175,12 @@ typedef struct tGPDprimitive {
int lock_axis; /* lock to viewport axis */
NumInput num; /* numeric input */
- void *draw_handle_3d; /* handle for drawing strokes while operator is running 3d stuff */
} tGPDprimitive;
/* Modal Operator Drawing Callbacks ------------------------ */
void ED_gp_draw_interpolation(const struct bContext *C, struct tGPDinterpolate *tgpi, const int type);
-void ED_gp_draw_primitives(const struct bContext *C, struct tGPDprimitive *tgpi, const int type);
void ED_gp_draw_fill(struct tGPDdraw *tgpw);
/* ***************************************************** */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index b50151bc102..05f005faf0e 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -302,18 +302,6 @@ static void gp_primitive_set_cp(tGPDprimitive *tgpi, float p[2], float color[4],
}
}
-/* ----------------------- */
-/* Drawing Callbacks */
-
-/* Drawing callback for modal operator in 3d mode */
-static void gpencil_primitive_draw_3d(const bContext *C, ARegion *UNUSED(ar), void *arg)
-{
- tGPDprimitive *tgpi = (tGPDprimitive *)arg;
- ED_gp_draw_primitives(C, tgpi, REGION_DRAW_POST_VIEW);
-}
-
-/* ----------------------- */
-
/* Helper: Draw status message while the user is running the operator */
static void gpencil_primitive_status_indicators(bContext *C, tGPDprimitive *tgpi)
{
@@ -797,11 +785,6 @@ static void gpencil_primitive_exit(bContext *C, wmOperator *op)
/* don't assume that operator data exists at all */
if (tgpi) {
- /* remove drawing handler */
- if (tgpi->draw_handle_3d) {
- ED_region_draw_cb_exit(tgpi->ar->type, tgpi->draw_handle_3d);
- }
-
/* clear status message area */
ED_workspace_status_text(C, NULL);
@@ -928,9 +911,6 @@ static int gpencil_primitive_invoke(bContext *C, wmOperator *op, const wmEvent *
*/
op->flag |= OP_IS_MODAL_CURSOR_REGION;
- /* Enable custom drawing handlers */
- tgpi->draw_handle_3d = ED_region_draw_cb_activate(tgpi->ar->type, gpencil_primitive_draw_3d, tgpi, REGION_DRAW_POST_VIEW);
-
/* set cursor to indicate modal */
WM_cursor_modal_set(win, BC_CROSSCURSOR);
More information about the Bf-blender-cvs
mailing list