Commit: 5542bfaa8139fd8ba918ea93525070ccabdc998a
Author: Joshua Leung
Date: Sun Jan 17 19:48:22 2016 +1300
Branches: PSketch
https://developer.blender.org/rB5542bfaa8139fd8ba918ea93525070ccabdc998a
PSculpt: Rename Draw/Trackball -> Adjust
After a few days of playing around with this, it seems that, while close to the
behaviour we want, "trackball" doesn't quite act as a general purpose "Draw"
(i.e. you'd expect to be able to do line of action stuff with that, and
trackball
fails for that case). However, trackball excels at another situation: tweaking
and adjusting existing poses to add a bit more character, or to generally
improve the
pose "in place". Hence the decision to retain and rename this brush.
Notes:
* For now, "Draw" still does the same thing as Adjust. It'll stay that way until
I come up with a better draw brush
* Knocked out "Radial" and "Wrap" from the types enum for now. They'll come back
later when we actually implement them. Until then, they'll stay hidden, in
case
we just want to knock them out completely (and to avoid confusing testers)
===================================================================
M source/blender/editors/armature/pose_sculpt.c
M source/blender/makesdna/DNA_scene_types.h
M source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
diff --git a/source/blender/editors/armature/pose_sculpt.c
b/source/blender/editors/armature/pose_sculpt.c
index 79b733e..e939ec4 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -309,13 +309,13 @@ static void set_pchan_eul_rotation(const float eul[3],
bPoseChannel *pchan)
#define TD_PBONE_LOCAL_MTX_C (1 << 0)
#define TD_PBONE_LOCAL_MTX_P (1 << 1)
-/* Perform trackball rotation on the given bone
+/* Apply given rotation on the given bone
*
* Adapted from the transform system code for trackball rotations
* - Main method adapted from the T_POSE case for ElementRotation() in
transform.c
* - All transform/setup math adapted from bPoseChannel -> TransData stuff in
transform_conversions.c
*/
-static void pchan_do_trackball_rotate(Object *ob, bPoseChannel *pchan, float
mat[3][3])
+static void pchan_do_rotate(Object *ob, bPoseChannel *pchan, float mat[3][3])
{
float mtx[3][3], smtx[3][3], r_mtx[3][3], r_smtx[3][3], l_smtx[3][3];
//float center[3] = {0}, td_center[3] = {0};
@@ -684,11 +684,11 @@ static void brush_select_bone(tPoseSculptingOp *pso,
tPSculptContext *data, bPos
}
}
-/* "Trackball" Brush */
+/* "Adjust" Brush - i.e. a simple trackball transform */
// TODO: on root bones, don't do trackball... do grab instead?
-static void brush_trackball(tPoseSculptingOp *pso, tPSculptContext *data,
bPoseChannel *pchan, float UNUSED(sco1[2]), float UNUSED(sco2[2]))
+static void brush_adjust(tPoseSculptingOp *pso, tPSculptContext *data,
bPoseChannel *pchan, float UNUSED(sco1[2]), float UNUSED(sco2[2]))
{
- pchan_do_trackball_rotate(data->ob, pchan, data->rmat);
+ pchan_do_rotate(data->ob, pchan, data->rmat);
}
/* "smooth" brush */
@@ -1134,7 +1134,8 @@ static void psculpt_brush_apply(bContext *C, wmOperator
*op, PointerRNA *itemptr
/* apply brushes */
switch (pset->brushtype) {
- case PSCULPT_BRUSH_DRAW:
+ case PSCULPT_BRUSH_DRAW: // XXX: placeholder... we need
a proper "draw" brush
+ case PSCULPT_BRUSH_ADJUST:
{
float smat[3][3], totmat[3][3];
float mat[3][3], refmat[3][3];
@@ -1167,7 +1168,7 @@ static void psculpt_brush_apply(bContext *C, wmOperator
*op, PointerRNA *itemptr
/* 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,
brush_trackball, selected);
+ changed = psculpt_brush_do_apply(pso, &data,
brush_adjust, selected);
break;
}
diff --git a/source/blender/makesdna/DNA_scene_types.h
b/source/blender/makesdna/DNA_scene_types.h
index 65b522e..3fb00fe 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2090,20 +2090,22 @@ typedef enum eGPencil_Placement_Flags {
/* toolsetting->psculpt brushtype */
typedef enum ePSculptBrushType {
- PSCULPT_BRUSH_DRAW = 0,
- PSCULPT_BRUSH_SMOOTH = 1,
- PSCULPT_BRUSH_GRAB = 2,
- PSCULPT_BRUSH_CURL = 3,
- PSCULPT_BRUSH_STRETCH = 4,
- PSCULPT_BRUSH_TWIST = 5,
- PSCULPT_BRUSH_RADIAL = 6,
- PSCULPT_BRUSH_WRAP = 7,
- PSCULPT_BRUSH_RESET = 8,
- PSCULPT_BRUSH_SELECT = 9 /* XXX */
+ PSCULPT_BRUSH_DRAW = 0,
+ PSCULPT_BRUSH_ADJUST = 1,
+ PSCULPT_BRUSH_SMOOTH = 2,
+ PSCULPT_BRUSH_GRAB = 3,
+ PSCULPT_BRUSH_CURL = 4,
+ PSCULPT_BRUSH_STRETCH = 5,
+ PSCULPT_BRUSH_TWIST = 6,
+ PSCULPT_BRUSH_RESET = 7,
+ PSCULPT_BRUSH_SELECT = 8,
+ PSCULPT_BRUSH_RADIAL = 9,
+ PSCULPT_BRUSH_WRAP = 10,
+
+ /* this must equal PSculptSetitngs.brush array size */
+ PSCULPT_TOT_BRUSH = 11
} ePSculptBrushType;
-/* this must equal PSculptSetitngs.brush array size */
-#define PSCULPT_TOT_BRUSH 10
/* PSculptBrushData.flag */
typedef enum ePSculptBrush_Flag {
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c
b/source/blender/makesrna/intern/rna_sculpt_paint.c
index dde0c4f..ddb59a3 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -1084,18 +1084,21 @@ static void rna_def_pose_sculpt(BlenderRNA *brna)
static EnumPropertyItem pose_sculpt_brush_items[] = {
{0, "", 0, "Draw:", ""},
{PSCULPT_BRUSH_DRAW, "DRAW", 0, "Draw", "Easily sculpt bones
into place by drawing over the rig"},
- {PSCULPT_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Reduce
differences between bones"},
+ {PSCULPT_BRUSH_ADJUST, "ADJUST", 0, "Adjust", "Make small
adjustments to the pose using a trackball-like tool"},
+ {PSCULPT_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Reduce
orientation differences between bones"},
{0, "", 0, "Transform:", ""},
{PSCULPT_BRUSH_GRAB, "GRAB", 0, "Grab", "Move bones around as
if affected by a force"},
{PSCULPT_BRUSH_CURL, "CURL", 0, "Curl", "Rotate all bones along
some local axis (e.g. finger curling)"},
- {PSCULPT_BRUSH_TWIST, "TWIST", 0, "Twist", "Scale bones
length-wise"},
+ {PSCULPT_BRUSH_TWIST, "TWIST", 0, "Twist", "Roll bones along
their main axis"},
{PSCULPT_BRUSH_STRETCH, "STRETCH", 0, "Stretch", "Scale bones
length-wise"},
-
+
+#if 0
{0, "", 0, "Distribute:", ""},
{PSCULPT_BRUSH_RADIAL, "RADIAL", 0, "Radial Spread",
"Distribute child bones in a radial manner"},
{PSCULPT_BRUSH_WRAP, "WRAP", 0, "Wrap", "Snap bones to lie on
the nearest surface"},
-
+#endif
+
{0, "", 0, "Utils:", ""},
{PSCULPT_BRUSH_RESET, "RESET", 0, "Reset", "Clear/reset
transforms"},
{PSCULPT_BRUSH_SELECT, "SELECT", 0, "Select", "Brush-select
bones to mask affected area"}, // TODO: rename define
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs