diff options
-rwxr-xr-x | source/blender/src/transform.c | 23 | ||||
-rwxr-xr-x | source/blender/src/transform_conversions.c | 18 |
2 files changed, 37 insertions, 4 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index cd9a837d63c..202f5e8f6b2 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -1407,10 +1407,19 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { /* local constraint shouldn't alter center */ if (t->around == V3D_LOCAL) { if (t->flag & T_OBJECT) { - VECCOPY(center, td->center); // not supported in editmode yet + VECCOPY(center, td->center); + } + else if (t->flag & T_EDIT) { + + if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) { + VECCOPY(center, td->center); + } + else { + VECCOPY(center, t->center); + } } else { - VECCOPY(center, t->center); // Editmode needs to define center too... + VECCOPY(center, t->center); } } else { @@ -1789,8 +1798,14 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) /* local constraint shouldn't alter center */ if (t->around == V3D_LOCAL) { - if (t->flag & (T_OBJECT|T_POSE)) - VECCOPY(t->center, td->center); // not supported in editmode yet + if (t->flag & (T_OBJECT|T_POSE)) { + VECCOPY(t->center, td->center); + } + else { + if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) { + VECCOPY(t->center, td->center); + } + } } if (t->con.applyRot) { diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 5a861b57fef..b144771c2ff 100755 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -1376,11 +1376,29 @@ static void editmesh_set_connectivity_distance(int total, float *vectors, EditVe } } +/* loop-in-a-loop I know, but we need it! (ton) */ +static void get_face_center(float *cent, EditVert *eve) +{ + EditMesh *em = G.editMesh; + EditFace *efa; + + for(efa= em->faces.first; efa; efa= efa->next) + if(efa->f & SELECT) + if(efa->v1==eve || efa->v2==eve || efa->v3==eve || efa->v4==eve) + break; + if(efa) { + VECCOPY(cent, efa->cent); + } +} + static void VertsToTransData(TransData *td, EditVert *eve) { td->flag = 0; td->loc = eve->co; + VECCOPY(td->center, td->loc); + if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) + get_face_center(td->center, eve); VECCOPY(td->iloc, td->loc); // Setting normals |