Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2006-03-08 14:07:49 +0300
committerTon Roosendaal <ton@blender.org>2006-03-08 14:07:49 +0300
commit2db9b8fe7f423d4662af557f6144452610a8073d (patch)
treef20331f6521c48a993336dea0f69e0ded2497859 /source/blender/src/transform_conversions.c
parentd51a6020c898a1ceeaf1ad7e4b71026fba045602 (diff)
Quick feature: "Around Individual Centers" now works in editmode mesh, but
only in Face-Select mode. It then uses for rotate and scaling the face center itself as reference. Code uses a loop-in-loop to find the face that belongs to the vertex... means it will be slow with operations on 10k or more faces. Acceptable for now, will make it nicer later. :)
Diffstat (limited to 'source/blender/src/transform_conversions.c')
-rwxr-xr-xsource/blender/src/transform_conversions.c18
1 files changed, 18 insertions, 0 deletions
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