diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-10 20:55:15 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-11 14:07:19 +0300 |
commit | 309cd047ef46fcbd21b26b2509b40c55c5dab61e (patch) | |
tree | ec1873a13b391026bffc0110d84aafc855b648df /source/blender/editors/transform/transform_gizmo_3d.c | |
parent | ef18b672f5a57d86d264af0f875a37c6a9c6677a (diff) |
Sculpt: Transform tool
The sculpt mode transform tool applies the sculpt pivot transformation to all vertices, taking XYZ symmetry into account.
This commit also includes an operator to set the pivot point initial position.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5717
Diffstat (limited to 'source/blender/editors/transform/transform_gizmo_3d.c')
-rw-r--r-- | source/blender/editors/transform/transform_gizmo_3d.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 64fdbe5f8b1..bd8cf047db7 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -55,6 +55,7 @@ #include "BKE_scene.h" #include "BKE_workspace.h" #include "BKE_object.h" +#include "BKE_paint.h" #include "DEG_depsgraph.h" @@ -1056,7 +1057,13 @@ int ED_transform_calc_gizmo_stats(const bContext *C, } } else if (ob && (ob->mode & OB_MODE_ALL_PAINT)) { - /* pass */ + if (ob->mode & OB_MODE_SCULPT) { + totsel = 1; + calc_tw_center_with_matrix(tbounds, ob->sculpt->pivot_pos, false, ob->obmat); + mul_m4_v3(ob->obmat, tbounds->center); + mul_m4_v3(ob->obmat, tbounds->min); + mul_m4_v3(ob->obmat, tbounds->max); + } } else if (ob && ob->mode & OB_MODE_PARTICLE_EDIT) { PTCacheEdit *edit = PE_get_current(scene, ob); @@ -1168,6 +1175,10 @@ static void gizmo_prepare_mat(const bContext *C, if (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE)) { /* pass */ } + else if (ob->sculpt) { + SculptSession *ss = ob->sculpt; + copy_v3_v3(rv3d->twmat[3], ss->pivot_pos); + } else if (ob != NULL) { ED_object_calc_active_center(ob, false, rv3d->twmat[3]); } |