[Bf-blender-cvs] [79cc0eb112b] PSketch-279: Revise a few earlier changes in preparation for easier BBone support
Joshua Leung
noreply at git.blender.org
Tue May 8 18:03:00 CEST 2018
Commit: 79cc0eb112b28cd2abaab85395eb021c435f6894
Author: Joshua Leung
Date: Sun Dec 31 15:13:09 2017 +1300
Branches: PSketch-279
https://developer.blender.org/rB79cc0eb112b28cd2abaab85395eb021c435f6894
Revise a few earlier changes in preparation for easier BBone support
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/editors/armature/pose_sculpt.c
M source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 394a91aa8be..dcf88c0e674 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -924,11 +924,13 @@ class VIEW3D_PT_tools_posemode_sculpt(View3DPanel, Panel):
layout.row().prop(brush, "direction", expand=True)
if tool in ('GRAB', 'DRAW', 'ADJUST'):
- layout.row().prop(brush, "transform_mode", expand=True)
layout.prop(brush, "use_initial_only")
if tool in ('CURL', 'STRETCH'):
layout.row().prop(brush, "xz_mode", expand=True)
+ if tool in ('GRAB', 'DRAW', 'ADJUST', 'TWIST', 'STRETCH', 'RESET'):
+ layout.row().prop(brush, "transform_mode", expand=True)
+
if tool == 'STRETCH':
layout.separator()
layout.prop(brush, "use_volume_preserve")
diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index 9f0a973b5ba..7726db09077 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -134,7 +134,7 @@ typedef struct tPoseSculptingOp {
} tPoseSculptingOp;
/* Callback Function Signature */
-typedef void (*PSculptBrushCallback)(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist);
+typedef void (*PSculptBrushCallback)(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2]);
/* Cache data for a bone that's been affected by the sculpt tools */
@@ -841,7 +841,7 @@ static void free_affected_bone(void *tab_p)
/* Select ---------------------------------------------- */
/* change selection status of bones - used to define masks */
-static void psculpt_brush_select_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float UNUSED(dist))
+static void psculpt_brush_select_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float UNUSED(dist), float sco1[2], float sco2[2])
{
if (pchan->bone) {
if (pso->invert)
@@ -854,7 +854,7 @@ static void psculpt_brush_select_apply(tPoseSculptingOp *pso, bPoseChannel *pcha
/* Smooth ---------------------------------------------- */
/* "Smooth" brush */
-static void psculpt_brush_smooth_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_smooth_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
bPoseChannel *parent = pchan->parent;
float parent_vec[3], bone_vec[3], combined_vec[3];
@@ -923,7 +923,7 @@ static void psculpt_brush_smooth_apply(tPoseSculptingOp *pso, bPoseChannel *pcha
/* Grab ------------------------------------------------ */
/* "Grab" brush - Translate bone */
-static void psculpt_brush_grab_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_grab_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
PSculptBrushData *brush = pso->brush;
float imat[4][4], mat[4][4];
@@ -1029,7 +1029,7 @@ static void psculpt_brush_calc_trackball(tPoseSculptingOp *pso)
}
/* "Adjust" Brush - i.e. a simple rotation transform */
-static void psculpt_brush_adjust_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_adjust_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
/* Even though we don't use it here, the "Use Initial Only" option allows us to store
* the current influence of the bone for later. Currently though, the same transform
@@ -1117,7 +1117,7 @@ static float psculpt_brush_calc_input_angle(tPoseSculptingOp *pso, float center[
* The rotation here is performed around the screen-space plane's normal,
* just like "normal rotations" are usually performed
*/
-static void psculpt_brush_rotate_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_rotate_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
RegionView3D *rv3d = pso->rv3d;
@@ -1182,7 +1182,7 @@ static void psculpt_brush_rotate_apply(tPoseSculptingOp *pso, bPoseChannel *pcha
/* Curl -----------------------------------------------_ */
/* "Curl" brush - Rotate bone around its non-primary axes */
-static void psculpt_brush_curl_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_curl_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
PSculptBrushData *brush = pso->brush;
short locks = pchan->protectflag;
@@ -1225,7 +1225,7 @@ static void psculpt_brush_curl_apply(tPoseSculptingOp *pso, bPoseChannel *pchan,
/* Twist ----------------------------------------------- */
/* "Twist" brush - Rotate bone around its primary axis */
-static void psculpt_brush_twist_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_twist_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
short locks = pchan->protectflag;
float eul[3] = {0.0f};
@@ -1257,7 +1257,7 @@ static void psculpt_brush_twist_apply(tPoseSculptingOp *pso, bPoseChannel *pchan
/* Stretch --------------------------------------------- */
/* "Stretch" brush - Scale bone along its primary axis */
-static void psculpt_brush_stretch_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_stretch_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
PSculptBrushData *brush = pso->brush;
const short locks = pchan->protectflag;
@@ -1305,7 +1305,7 @@ static void psculpt_brush_stretch_apply(tPoseSculptingOp *pso, bPoseChannel *pch
* Instead, it blends between the current value and the rest pose,
* making it possible to "relax" the pose somewhat (if they are similar)
*/
-static void psculpt_brush_reset_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_reset_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
const float fac = psculpt_brush_calc_influence(pso, dist);
const short locks = pchan->protectflag;
@@ -1351,7 +1351,7 @@ static void psculpt_brush_reset_apply(tPoseSculptingOp *pso, bPoseChannel *pchan
* with a way to correct their mistakes (reset too far) without
* stopping to undo first and try again.
*/
-static void psculpt_brush_restore_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_restore_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
const float fac = psculpt_brush_calc_influence(pso, dist);
const short locks = pchan->protectflag;
@@ -1505,13 +1505,13 @@ static void psculpt_brush_restore_apply(tPoseSculptingOp *pso, bPoseChannel *pch
/* Unused ----------------------------------------------- */
/* "radial" brush */
-static void psculpt_brush_radial_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_radial_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
}
/* "wrap" brush */
-static void psculpt_brush_wrap_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist)
+static void psculpt_brush_wrap_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
}
@@ -1714,7 +1714,7 @@ static bool psculpt_brush_do_apply(tPoseSculptingOp *pso, PSculptBrushCallback b
dist = dist_to_line_v2(pso->mval, sco1, sco2);
/* apply callback to this bone */
- brush_cb(pso, pchan, dist);
+ brush_cb(pso, pchan, dist, sco1, sco2);
/* schedule this bone up for being keyframed (if autokeying is enabled) */
if (pso->ks) {
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 971b08b433f..67b2773a7f7 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -1175,8 +1175,8 @@ static void rna_def_pose_sculpt(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_tfm_mode_items[]= {
- {0, "BOTH", 0, "Both", "Affect both normal transforms and Bendy Bones"},
- {PSCULPT_BRUSH_NO_BBONE, "TRANSFORMS", 0, "Transform", "Affect normal transforms only"},
+ {0, "All", 0, "All", "Affect both normal transforms and Bendy Bones"},
+ {PSCULPT_BRUSH_NO_BBONE, "TRANSFORMS", 0, "Transform", "Affect bone transforms only"},
{PSCULPT_BRUSH_NO_TFM, "BBONES", 0, "BBones", "Affect Bendy Bone properties only"},
{0, NULL, 0, NULL, NULL}};
@@ -1259,7 +1259,7 @@ static void rna_def_pose_sculpt(BlenderRNA *brna)
prop = RNA_def_property(srna, "transform_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tfmMode");
RNA_def_property_enum_items(prop, prop_tfm_mode_items);
- RNA_def_property_ui_text(prop, "Transform Mode", "Which transforms (normal, Bendy Bones) get affected");
+ RNA_def_property_ui_text(prop, "Affect", "Which transforms (normal, Bendy Bones) get affected");
RNA_def_property_update(prop, 0, "rna_PSculptBrush_update");
/* only include initial bones */
More information about the Bf-blender-cvs
mailing list