diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-13 18:56:41 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-13 18:56:41 +0400 |
commit | 12520b4e067b978b8c90f9f61813f7763d65f0af (patch) | |
tree | b89160158304a08c947d479a13e7a0b820ba6329 /source/blender/editors | |
parent | 8197361f5161561d136e032f53efadc2ad5f3e84 (diff) |
Fix #29873: transform with individual origins not working in edge select mode.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 21 |
2 files changed, 21 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1d1cd6fe01b..1d1b0b8c5c2 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2632,7 +2632,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) /* local constraint shouldn't alter center */ if ((t->around == V3D_LOCAL) && ( (t->flag & (T_OBJECT|T_POSE)) || - ((t->flag & T_EDIT) && (t->settings->selectmode & SCE_SELECT_FACE)) || + ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE))) || (t->obedit && t->obedit->type == OB_ARMATURE)) ) { @@ -2919,7 +2919,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* local constraint shouldn't alter center */ if (around == V3D_LOCAL) { if ( (t->flag & (T_OBJECT|T_POSE)) || - (t->settings->selectmode & SCE_SELECT_FACE) || + (t->settings->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE)) || (t->obedit && t->obedit->type == OB_ARMATURE)) { center = td->center; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index bc7514b4c9a..44dc909314a 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1926,6 +1926,19 @@ static void get_face_center(float *cent, EditMesh *em, EditVert *eve) } } +static void get_edge_center(float *cent, EditMesh *em, EditVert *eve) +{ + EditEdge *eed; + + for(eed= em->edges.first; eed; eed= eed->next) + if(eed->f & SELECT) + if(eed->v1==eve || eed->v2==eve) + break; + if(eed) { + mid_v3_v3v3(cent, eed->v1->co, eed->v2->co); + } +} + /* way to overwrite what data is edited with transform * static void VertsToTransData(TransData *td, EditVert *eve, BakeKey *key) */ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert *eve) @@ -1937,8 +1950,12 @@ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert td->loc = eve->co; copy_v3_v3(td->center, td->loc); - if(t->around==V3D_LOCAL && (em->selectmode & SCE_SELECT_FACE)) - get_face_center(td->center, em, eve); + if(t->around==V3D_LOCAL) { + if(em->selectmode & SCE_SELECT_FACE) + get_face_center(td->center, em, eve); + else if(em->selectmode & SCE_SELECT_EDGE) + get_edge_center(td->center, em, eve); + } copy_v3_v3(td->iloc, td->loc); // Setting normals |