From da7ace00d5fb534d8583c0b70497d7819bc7b273 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Thu, 15 Oct 2020 19:13:29 +0200 Subject: Sculpt: Use cursor depth in trimming gestures This adds an operator property to use the paint cursor radius and position for the depth of the trimming shape created by the trimming tools. When enabled, the shape is located in the surface point when the gesture started and it will have the depth of the cursor radius. When the cursor is not over the mesh, the shape will be positioned at the center of the depth of the whole object from the viewport camera. Reviewed By: dbystedt, sergey Differential Revision: https://developer.blender.org/D9129 --- source/blender/blenkernel/BKE_paint.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/blenkernel/BKE_paint.h') diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 614badb59f9..0d3241ba6b8 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -511,6 +511,11 @@ typedef struct SculptSession { float cursor_sampled_normal[3]; float cursor_view_normal[3]; + /* For Sculpt trimming gesture tools, initial raycast data from the position of the mouse when + * the gesture starts (intersection with the surface and if they ray hit the surface or not). */ + float gesture_initial_location[3]; + bool gesture_initial_hit; + /* TODO(jbakker): Replace rv3d adn v3d with ViewContext */ struct RegionView3D *rv3d; struct View3D *v3d; -- cgit v1.2.3