Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_paint.c
| Show First 20 Lines • Show All 1,716 Lines • ▼ Show 20 Lines | static void gpencil_stroke_doeraser(tGPsdata *p) | ||||
| rect.ymin = p->mval[1] - calc_radius; | rect.ymin = p->mval[1] - calc_radius; | ||||
| rect.xmax = p->mval[0] + calc_radius; | rect.xmax = p->mval[0] + calc_radius; | ||||
| rect.ymax = p->mval[1] + calc_radius; | rect.ymax = p->mval[1] + calc_radius; | ||||
| if (p->area->spacetype == SPACE_VIEW3D) { | if (p->area->spacetype == SPACE_VIEW3D) { | ||||
| if ((gp_settings != NULL) && (gp_settings->flag & GP_BRUSH_OCCLUDE_ERASER)) { | if ((gp_settings != NULL) && (gp_settings->flag & GP_BRUSH_OCCLUDE_ERASER)) { | ||||
| View3D *v3d = p->area->spacedata.first; | View3D *v3d = p->area->spacedata.first; | ||||
| view3d_region_operator_needs_opengl(p->win, p->region); | view3d_region_operator_needs_opengl(p->win, p->region); | ||||
| ED_view3d_autodist_init(p->depsgraph, p->region, v3d, 0); | ED_view3d_depth_override(p->depsgraph, p->region, v3d, NULL, V3D_DEPTH_NO_GPENCIL, false); | ||||
| } | } | ||||
| } | } | ||||
| /* loop over all layers too, since while it's easy to restrict editing to | /* loop over all layers too, since while it's easy to restrict editing to | ||||
| * only a subset of layers, it is harder to perform the same erase operation | * only a subset of layers, it is harder to perform the same erase operation | ||||
| * on multiple layers... | * on multiple layers... | ||||
| */ | */ | ||||
| LISTBASE_FOREACH (bGPDlayer *, gpl, &p->gpd->layers) { | LISTBASE_FOREACH (bGPDlayer *, gpl, &p->gpd->layers) { | ||||
| ▲ Show 20 Lines • Show All 566 Lines • ▼ Show 20 Lines | static void gpencil_paint_strokeend(tGPsdata *p) | ||||
| /* for surface sketching, need to set the right OpenGL context stuff so that | /* for surface sketching, need to set the right OpenGL context stuff so that | ||||
| * the conversions will project the values correctly... | * the conversions will project the values correctly... | ||||
| */ | */ | ||||
| if (gpencil_project_check(p)) { | if (gpencil_project_check(p)) { | ||||
| View3D *v3d = p->area->spacedata.first; | View3D *v3d = p->area->spacedata.first; | ||||
| /* need to restore the original projection settings before packing up */ | /* need to restore the original projection settings before packing up */ | ||||
| view3d_region_operator_needs_opengl(p->win, p->region); | view3d_region_operator_needs_opengl(p->win, p->region); | ||||
| ED_view3d_autodist_init( | ED_view3d_depth_override(p->depsgraph, | ||||
| p->depsgraph, p->region, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0); | p->region, | ||||
| v3d, | |||||
| NULL, | |||||
| (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? | |||||
| V3D_DEPTH_GPENCIL_ONLY : | |||||
| V3D_DEPTH_NO_GPENCIL, | |||||
| true); | |||||
| } | } | ||||
| /* check if doing eraser or not */ | /* check if doing eraser or not */ | ||||
| if ((p->gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) { | if ((p->gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) { | ||||
| /* transfer stroke to frame */ | /* transfer stroke to frame */ | ||||
| gpencil_stroke_newfrombuffer(p); | gpencil_stroke_newfrombuffer(p); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,711 Lines • Show Last 20 Lines | |||||