diff options
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_primitive.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_primitive.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index 77f2f5b7353..3ec14ee43b9 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -774,9 +774,9 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) bool found_depth = false; /* need to restore the original projection settings before packing up */ - view3d_region_operator_needs_opengl(tgpi->win, tgpi->ar); + view3d_region_operator_needs_opengl(tgpi->win, tgpi->region); ED_view3d_autodist_init(tgpi->depsgraph, - tgpi->ar, + tgpi->region, tgpi->v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0); @@ -784,9 +784,9 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) tGPspoint *ptc = &points2D[0]; for (i = 0; i < gps->totpoints; i++, ptc++) { round_v2i_v2fl(mval_i, &ptc->x); - if ((ED_view3d_autodist_depth(tgpi->ar, mval_i, depth_margin, depth_arr + i) == 0) && + if ((ED_view3d_autodist_depth(tgpi->region, mval_i, depth_margin, depth_arr + i) == 0) && (i && (ED_view3d_autodist_depth_seg( - tgpi->ar, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) { + tgpi->region, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) { interp_depth = true; } else { @@ -982,12 +982,12 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) float origin[3]; 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_gpencil_tpoint_to_point(tgpi->region, origin, tpt, &spt); ED_gp_project_point_to_plane( tgpi->scene, tgpi->ob, tgpi->rv3d, origin, tgpi->lock_axis - 1, &spt); /* reproject previous */ - ED_gpencil_tpoint_to_point(tgpi->ar, origin, tptb, &spt2); + ED_gpencil_tpoint_to_point(tgpi->region, origin, tptb, &spt2); ED_gp_project_point_to_plane( tgpi->scene, tgpi->ob, tgpi->rv3d, origin, tgpi->lock_axis - 1, &spt2); tgpi->totpixlen += len_v3v3(&spt.x, &spt2.x) / pixsize; @@ -1015,8 +1015,13 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) } /* convert screen-coordinates to 3D coordinates */ - gp_stroke_convertcoords_tpoint( - tgpi->scene, tgpi->ar, tgpi->ob, tgpi->gpl, p2d, depth_arr ? depth_arr + i : NULL, &pt->x); + gp_stroke_convertcoords_tpoint(tgpi->scene, + tgpi->region, + tgpi->ob, + tgpi->gpl, + p2d, + depth_arr ? depth_arr + i : NULL, + &pt->x); pt->pressure = pressure; pt->strength = strength; @@ -1040,7 +1045,7 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) for (int i = 0; i < tgpi->gpd->runtime.tot_cp_points; i++) { bGPDcontrolpoint *cp = &cps[i]; gp_stroke_convertcoords_tpoint( - tgpi->scene, tgpi->ar, tgpi->ob, tgpi->gpl, (tGPspoint *)cp, NULL, &cp->x); + tgpi->scene, tgpi->region, tgpi->ob, tgpi->gpl, (tGPspoint *)cp, NULL, &cp->x); } } @@ -1160,8 +1165,8 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op) tgpi->scene = scene; tgpi->ob = CTX_data_active_object(C); tgpi->sa = CTX_wm_area(C); - tgpi->ar = CTX_wm_region(C); - tgpi->rv3d = tgpi->ar->regiondata; + tgpi->region = CTX_wm_region(C); + tgpi->rv3d = tgpi->region->regiondata; tgpi->v3d = tgpi->sa->spacedata.first; tgpi->depsgraph = CTX_data_ensure_evaluated_depsgraph(C); tgpi->win = CTX_wm_window(C); @@ -1175,7 +1180,7 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op) /* set GP datablock */ tgpi->gpd = gpd; /* region where paint was originated */ - tgpi->gpd->runtime.ar = tgpi->ar; + tgpi->gpd->runtime.ar = tgpi->region; /* if brush doesn't exist, create a new set (fix damaged files from old versions) */ if ((paint->brush == NULL) || (paint->brush->gpencil_settings == NULL)) { |