Sculpt:
authorNicholas Bishop <nicholasbishop@gmail.com>
Fri, 30 Jan 2009 20:35:37 +0000 (20:35 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Fri, 30 Jan 2009 20:35:37 +0000 (20:35 +0000)
* Brought back axis locking
* Fixed flipping stroke add/sub with shift key at start of stroke
* Fixed a crash in stroke exec

source/blender/editors/sculpt/sculpt.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/makesdna/DNA_scene_types.h

index 974f514939153a9010f1eb84cd6a0ce486b0848e..be1fcc8fe8ba1299916a6e0efbbdc0dbbca59e7b 100644 (file)
@@ -275,11 +275,12 @@ static void sculpt_clip(StrokeCache *cache, float *co, const float val[3])
 
 static void sculpt_axislock(Sculpt *sd, float *co)
 {
-       if (sd->flags & (SCULPT_LOCK_X|SCULPT_LOCK_Y|SCULPT_LOCK_Z)) return;
-       /* XXX: if(G.vd->twmode == V3D_MANIP_LOCAL) { */
-       if(0) {
+       if(sd->flags == (SCULPT_LOCK_X|SCULPT_LOCK_Y|SCULPT_LOCK_Z))
+               return;
+
+       if(sd->session->cache->vc.v3d->twmode == V3D_MANIP_LOCAL) {
                float mat[3][3], imat[3][3];
-               /* XXX: Mat3CpyMat4(mat, OBACT->obmat); */
+               Mat3CpyMat4(mat, sd->session->cache->vc.obact->obmat);
                Mat3Inv(imat, mat);
                Mat3MulVecfl(mat, co);
                if (sd->flags & SCULPT_LOCK_X) co[0] = 0.0;
@@ -1576,9 +1577,8 @@ static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
        }
        RNA_END;
 
-       sculpt_cache_free(sd->session->cache);
-
        sculpt_flush_update(C);
+       sculpt_cache_free(sd->session->cache);
 
        sculpt_undo_push(C, sd);
 
index 81c87260af1c5aa7a52ad56dc702f05a7a6cd48e..550b5f95efc4592c686bf4efff7e51251d0a7311 100644 (file)
@@ -99,7 +99,8 @@ void view3d_keymap(wmWindowManager *wm)
        WM_keymap_verify_item(keymap, "VIEW3D_OT_vpaint", LEFTMOUSE, KM_PRESS, 0, 0);
        WM_keymap_verify_item(keymap, "VIEW3D_OT_wpaint", LEFTMOUSE, KM_PRESS, 0, 0);
 
-       WM_keymap_verify_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
        
        WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0);
        
index 9194e4d2632bcaacc87506360d0cb5a9616445cf..ac3f7e69399f01f474f686c01b59452700869bac 100644 (file)
@@ -812,16 +812,18 @@ typedef struct Scene {
 #define FFMPEG_MULTIPLEX_AUDIO  1
 #define FFMPEG_AUTOSPLIT_OUTPUT 2
 
-/* SculptData.flags */
-#define SCULPT_SYMM_X        1
-#define SCULPT_SYMM_Y        2
-#define SCULPT_SYMM_Z        4
-#define SCULPT_INPUT_SMOOTH  8
-#define SCULPT_DRAW_FAST    16
-#define SCULPT_DRAW_BRUSH   32
-#define SCULPT_LOCK_X       64
-#define SCULPT_LOCK_Y      128
-#define SCULPT_LOCK_Z      256
+/* Sculpt.flags */
+typedef enum SculptFlags {
+       SCULPT_SYMM_X = 1,
+       SCULPT_SYMM_Y = 2,
+       SCULPT_SYMM_Z = 4,
+       SCULPT_INPUT_SMOOTH = 8,
+       SCULPT_DRAW_FAST = 16,
+       SCULPT_DRAW_BRUSH = 32,
+       SCULPT_LOCK_X = 64,
+       SCULPT_LOCK_Y = 128,
+       SCULPT_LOCK_Z = 256
+} SculptFlags;
 
 /* toolsettings->imagepaint_flag */
 #define IMAGEPAINT_DRAWING                             1