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:
authorMartin Poirier <theeth@yahoo.com>2006-12-20 01:25:07 +0300
committerMartin Poirier <theeth@yahoo.com>2006-12-20 01:25:07 +0300
commitf4a03182fbe1d3960c78e610e1659061f7e39482 (patch)
treec01c8850ae15571fb8b141c352183746840959d8 /source/blender/src/transform_constraints.c
parent83e3545f9e5d34552bc6813fd208a039ea6da9aa (diff)
=== Transform Snap ===
Draw a circle around the snapping point for visual aid. Different snapping target method, switchable in the 3d view header menu in the Transform menu. * Closest: Snaps the closest vertex to the point * Median: Snaps the median of the selection to the point * Center: Snaps the transform center to the point (this is different from median because you can use Cursor/Boundbox as center) Fix a bug with constraints/snap handling.
Diffstat (limited to 'source/blender/src/transform_constraints.c')
-rwxr-xr-xsource/blender/src/transform_constraints.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c
index be7a0bd2636..f67b3acff3a 100755
--- a/source/blender/src/transform_constraints.c
+++ b/source/blender/src/transform_constraints.c
@@ -241,24 +241,29 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo
VECCOPY(out, in);
if (!td && t->con.mode & CON_APPLY) {
Mat3MulVecfl(t->con.pmtx, out);
- if (getConstraintSpaceDimension(t) == 2) {
- if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) {
- planeProjection(t, in, out);
- }
- }
- else if (getConstraintSpaceDimension(t) == 1) {
- float c[3];
-
- if (t->con.mode & CON_AXIS0) {
- VECCOPY(c, t->con.mtx[0]);
- }
- else if (t->con.mode & CON_AXIS1) {
- VECCOPY(c, t->con.mtx[1]);
+
+ // With snap, a projection is alright, no need to correct for view alignment
+ if ((t->tsnap.status & SNAP_ON) == 0)
+ {
+ if (getConstraintSpaceDimension(t) == 2) {
+ if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) {
+ planeProjection(t, in, out);
+ }
}
- else if (t->con.mode & CON_AXIS2) {
- VECCOPY(c, t->con.mtx[2]);
+ else if (getConstraintSpaceDimension(t) == 1) {
+ float c[3];
+
+ if (t->con.mode & CON_AXIS0) {
+ VECCOPY(c, t->con.mtx[0]);
+ }
+ else if (t->con.mode & CON_AXIS1) {
+ VECCOPY(c, t->con.mtx[1]);
+ }
+ else if (t->con.mode & CON_AXIS2) {
+ VECCOPY(c, t->con.mtx[2]);
+ }
+ axisProjection(t, c, in, out);
}
- axisProjection(t, c, in, out);
}
postConstraintChecks(t, out, pvec);
}