Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/drawgpencil.c
| Show First 20 Lines • Show All 1,666 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* draw grease-pencil sketches to specified 3d-view assuming that matrices are already set correctly | /* draw grease-pencil sketches to specified 3d-view assuming that matrices are already set correctly | ||||
| * Note: this gets called twice - first time with only3d=true to draw 3d-strokes, | * Note: this gets called twice - first time with only3d=true to draw 3d-strokes, | ||||
| * second time with only3d=false for screen-aligned strokes */ | * second time with only3d=false for screen-aligned strokes */ | ||||
| void ED_gpencil_draw_view3d(wmWindowManager *wm, | void ED_gpencil_draw_view3d(wmWindowManager *wm, | ||||
| Scene *scene, | Scene *scene, | ||||
| ViewLayer *view_layer, | ViewLayer *view_layer, | ||||
| const struct Depsgraph *depsgraph, | |||||
| View3D *v3d, | View3D *v3d, | ||||
| ARegion *ar, | ARegion *ar, | ||||
| bool only3d) | bool only3d) | ||||
| { | { | ||||
| int dflag = 0; | int dflag = 0; | ||||
| RegionView3D *rv3d = ar->regiondata; | RegionView3D *rv3d = ar->regiondata; | ||||
| int offsx, offsy, winx, winy; | int offsx, offsy, winx, winy; | ||||
| /* check that we have grease-pencil stuff to draw */ | /* check that we have grease-pencil stuff to draw */ | ||||
| bGPdata *gpd = ED_gpencil_data_get_active_v3d(scene, view_layer); | bGPdata *gpd = ED_gpencil_data_get_active_v3d(scene, view_layer); | ||||
| if (gpd == NULL) return; | if (gpd == NULL) return; | ||||
| /* when rendering to the offscreen buffer we don't want to | /* when rendering to the offscreen buffer we don't want to | ||||
| * deal with the camera border, otherwise map the coords to the camera border. */ | * deal with the camera border, otherwise map the coords to the camera border. */ | ||||
| if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) { | if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) { | ||||
| rctf rectf; | rctf rectf; | ||||
| ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &rectf, true); /* no shift */ | ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, &rectf, true); /* no shift */ | ||||
| offsx = round_fl_to_int(rectf.xmin); | offsx = round_fl_to_int(rectf.xmin); | ||||
| offsy = round_fl_to_int(rectf.ymin); | offsy = round_fl_to_int(rectf.ymin); | ||||
| winx = round_fl_to_int(rectf.xmax - rectf.xmin); | winx = round_fl_to_int(rectf.xmax - rectf.xmin); | ||||
| winy = round_fl_to_int(rectf.ymax - rectf.ymin); | winy = round_fl_to_int(rectf.ymax - rectf.ymin); | ||||
| } | } | ||||
| else { | else { | ||||
| offsx = 0; | offsx = 0; | ||||
| Show All 38 Lines | |||||