[Bf-blender-cvs] [4fae067] PSketch: PSculpt: Hacky first attempt at "superbrush" mode for Adjust
Joshua Leung
noreply at git.blender.org
Sun Jan 31 14:29:24 CET 2016
Commit: 4fae0677e0b131d79c1490247f8f2f94581c5e7e
Author: Joshua Leung
Date: Tue Jan 19 01:22:22 2016 +1300
Branches: PSketch
https://developer.blender.org/rB4fae0677e0b131d79c1490247f8f2f94581c5e7e
PSculpt: Hacky first attempt at "superbrush" mode for Adjust
Instead of inverting the brush behaviour, holding shift for the Adjust brush
will instead activate grab, making it easier to switch between these without
having to go via the buttons.
Verdict:
This only works partially. It still doesn't feel right - especially with the
Sintel rig, as the arm FK rotations feel like they go in the wrong directions.
===================================================================
M source/blender/editors/armature/pose_sculpt.c
===================================================================
diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index eccbb26..dc230b5 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -1196,12 +1196,24 @@ static void psculpt_brush_apply(bContext *C, wmOperator *op, PointerRNA *itemptr
case PSCULPT_BRUSH_DRAW: // XXX: placeholder... we need a proper "draw" brush
case PSCULPT_BRUSH_ADJUST:
{
- /* Compute trackball effect */
- psculpt_brush_calc_trackball(pso, &data);
-
- /* Apply trackball transform to bones... */
- // TODO: if no bones affected, fall back to the ones last affected (as we may have slipped off into space)
- changed = psculpt_brush_do_apply(pso, &data, psculpt_brush_adjust_apply);
+ if (data.invert) {
+ /* Shift = Hardcoded convenience shortcut to perform Grab */
+ float delta[2] = {dx, dy};
+ ED_view3d_win_to_delta(ar, delta, data.dvec, zfac);
+
+ /* Hack: Clear invert flag, or else translate behaves wrong */
+ data.invert = false;
+
+ changed = psculpt_brush_do_apply(pso, &data, psculpt_brush_grab_apply);
+ }
+ else {
+ /* Compute trackball effect */
+ psculpt_brush_calc_trackball(pso, &data);
+
+ /* Apply trackball transform to bones... */
+ // TODO: if no bones affected, fall back to the ones last affected (as we may have slipped off into space)
+ changed = psculpt_brush_do_apply(pso, &data, psculpt_brush_adjust_apply);
+ }
break;
}
More information about the Bf-blender-cvs
mailing list