Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_paint.c
| Show First 20 Lines • Show All 1,080 Lines • ▼ Show 20 Lines | if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) { | ||||
| /* reproject to plane (only in 3d space) */ | /* reproject to plane (only in 3d space) */ | ||||
| gpencil_reproject_toplane(p, gps); | gpencil_reproject_toplane(p, gps); | ||||
| pt = gps->points; | pt = gps->points; | ||||
| for (int i = 0; i < gps->totpoints; i++, pt++) { | for (int i = 0; i < gps->totpoints; i++, pt++) { | ||||
| /* if parented change position relative to parent object */ | /* if parented change position relative to parent object */ | ||||
| gpencil_apply_parent_point(depsgraph, obact, gpl, pt); | gpencil_apply_parent_point(depsgraph, obact, gpl, pt); | ||||
| } | } | ||||
| /* if camera view, reproject flat to view to avoid perspective effect */ | /* If camera view or view projection, reproject flat to view to avoid perspective effect. */ | ||||
| if (is_camera) { | if ((*p->align_flag & GP_PROJECT_VIEWSPACE) || is_camera) { | ||||
| ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps); | ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| float *depth_arr = NULL; | float *depth_arr = NULL; | ||||
| /* get an array of depths, far depths are blended */ | /* get an array of depths, far depths are blended */ | ||||
| if (gpencil_project_check(p)) { | if (gpencil_project_check(p)) { | ||||
| ▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) && | ||||
| (brush->gpencil_settings->simplify_f > 0.0f)) { | (brush->gpencil_settings->simplify_f > 0.0f)) { | ||||
| BKE_gpencil_stroke_simplify_adaptive(gpd, gps, brush->gpencil_settings->simplify_f); | BKE_gpencil_stroke_simplify_adaptive(gpd, gps, brush->gpencil_settings->simplify_f); | ||||
| } | } | ||||
| /* reproject to plane (only in 3d space) */ | /* reproject to plane (only in 3d space) */ | ||||
| gpencil_reproject_toplane(p, gps); | gpencil_reproject_toplane(p, gps); | ||||
| /* change position relative to parent object */ | /* change position relative to parent object */ | ||||
| gpencil_apply_parent(depsgraph, obact, gpl, gps); | gpencil_apply_parent(depsgraph, obact, gpl, gps); | ||||
| /* if camera view, reproject flat to view to avoid perspective effect */ | /* If camera view or view projection, reproject flat to view to avoid perspective effect. */ | ||||
| if (is_camera) { | if ((*p->align_flag & GP_PROJECT_VIEWSPACE) || is_camera) { | ||||
| ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps); | ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps); | ||||
| } | } | ||||
| if (depth_arr) { | if (depth_arr) { | ||||
| MEM_freeN(depth_arr); | MEM_freeN(depth_arr); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,746 Lines • Show Last 20 Lines | |||||