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:
authorAntony Riakiotakis <kalast@gmail.com>2014-12-29 14:34:46 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-12-29 14:35:03 +0300
commit18854a65065456d9a92ad9408b7b32f1a70cafae (patch)
tree985bb6ab498f507cbb3c544355751a6cde163d63 /source/blender/editors/sculpt_paint/paint_image_proj.c
parent51a66a5a6e3e409f9e6d08f8b771d8e25e6a498e (diff)
Rotate around selection now will work on last stroke position in texture
paint too.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 0e337e96336..0832782db4b 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4521,7 +4521,34 @@ static bool project_paint_op(void *state, const float lastpos[2], const float po
touch_any = 1;
}
}
+
+ /* calculate pivot for rotation around seletion if needed */
+ if (U.uiflag & USER_ORBIT_SELECTION) {
+ float w[3];
+ int side, index;
+
+ index = project_paint_PickFace(ps, pos, w, &side);
+
+ if (index != -1) {
+ MFace *mf;
+ float world[3];
+ UnifiedPaintSettings *ups = &ps->scene->toolsettings->unified_paint_settings;
+
+ mf = ps->dm_mface + index;
+ if (side == 0) {
+ interp_v3_v3v3v3(world, ps->dm_mvert[(*(&mf->v1))].co, ps->dm_mvert[(*(&mf->v2))].co, ps->dm_mvert[(*(&mf->v3))].co, w);
+ }
+ else {
+ interp_v3_v3v3v3(world, ps->dm_mvert[(*(&mf->v1))].co, ps->dm_mvert[(*(&mf->v3))].co, ps->dm_mvert[(*(&mf->v4))].co, w);
+ }
+
+ ups->average_stroke_counter++;
+ add_v3_v3(ups->average_stroke_accum, world);
+ ups->last_stroke_valid = true;
+ }
+ }
+
return touch_any;
}