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>2005-12-01 22:04:57 +0300
committerTon Roosendaal <ton@blender.org>2005-12-01 22:04:57 +0300
commitc4a1d655aeb54abcb4bdf02491e002d69020a786 (patch)
tree733461cbe1559e14738c5b72f6716c77dcd656e2 /source/blender/src/transform_generics.c
parenta09fbc080dea64078a6cfb307a720194ee30e6db (diff)
True X-mirror mesh editing!
Set the option in EditMode, in 2nd mesh tools panel. It only works on transform options now (grab/rot/scale), and of course assumes a near- perfect symmetrical mesh. Mesh Object itself can be on any location though (and rotated etc).
Diffstat (limited to 'source/blender/src/transform_generics.c')
-rwxr-xr-xsource/blender/src/transform_generics.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c
index 0003ce71471..78aa7fe6122 100755
--- a/source/blender/src/transform_generics.c
+++ b/source/blender/src/transform_generics.c
@@ -57,6 +57,7 @@
#include "BIF_editarmature.h"
#include "BIF_editmesh.h"
#include "BIF_editsima.h"
+#include "BIF_meshtools.h"
#include "BKE_action.h"
#include "BKE_anim.h"
@@ -78,6 +79,7 @@
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
+#include "BLI_editVert.h"
#include "blendef.h"
@@ -174,6 +176,28 @@ static void clipMirrorModifier(TransInfo *t, Object *ob)
}
}
+/* assumes G.obedit set to mesh object */
+static void editmesh_apply_to_mirror(TransInfo *t)
+{
+ TransData *td = t->data;
+ EditVert *eve;
+ int i;
+
+ for(i = 0 ; i < t->total; i++, td++) {
+ if (td->flag & TD_NOACTION)
+ break;
+ if (td->loc==NULL)
+ break;
+
+ eve= td->tdmir;
+ if(eve) {
+ eve->co[0]= -td->loc[0];
+ eve->co[1]= td->loc[1];
+ eve->co[2]= td->loc[2];
+ }
+ }
+}
+
/* called for updating while transform acts, once per redraw */
void recalcData(TransInfo *t)
{
@@ -186,6 +210,9 @@ void recalcData(TransInfo *t)
if(t->state != TRANS_CANCEL)
clipMirrorModifier(t, G.obedit);
+ if(G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR)
+ editmesh_apply_to_mirror(t);
+
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */
recalc_editnormals();