Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2019-09-27 19:03:18 +0300
committerPablo Dobarro <pablodp606@gmail.com>2019-09-27 19:35:42 +0300
commit6a74b7c14b393c769f85e78360ec0e74198199cf (patch)
tree9e5eed6ce58313371848198b108200b798b450f7 /source/blender/editors/sculpt_paint/paint_cursor.c
parent7ae549448eabe633091a0c94257dc6090eda0d64 (diff)
Sculpt: Pose brush origin offset
With the previous behavior, it was impossible to manipulate areas with a lot of complex shapes like fingers, as the pose origin was calculated only with the topology inside the radius. With pose offset, the previous method is used to calculate the direction of the "bone", and an extra offset is added on top of it. This way you can set the pose origin in the correct place in this kind of situations. The pose factor grows to fit the new rotation origin. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D5841
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index df3d4b115cc..286cf97c20e 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1352,10 +1352,12 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
SculptCursorGeometryInfo gi;
float mouse[2] = {x - ar->winrct.xmin, y - ar->winrct.ymin};
+ int prev_active_vertex_index = -1;
bool is_cursor_over_mesh = false;
/* Update the active vertex */
- if ((mode == PAINT_MODE_SCULPT) && !ups->stroke_active) {
+ if ((mode == PAINT_MODE_SCULPT) && ss && !ups->stroke_active) {
+ prev_active_vertex_index = ss->active_vertex_index;
is_cursor_over_mesh = sculpt_cursor_geometry_info_update(
C, &gi, mouse, !(brush->falloff_shape & BRUSH_AIRBRUSH));
}
@@ -1374,7 +1376,6 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
}
if (!ups->stroke_active) {
- int prev_active_vertex_index = ss->active_vertex_index;
bool update_previews = false;
if (is_cursor_over_mesh && !alpha_overlay_active) {
@@ -1404,7 +1405,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
if (update_previews) {
BKE_sculpt_update_object_for_edit(depsgraph, vc.obact, true, false);
sculpt_pose_calc_pose_data(
- sd, vc.obact, ss, gi.location, rds, ss->pose_origin, NULL);
+ sd, vc.obact, ss, gi.location, rds, brush->pose_offset, ss->pose_origin, NULL);
}
cursor_draw_point_screen_space(pos, ar, ss->pose_origin, vc.obact->obmat, 5);
}