diff options
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/annotate_draw.c | 20 | ||||
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 15 | ||||
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 15 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_armature.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 5 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 34 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_fill.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_old.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 25 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_primitive.c | 43 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_select.c | 8 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 19 |
12 files changed, 102 insertions, 92 deletions
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index f30b3a45971..3d70a7f6843 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -717,8 +717,8 @@ static void gp_draw_strokes_edit( /* ----- General Drawing ------ */ /* draw onion-skinning for a layer */ static void gp_draw_onionskins( - bGPdata *gpd, bGPDlayer *gpl, bGPDframe *gpf, int offsx, int offsy, int winx, int winy, - int UNUSED(cfra), int dflag) + bGPdata *gpd, bGPDlayer *gpl, bGPDframe *gpf, int offsx, int offsy, int winx, int winy, + int UNUSED(cfra), int dflag) { const float alpha = 1.0f; float color[4]; @@ -738,8 +738,8 @@ static void gp_draw_onionskins( fac = 1.0f - ((float)(gpf->framenum - gf->framenum) / (float)(gpl->gstep + 1)); color[3] = alpha * fac * 0.66f; gp_draw_strokes( - gpd, gpl, gf, offsx, offsy, winx, winy, dflag, - gpl->thickness, color); + gpd, gpl, gf, offsx, offsy, winx, winy, dflag, + gpl->thickness, color); } else break; @@ -750,8 +750,8 @@ static void gp_draw_onionskins( if (gpf->prev) { color[3] = (alpha / 7); gp_draw_strokes( - gpd, gpl, gpf->prev, offsx, offsy, winx, winy, dflag, - gpl->thickness, color); + gpd, gpl, gpf->prev, offsx, offsy, winx, winy, dflag, + gpl->thickness, color); } } else { @@ -774,8 +774,8 @@ static void gp_draw_onionskins( fac = 1.0f - ((float)(gf->framenum - gpf->framenum) / (float)(gpl->gstep_next + 1)); color[3] = alpha * fac * 0.66f; gp_draw_strokes( - gpd, gpl, gf, offsx, offsy, winx, winy, dflag, - gpl->thickness, color); + gpd, gpl, gf, offsx, offsy, winx, winy, dflag, + gpl->thickness, color); } else break; @@ -786,8 +786,8 @@ static void gp_draw_onionskins( if (gpf->next) { color[3] = (alpha / 4); gp_draw_strokes( - gpd, gpl, gpf->next, offsx, offsy, winx, winy, dflag, - gpl->thickness, color); + gpd, gpl, gpf->next, offsx, offsy, winx, winy, dflag, + gpl->thickness, color); } } else { diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index f7d813a4a48..349deb6b53e 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -227,8 +227,7 @@ static bool gpencil_draw_poll(bContext *C) if ((obact) && (obact->type == OB_GPENCIL) && (obact->mode == OB_MODE_PAINT_GPENCIL)) { - CTX_wm_operator_poll_msg_set(C, - "Annotation cannot be used in grease pencil draw mode"); + CTX_wm_operator_poll_msg_set(C, "Annotation cannot be used in grease pencil draw mode"); return false; } } @@ -2133,8 +2132,7 @@ static void annotation_add_missing_events(bContext *C, wmOperator *op, const wmE interp_v2_v2v2(pt, a, b, 0.5f); sub_v2_v2v2(pt, b, pt); /* create fake event */ - annotation_draw_apply_event(op, event, CTX_data_depsgraph(C), - pt[0], pt[1]); + annotation_draw_apply_event(op, event, CTX_data_depsgraph(C), pt[0], pt[1]); } else if (dist >= factor) { int slices = 2 + (int)((dist - 1.0) / factor); @@ -2143,8 +2141,9 @@ static void annotation_add_missing_events(bContext *C, wmOperator *op, const wmE interp_v2_v2v2(pt, a, b, n * i); sub_v2_v2v2(pt, b, pt); /* create fake event */ - annotation_draw_apply_event(op, event, CTX_data_depsgraph(C), - pt[0], pt[1]); + annotation_draw_apply_event( + op, event, CTX_data_depsgraph(C), + pt[0], pt[1]); } } } @@ -2281,8 +2280,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) if (G.debug & G_DEBUG) { printf("found alternative region %p (old was %p) - at %d %d (sa: %d %d -> %d %d)\n", - current_region, p->ar, event->x, event->y, - p->sa->totrct.xmin, p->sa->totrct.ymin, p->sa->totrct.xmax, p->sa->totrct.ymax); + current_region, p->ar, event->x, event->y, + p->sa->totrct.xmin, p->sa->totrct.ymin, p->sa->totrct.xmax, p->sa->totrct.ymax); } if (current_region) { diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index dafc9507bd1..1ae3176d393 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -570,8 +570,9 @@ static int gp_set_filling_texture(Image *image, short flag) return (int)GL_INVALID_OPERATION; } - GPU_create_gl_tex(bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, - false, false, image); + GPU_create_gl_tex( + bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, + false, false, image); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -1099,9 +1100,10 @@ static void gp_draw_strokes(tGPDdraw *tgpw) /* 3D Lines - OpenGL primitives-based */ if (gps->totpoints == 1) { if (tgpw->disable_fill != 1) { - gp_draw_stroke_point(gps->points, sthickness, tgpw->dflag, gps->flag, - tgpw->offsx, tgpw->offsy, tgpw->winx, tgpw->winy, - tgpw->diff_mat, ink); + gp_draw_stroke_point( + gps->points, sthickness, tgpw->dflag, gps->flag, + tgpw->offsx, tgpw->offsy, tgpw->winx, tgpw->winy, + tgpw->diff_mat, ink); } } else { @@ -1740,8 +1742,7 @@ void ED_gpencil_draw_view3d_object(wmWindowManager *wm, Scene *scene, Depsgraph ToolSettings *ts = scene->toolsettings; Brush *brush = BKE_paint_brush(&ts->gp_paint->paint); if (brush != NULL) { - gp_draw_data(rv3d, brush, 1.0f, ob, gpd, - offsx, offsy, winx, winy, CFRA, dflag); + gp_draw_data(rv3d, brush, 1.0f, ob, gpd, offsx, offsy, winx, winy, CFRA, dflag); } } diff --git a/source/blender/editors/gpencil/gpencil_armature.c b/source/blender/editors/gpencil/gpencil_armature.c index 97f5db96a89..a482eb837e7 100644 --- a/source/blender/editors/gpencil/gpencil_armature.c +++ b/source/blender/editors/gpencil/gpencil_armature.c @@ -576,14 +576,14 @@ static int gpencil_generate_weights_exec(bContext *C, wmOperator *op) GpencilModifierData *md = BKE_gpencil_modifiers_findByType(ob_eval, eGpencilModifierType_Armature); if (md == NULL) { BKE_report(op->reports, RPT_ERROR, - "The grease pencil object need an Armature modifier"); + "The grease pencil object need an Armature modifier"); return OPERATOR_CANCELLED; } ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)md; if (mmd->object == NULL) { BKE_report(op->reports, RPT_ERROR, - "Armature modifier is not valid or wrong defined"); + "Armature modifier is not valid or wrong defined"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index ee1838af22a..0403a42a2c9 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1269,7 +1269,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op) if (found == false) { /* STOP HERE! Nothing to paste! */ BKE_report(op->reports, RPT_ERROR, - "Copy some strokes to the clipboard before using the Clone brush to paste copies of them"); + "Copy some strokes to the clipboard before using the Clone brush to paste copies of them"); MEM_freeN(gso); op->customdata = NULL; @@ -1853,8 +1853,7 @@ static int gpsculpt_brush_invoke(bContext *C, wmOperator *op, const wmEvent *eve /* the operator cannot work while play animation */ if (is_playing) { - BKE_report(op->reports, RPT_ERROR, - "Cannot sculpt while play animation"); + BKE_report(op->reports, RPT_ERROR, "Cannot sculpt while play animation"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 088282c0f02..1388beb0b20 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -881,8 +881,9 @@ static void gpencil_add_move_points(bGPDframe *gpf, bGPDstroke *gps) /* if last point, add new point at the end */ if (do_last) { - copy_point(gps, temp_points, temp_dverts, - oldtotpoints - 1, gps->totpoints - 1); + copy_point( + gps, temp_points, temp_dverts, + oldtotpoints - 1, gps->totpoints - 1); /* deselect old */ pt = &gps->points[gps->totpoints - 2]; @@ -2600,8 +2601,9 @@ void GPENCIL_OT_snap_to_cursor(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* props */ - ot->prop = RNA_def_boolean(ot->srna, "use_offset", true, "With Offset", - "Offset the entire stroke instead of selected points only"); + ot->prop = RNA_def_boolean( + ot->srna, "use_offset", true, "With Offset", + "Offset the entire stroke instead of selected points only"); } /* ------------------------------- */ @@ -3333,8 +3335,9 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op) /* Project stroke in one axis */ if (ELEM(mode, GP_REPROJECT_FRONT, GP_REPROJECT_SIDE, GP_REPROJECT_TOP)) { - ED_gp_get_drawing_reference(scene, ob, gpl, - ts->gpencil_v3d_align, origin); + ED_gp_get_drawing_reference( + scene, ob, gpl, + ts->gpencil_v3d_align, origin); int axis = 0; switch (mode) { @@ -3360,8 +3363,9 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op) } } - ED_gp_project_point_to_plane(ob, rv3d, origin, - axis, &pt2); + ED_gp_project_point_to_plane( + ob, rv3d, origin, + axis, &pt2); copy_v3_v3(&pt->x, &pt2.x); @@ -3666,8 +3670,9 @@ void GPENCIL_OT_stroke_subdivide(wmOperatorType *ot) RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, 2.0f, "Smooth", "", 0.0f, 2.0f); prop = RNA_def_int(ot->srna, "repeat", 1, 1, 10, "Repeat", "", 1, 5); RNA_def_property_flag(prop, PROP_SKIP_SAVE); - RNA_def_boolean(ot->srna, "only_selected", true, "Selected Points", - "Smooth only selected points in the stroke"); + RNA_def_boolean( + ot->srna, "only_selected", true, "Selected Points", + "Smooth only selected points in the stroke"); RNA_def_boolean(ot->srna, "smooth_position", true, "Position", ""); RNA_def_boolean(ot->srna, "smooth_thickness", true, "Thickness", ""); RNA_def_boolean(ot->srna, "smooth_strength", false, "Strength", ""); @@ -4224,8 +4229,9 @@ void GPENCIL_OT_stroke_smooth(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); RNA_def_float(ot->srna, "factor", 0.5f, 0.0f, 2.0f, "Factor", "", 0.0f, 2.0f); - RNA_def_boolean(ot->srna, "only_selected", true, "Selected Points", - "Smooth only selected points in the stroke"); + RNA_def_boolean( + ot->srna, "only_selected", true, "Selected Points", + "Smooth only selected points in the stroke"); RNA_def_boolean(ot->srna, "smooth_position", true, "Position", ""); RNA_def_boolean(ot->srna, "smooth_thickness", true, "Thickness", ""); RNA_def_boolean(ot->srna, "smooth_strength", false, "Strength", ""); @@ -4306,7 +4312,7 @@ static void gpencil_cutter_dissolve(bGPDlayer *hit_layer, bGPDstroke *hit_stroke } } gp_stroke_delete_tagged_points( - hit_layer->actframe, hit_stroke, gpsn, GP_SPOINT_TAG, false, 1); + hit_layer->actframe, hit_stroke, gpsn, GP_SPOINT_TAG, false, 1); } } @@ -4365,7 +4371,7 @@ static int gpencil_cutter_lasso_select( float r_hita[3], r_hitb[3]; if (gps->totpoints > 1) { ED_gpencil_select_stroke_segment( - gpl, gps, pt, true, true, scale, r_hita, r_hitb); + gpl, gps, pt, true, true, scale, r_hita, r_hitb); } /* avoid infinite loops */ if (gps->totpoints > oldtot) { diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index 680568a96c5..7668b7cf5fd 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -349,8 +349,8 @@ static void gp_render_offscreen(tGPDfill *tgpf) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); ED_view3d_update_viewmat( - tgpf->depsgraph, tgpf->scene, tgpf->v3d, tgpf->ar, - NULL, winmat, NULL); + tgpf->depsgraph, tgpf->scene, tgpf->v3d, tgpf->ar, + NULL, winmat, NULL); /* set for opengl */ GPU_matrix_projection_set(tgpf->rv3d->winmat); GPU_matrix_set(tgpf->rv3d->viewmat); diff --git a/source/blender/editors/gpencil/gpencil_old.c b/source/blender/editors/gpencil/gpencil_old.c index b1924b3cacd..5d6abb594ce 100644 --- a/source/blender/editors/gpencil/gpencil_old.c +++ b/source/blender/editors/gpencil/gpencil_old.c @@ -187,7 +187,7 @@ static int gpencil_convert_old_files_exec(bContext *C, wmOperator *UNUSED(op)) * to put them into from here... */ printf("WARNING: Old Grease Pencil data ('%s') still exists on Object '%s'\n", - ob->gpd->id.name + 2, ob->id.name + 2); + ob->gpd->id.name + 2, ob->id.name + 2); } } } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 50a7d9d8703..99b38098138 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -830,7 +830,7 @@ static short gp_stroke_addpoint( if (gpencil_project_check(p)) { view3d_region_operator_needs_opengl(p->win, p->ar); ED_view3d_autodist_init( - p->depsgraph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0); + p->depsgraph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0); } /* convert screen-coordinates to appropriate coordinates (and store them) */ @@ -2306,10 +2306,11 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr) immUniform1f("dash_width", 12.0f); immUniform1f("dash_factor", 0.5f); - imm_draw_circle_wire_2d(shdr_pos, x, y, p->radius, - /* XXX Dashed shader gives bad results with sets of small segments currently, - * temp hack around the issue. :( */ - max_ii(8, p->radius / 2)); /* was fixed 40 */ + imm_draw_circle_wire_2d( + shdr_pos, x, y, p->radius, + /* XXX Dashed shader gives bad results with sets of small segments currently, + * temp hack around the issue. :( */ + max_ii(8, p->radius / 2)); /* was fixed 40 */ immUnbindProgram(); @@ -3363,8 +3364,7 @@ static void gpencil_add_missing_events(bContext *C, wmOperator *op, const wmEven interp_v2_v2v2(pt, a, b, 0.5f); sub_v2_v2v2(pt, b, pt); /* create fake event */ - gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), - pt[0], pt[1]); + gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), pt[0], pt[1]); } else if (dist >= factor) { int slices = 2 + (int)((dist - 1.0) / factor); @@ -3373,8 +3373,9 @@ static void gpencil_add_missing_events(bContext *C, wmOperator *op, const wmEven interp_v2_v2v2(pt, a, b, n * i); sub_v2_v2v2(pt, b, pt); /* create fake event */ - gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), - pt[0], pt[1]); + gpencil_draw_apply_event( + C, op, event, CTX_data_depsgraph(C), + pt[0], pt[1]); } } } @@ -3577,8 +3578,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) if (G.debug & G_DEBUG) { printf("found alternative region %p (old was %p) - at %d %d (sa: %d %d -> %d %d)\n", - current_region, p->ar, event->x, event->y, - p->sa->totrct.xmin, p->sa->totrct.ymin, p->sa->totrct.xmax, p->sa->totrct.ymax); + current_region, p->ar, event->x, event->y, + p->sa->totrct.xmin, p->sa->totrct.ymin, p->sa->totrct.xmax, p->sa->totrct.ymax); } if (current_region) { @@ -3754,7 +3755,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) /* event doesn't need to be handled */ #if 0 printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n", - event->type, event->type == MIDDLEMOUSE, event->type == MOUSEMOVE); + event->type, event->type == MIDDLEMOUSE, event->type == MOUSEMOVE); #endif break; } diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index 3a2347d9177..88906488e1a 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -412,32 +412,33 @@ static void gpencil_primitive_status_indicators(bContext *C, tGPDprimitive *tgpi if (tgpi->type == GP_STROKE_LINE) { BLI_strncpy( - msg_str, - IFACE_("Line: ESC to cancel, LMB set origin, Enter/MMB to confirm, WHEEL/+- to adjust subdivision number, Shift to align, Alt to center, E: extrude"), - UI_MAX_DRAW_STR); + msg_str, + IFACE_("Line: ESC to cancel, LMB set origin, Enter/MMB to confirm, WHEEL/+- to adjust subdivision number, Shift to align, Alt to center, E: extrude"), + UI_MAX_DRAW_STR); } else if (tgpi->type == GP_STROKE_BOX) { BLI_strncpy( - msg_str, - IFACE_("Rectangle: ESC to cancel, LMB set origin, Enter/MMB to confirm, WHEEL/+- to adjust subdivision number, Shift to square, Alt to center"), - UI_MAX_DRAW_STR); + msg_str, + IFACE_("Rectangle: ESC to cancel, LMB set origin, Enter/MMB to confirm, WHEEL/+- to adjust subdivision number, Shift to square, Alt to center"), + UI_MAX_DRAW_STR); } else if (tgpi->type == GP_STROKE_CIRCLE) { BLI_strncpy( - msg_str, - IFACE_("Circle: ESC to cancel, Enter/MMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center"), - UI_MAX_DRAW_STR); + msg_str, + IFACE_("Circle: ESC to cancel, Enter/MMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center"), + UI_MAX_DRAW_STR); } else if (tgpi->type == GP_STROKE_ARC) { - BLI_strncpy(msg_str, - IFACE_("Arc: ESC to cancel, Enter/MMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center, M: Flip, E: extrude"), - UI_MAX_DRAW_STR); + BLI_strncpy( + msg_str, + IFACE_("Arc: ESC to cancel, Enter/MMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center, M: Flip, E: extrude"), + UI_MAX_DRAW_STR); } else if (tgpi->type == GP_STROKE_CURVE) { BLI_strncpy( - msg_str, - IFACE_("Curve: ESC to cancel, Enter/MMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center, E: extrude"), - UI_MAX_DRAW_STR); + msg_str, + IFACE_("Curve: ESC to cancel, Enter/MMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center, E: extrude"), + UI_MAX_DRAW_STR); } if (ELEM(tgpi->type, GP_STROKE_CIRCLE, GP_STROKE_ARC, GP_STROKE_LINE, GP_STROKE_BOX)) { @@ -924,8 +925,9 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) /* get origin to reproject point */ float origin[3]; - ED_gp_get_drawing_reference(tgpi->scene, tgpi->ob, tgpi->gpl, - ts->gpencil_v3d_align, origin); + ED_gp_get_drawing_reference( + tgpi->scene, tgpi->ob, tgpi->gpl, + ts->gpencil_v3d_align, origin); /* reproject current */ ED_gpencil_tpoint_to_point(tgpi->ar, origin, tpt, &spt); ED_gp_project_point_to_plane(tgpi->ob, tgpi->rv3d, origin, tgpi->lock_axis - 1, &spt); @@ -987,10 +989,11 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) /* reproject to plane */ if (!is_depth) { float origin[3]; - ED_gp_get_drawing_reference(tgpi->scene, tgpi->ob, tgpi->gpl, - ts->gpencil_v3d_align, origin); + ED_gp_get_drawing_reference( + tgpi->scene, tgpi->ob, tgpi->gpl, + ts->gpencil_v3d_align, origin); ED_gp_project_stroke_to_plane( - tgpi->ob, tgpi->rv3d, gps, origin, ts->gp_sculpt.lock_axis - 1); + tgpi->ob, tgpi->rv3d, gps, origin, ts->gp_sculpt.lock_axis - 1); } /* if parented change position relative to parent object */ diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index 0862a8661a3..99bbf10cdc1 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -877,7 +877,7 @@ static bool gp_stroke_do_circle_sel( float r_hita[3], r_hitb[3]; bool hit_select = (bool)(pt1->flag & GP_SPOINT_SELECT); ED_gpencil_select_stroke_segment( - gpl, gps, pt1, hit_select, false, scale, r_hita, r_hitb); + gpl, gps, pt1, hit_select, false, scale, r_hita, r_hitb); } /* Ensure that stroke selection is in sync with its points */ @@ -942,8 +942,8 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op) GP_EDITABLE_STROKES_BEGIN(gpstroke_iter, C, gpl, gps) { changed |= gp_stroke_do_circle_sel( - gpl, gps, &gsc, mx, my, radius, select, &rect, - gpstroke_iter.diff_mat, selectmode, scale); + gpl, gps, &gsc, mx, my, radius, select, &rect, + gpstroke_iter.diff_mat, selectmode, scale); } GP_EDITABLE_STROKES_END(gpstroke_iter); @@ -1066,7 +1066,7 @@ static int gpencil_generic_select_exec( bool hit_select = (bool)(pt->flag & GP_SPOINT_SELECT); float r_hita[3], r_hitb[3]; ED_gpencil_select_stroke_segment( - gpl, gps, pt, hit_select, false, scale, r_hita, r_hitb); + gpl, gps, pt, hit_select, false, scale, r_hita, r_hitb); } } diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 5f703808d53..84bfd709b10 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -796,8 +796,9 @@ bool gp_point_xy_to_3d(const GP_SpaceConversion *gsc, Scene *scene, const float const RegionView3D *rv3d = gsc->ar->regiondata; float rvec[3]; - ED_gp_get_drawing_reference(scene, gsc->ob, gsc->gpl, - scene->toolsettings->gpencil_v3d_align, rvec); + ED_gp_get_drawing_reference( + scene, gsc->ob, gsc->gpl, + scene->toolsettings->gpencil_v3d_align, rvec); float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL); @@ -2217,8 +2218,8 @@ int ED_gpencil_select_stroke_segment( int direction = 0; float(*points2d)[2] = MEM_mallocN(sizeof(*points2d) * gps->totpoints, "GP Stroke temp 2d points"); BKE_gpencil_stroke_2d_flat_ref( - gps->points, gps->totpoints, - gps->points, gps->totpoints, points2d, scale, &direction); + gps->points, gps->totpoints, + gps->points, gps->totpoints, points2d, scale, &direction); GHash *all_2d = BLI_ghash_ptr_new(__func__); @@ -2229,9 +2230,9 @@ int ED_gpencil_select_stroke_segment( /* the extremes of the stroke are scaled to improve collision detection * for near lines */ BKE_gpencil_stroke_2d_flat_ref( - gps->points, gps->totpoints, - gps_iter->points, gps_iter->totpoints, points2d_iter, - scale, &direction); + gps->points, gps->totpoints, + gps_iter->points, gps_iter->totpoints, points2d_iter, + scale, &direction); BLI_ghash_insert(all_2d, gps_iter, points2d_iter); } @@ -2255,7 +2256,7 @@ int ED_gpencil_select_stroke_segment( copy_v2_v2(p2d_a2, points2d[i2]); hit_a = gpencil_check_collision( - gps, gps_array, all_2d, totstrokes, p2d_a1, p2d_a2, r_hit2d); + gps, gps_array, all_2d, totstrokes, p2d_a1, p2d_a2, r_hit2d); if (select) { pta1->flag |= GP_SPOINT_SELECT; @@ -2289,7 +2290,7 @@ int ED_gpencil_select_stroke_segment( copy_v2_v2(p2d_a2, points2d[i2]); hit_b = gpencil_check_collision( - gps, gps_array, all_2d, totstrokes, p2d_a1, p2d_a2, r_hit2d); + gps, gps_array, all_2d, totstrokes, p2d_a1, p2d_a2, r_hit2d); if (select) { pta1->flag |= GP_SPOINT_SELECT; |