diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-16 07:10:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-16 07:10:15 +0400 |
commit | c00c0134e0f40748885a6bbd5ef8b4ffb7c34f09 (patch) | |
tree | f649494ce560f248505225b3d29972a58b1e91b5 /source/blender/editors/transform/transform_generics.c | |
parent | e6e265b2b59e02cc7816a2ed43471eca8bca0a62 (diff) | |
parent | 9f46ca46a6fcdacf53d95a61147272352154204b (diff) |
svn merge -r41847:41899 ^/trunk/blender
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 82b34861b27..d349dfac2fe 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1550,17 +1550,29 @@ void calculateCenter(TransInfo *t) /* EDIT MODE ACTIVE EDITMODE ELEMENT */ - if (t->obedit && t->obedit->type == OB_MESH) { - BMEditSelection ese; - BMEditMesh *em = ((Mesh*)t->obedit->data)->edit_btmesh; - - if (EDBM_get_actSelection(em, &ese)) { - EDBM_editselection_center(em, t->center, &ese); - calculateCenter2D(t); - break; + if (t->obedit) { + if (t->obedit && t->obedit->type == OB_MESH) { + BMEditSelection ese; + BMEditMesh *em = ((Mesh*)t->obedit->data)->edit_btmesh; + + if (EDBM_get_actSelection(em, &ese)) { + EDBM_editselection_center(em, t->center, &ese); + calculateCenter2D(t); + break; + } + } + else if (ELEM(t->obedit->type, OB_CURVE, OB_SURF)) { + float center[3]; + Curve *cu= (Curve *)t->obedit->data; + + if (ED_curve_actSelection(cu, center)) { + copy_v3_v3(t->center, center); + calculateCenter2D(t); + break; + } } } /* END EDIT MODE ACTIVE ELEMENT */ - + calculateCenterMedian(t); if((t->flag & (T_EDIT|T_POSE))==0) { |