Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_primitive.c
| Show First 20 Lines • Show All 779 Lines • ▼ Show 20 Lines | static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) | ||||
| float *depth_arr = NULL; | float *depth_arr = NULL; | ||||
| if (is_depth) { | if (is_depth) { | ||||
| int mval_i[2], mval_prev[2] = {0}; | int mval_i[2], mval_prev[2] = {0}; | ||||
| bool interp_depth = false; | bool interp_depth = false; | ||||
| bool found_depth = false; | bool found_depth = false; | ||||
| /* 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(tgpi->win, tgpi->region); | view3d_region_operator_needs_opengl(tgpi->win, tgpi->region); | ||||
| ED_view3d_autodist_init(tgpi->depsgraph, | ED_view3d_depth_override(tgpi->depsgraph, | ||||
| tgpi->region, | tgpi->region, | ||||
| tgpi->v3d, | tgpi->v3d, | ||||
| (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0); | NULL, | ||||
| (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? | |||||
| V3D_DEPTH_GPENCIL_ONLY : | |||||
| V3D_DEPTH_NO_GPENCIL, | |||||
| false); | |||||
| depth_arr = MEM_mallocN(sizeof(float) * gps->totpoints, "depth_points"); | depth_arr = MEM_mallocN(sizeof(float) * gps->totpoints, "depth_points"); | ||||
| tGPspoint *ptc = &points2D[0]; | tGPspoint *ptc = &points2D[0]; | ||||
| for (int i = 0; i < gps->totpoints; i++, ptc++) { | for (int i = 0; i < gps->totpoints; i++, ptc++) { | ||||
| round_v2i_v2fl(mval_i, &ptc->x); | round_v2i_v2fl(mval_i, &ptc->x); | ||||
| if ((ED_view3d_autodist_depth(tgpi->region, 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( | (i && (ED_view3d_autodist_depth_seg( | ||||
| tgpi->region, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) { | tgpi->region, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) { | ||||
| ▲ Show 20 Lines • Show All 1,339 Lines • Show Last 20 Lines | |||||