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:
authorCampbell Barton <ideasman42@gmail.com>2008-04-15 13:20:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-04-15 13:20:13 +0400
commit2147e74bc5974424f17abbd52d57f0f6a6d0861a (patch)
treeff64d518964ff612d07ec5276644d25caacf45d8 /source/blender/src/sculptmode.c
parent6bb327badc63d65afe459e092059bf1d9c20b075 (diff)
made sculpt axis locking use local/global space (using the transform space)
also added some checks for sculpt mixing with other modes (was possible to mix sculpt+posemode)
Diffstat (limited to 'source/blender/src/sculptmode.c')
-rw-r--r--source/blender/src/sculptmode.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c
index 3b46d79513c..9e358d5df0c 100644
--- a/source/blender/src/sculptmode.c
+++ b/source/blender/src/sculptmode.c
@@ -422,9 +422,20 @@ void sculpt_axislock(float *co)
{
SculptData *sd = sculpt_data();
if (sd->axislock == AXISLOCK_X+AXISLOCK_Y+AXISLOCK_Z) return;
- if (sd->axislock & AXISLOCK_X) co[0] = 0.0;
- if (sd->axislock & AXISLOCK_Y) co[1] = 0.0;
- if (sd->axislock & AXISLOCK_Z) co[2] = 0.0;
+ if (G.vd->twmode == V3D_MANIP_LOCAL) {
+ float mat[3][3], imat[3][3];
+ Mat3CpyMat4(mat, OBACT->obmat);
+ Mat3Inv(imat, mat);
+ Mat3MulVecfl(mat, co);
+ if (sd->axislock & AXISLOCK_X) co[0] = 0.0;
+ if (sd->axislock & AXISLOCK_Y) co[1] = 0.0;
+ if (sd->axislock & AXISLOCK_Z) co[2] = 0.0;
+ Mat3MulVecfl(imat, co);
+ } else {
+ if (sd->axislock & AXISLOCK_X) co[0] = 0.0;
+ if (sd->axislock & AXISLOCK_Y) co[1] = 0.0;
+ if (sd->axislock & AXISLOCK_Z) co[2] = 0.0;
+ }
}
static void add_norm_if(const BrushAction *a, float out[3], float out_flip[3], const short no[3])