[Bf-blender-cvs] [4f272eea064] PSketch-279: Change unimplemented "Radial" brush to "Push" brush
Joshua Leung
noreply at git.blender.org
Tue May 8 18:03:03 CEST 2018
Commit: 4f272eea06496119067681e6b5de8b7ca21e08a9
Author: Joshua Leung
Date: Sun Dec 31 15:20:12 2017 +1300
Branches: PSketch-279
https://developer.blender.org/rB4f272eea06496119067681e6b5de8b7ca21e08a9
Change unimplemented "Radial" brush to "Push" brush
This is a dedicated brush for changing Bendy Bone shapes only
(and/or maybe adjusting the endpoints?)
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
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/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index dcf88c0e674..3b8e43ef905 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -928,7 +928,7 @@ class VIEW3D_PT_tools_posemode_sculpt(View3DPanel, Panel):
if tool in ('CURL', 'STRETCH'):
layout.row().prop(brush, "xz_mode", expand=True)
- if tool in ('GRAB', 'DRAW', 'ADJUST', 'TWIST', 'STRETCH', 'RESET'):
+ if tool in ('GRAB', 'PUSH', 'DRAW', 'ADJUST', 'TWIST', 'STRETCH', 'RESET'):
layout.row().prop(brush, "transform_mode", expand=True)
if tool == 'STRETCH':
diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index 7726db09077..d0f898e98c4 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -958,7 +958,7 @@ static void psculpt_brush_grab_apply(tPoseSculptingOp *pso, bPoseChannel *pchan,
fac = tab->fac;
}
}
- //printf("%s: %f (%d)\n", pchan->name, fac, pso->is_first);
+ printf("%s: %f (%d)\n", pchan->name, fac, pso->is_first);
/* compute inverse matrix to convert from screen-space to bone space */
mul_m4_m4m4(mat, pso->ob->obmat, pchan->bone->arm_mat);
@@ -1500,16 +1500,17 @@ static void psculpt_brush_restore_apply(tPoseSculptingOp *pso, bPoseChannel *pch
pchan->scaleOut = tab->bbscale[1];
}
+/* Push -------------------------------------------------- */
-
-/* Unused ----------------------------------------------- */
-
-/* "radial" brush */
-static void psculpt_brush_radial_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
+/* "push" brush - for bendy bones */
+static void psculpt_brush_push_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
-
+ // TODO: Adjust bendy bones only
}
+
+/* Unused ----------------------------------------------- */
+
/* "wrap" brush */
static void psculpt_brush_wrap_apply(tPoseSculptingOp *pso, bPoseChannel *pchan, float dist, float sco1[2], float sco2[2])
{
@@ -1829,10 +1830,10 @@ static void psculpt_brush_apply(bContext *C, wmOperator *op, PointerRNA *itemptr
break;
}
- case PSCULPT_BRUSH_RADIAL:
+ case PSCULPT_BRUSH_PUSH:
{
- // XXX: placeholder
- changed = psculpt_brush_do_apply(pso, psculpt_brush_radial_apply);
+ ED_view3d_win_to_delta(pso->ar, delta, pso->dvec, zfac);
+ changed = psculpt_brush_do_apply(pso, psculpt_brush_push_apply);
break;
}
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index df8cc4c6612..8750463fa9b 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2336,7 +2336,7 @@ typedef enum ePSculptBrushType {
PSCULPT_BRUSH_TWIST = 6,
PSCULPT_BRUSH_RESET = 7,
PSCULPT_BRUSH_SELECT = 8,
- PSCULPT_BRUSH_RADIAL = 9,
+ PSCULPT_BRUSH_PUSH = 9,
PSCULPT_BRUSH_WRAP = 10,
/* this must equal PSculptSetitngs.brush array size */
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 67b2773a7f7..8e946aad2a4 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -1148,13 +1148,13 @@ static void rna_def_pose_sculpt(BlenderRNA *brna)
{0, "", 0, "Transform:", ""},
{PSCULPT_BRUSH_GRAB, "GRAB", 0, "Grab", "Move bones around as if affected by a force"},
+ {PSCULPT_BRUSH_PUSH, "PUSH", 0, "Push", "Reshape bendy bones by pushing their segments around"},
{PSCULPT_BRUSH_CURL, "CURL", 0, "Curl", "Rotate all bones along some local axis (e.g. finger curling)"},
{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
More information about the Bf-blender-cvs
mailing list