Grease Pencil Erase: removes lines behind the view
Open, ConfirmedPublic

Description

In 2.78 (current master) the grease pencil erase tool doesn't check if the line is in front of the view or not.

In this file, use the eraser in the top viewport, (just erase over the whole view a few strokes). notice in the bottom viewport that lines are removed which aren't visible.


Likely cause is gp_point_to_xy not passing V3D_PROJ_TEST_CLIP_NEAR flag.
view3d_point_depth also isn't correctly checking the depth - should probably call mul_project_m4_v3_zfac directly since ED_view3d_calc_zfac flips negative values - since its intended for tool code.

Details

Type
Bug

Looks like the problem is not limited to 'erase'. A newly drawn line also falls behind the view after certain zoom.

@Joshua Leung (aligorith) Could you look at this? I don't know this part of the code. Let me know if I can help you.

Joshua Leung (aligorith) triaged this task as "Confirmed" priority.Jan 2 2017, 4:27 AM
Joshua Leung (aligorith) added a project: Restricted Project.

Hey Campbell, thanks for the tips!

IIRC, the eraser and the sculpt brushes don't currently take occlusion (geometry/zbuf stuff) into account when determining what to affect, though we should add support for that as it is quite useful to have.