Revision: 18608
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18608
Author:   nicholasbishop
Date:     2009-01-21 19:44:36 +0100 (Wed, 21 Jan 2009)

Log Message:
-----------
* Fixed a minor CMake error for WITH_YAFRAY option
* Removed two unused sculpt DNA fields
* Restored brush spacing option to sculpt

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c
    branches/blender2.5/blender/source/blender/editors/sculpt/stroke.c
    branches/blender2.5/blender/source/blender/makesdna/DNA_scene_types.h
    branches/blender2.5/blender/source/blender/render/CMakeLists.txt

Modified: branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c  
2009-01-21 15:45:31 UTC (rev 18607)
+++ branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c  
2009-01-21 18:44:36 UTC (rev 18608)
@@ -146,7 +146,7 @@
        ViewContext vc;
        bglMats *mats;
 
-       /* Mesh data can either come directly from a Mesh, or from a MultiresDM 
*/
+       /* Mesh data (not copied) can come either directly from a Mesh, or from 
a MultiresDM */
        int multires; /* Special handling for multires meshes */
        MVert *mvert;
        MFace *mface;
@@ -163,6 +163,7 @@
        float old_grab_location[3];
        int symmetry; /* Symmetry index between 0 and 7 */
        float view_normal[3], view_normal_symmetry[3];
+       int last_dot[2]; /* Last location of stroke application */
 } StrokeCache;
 
 typedef struct RectNode {
@@ -997,14 +998,23 @@
        const char symm = sd->flags & 7;
        int i;
 
-       VecCopyf(sd->session->cache->location, 
sd->session->cache->true_location);
-       VecCopyf(sd->session->cache->grab_delta_symmetry, 
sd->session->cache->grab_delta);
-       sd->session->cache->symmetry = 0;
+       /* Brush spacing: only apply dot if next dot is far enough away */
+       if(sd->brush->spacing > 0 && !(sd->brush->flag & BRUSH_ANCHORED) && 
!cache->first_time) {
+               int dx = cache->last_dot[0] - cache->mouse[0];
+               int dy = cache->last_dot[1] - cache->mouse[1];
+               if(sqrt(dx*dx+dy*dy) < sd->brush->spacing)
+                       return;
+       }
+       memcpy(cache->last_dot, cache->mouse, sizeof(int) * 2);
+
+       VecCopyf(cache->location, cache->true_location);
+       VecCopyf(cache->grab_delta_symmetry, cache->grab_delta);
+       cache->symmetry = 0;
        do_brush_action(sd, cache);
 
        for(i = 1; i <= symm; ++i) {
                if(symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 
&& i != 5))) {
-                       calc_brushdata_symm(sd->session->cache, i);
+                       calc_brushdata_symm(cache, i);
                        do_brush_action(sd, cache);
                }
        }
@@ -1542,9 +1552,7 @@
       using the current brush. ****/
 static int sculpt_brush_stroke_poll(bContext *C)
 {
-       // XXX: More to check for, of course
-
-       return G.f & G_SCULPTMODE;
+       return G.f & G_SCULPTMODE && CTX_wm_area(C)->spacetype == SPACE_VIEW3D;
 }
 
 static void sculpt_load_mats(bglMats *mats, ViewContext *vc)

Modified: branches/blender2.5/blender/source/blender/editors/sculpt/stroke.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sculpt/stroke.c  
2009-01-21 15:45:31 UTC (rev 18607)
+++ branches/blender2.5/blender/source/blender/editors/sculpt/stroke.c  
2009-01-21 18:44:36 UTC (rev 18608)
@@ -174,7 +174,7 @@
 /* If partial is nonzero, cuts off apply after that length has been processed 
*/
 static StrokePoint *sculpt_stroke_apply_generic(Sculpt *sd, SculptStroke 
*stroke, const int partial)
 {
-       const int sdspace = sd->spacing;
+       const int sdspace = 0; //XXX: sd->spacing;
        const short spacing = sdspace > 0 ? sdspace : 2;
        const int dots = sculpt_stroke_final_length(stroke) / spacing;
        int i;

Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesdna/DNA_scene_types.h       
2009-01-21 15:45:31 UTC (rev 18607)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_scene_types.h       
2009-01-21 18:44:36 UTC (rev 18608)
@@ -387,11 +387,10 @@
        float pivot[3];
        int flags;
        /* For the Brush Shape */
-       short texact, texnr, spacing;
-       char texrept, texsep, averaging;
+       short texact, texnr;
+       char texrept, texsep;
        /* Control tablet input */
        char tablet_size, tablet_strength;
-       char pad[5];
 } Sculpt;
 
 typedef struct VPaint {

Modified: branches/blender2.5/blender/source/blender/render/CMakeLists.txt
===================================================================
--- branches/blender2.5/blender/source/blender/render/CMakeLists.txt    
2009-01-21 15:45:31 UTC (rev 18607)
+++ branches/blender2.5/blender/source/blender/render/CMakeLists.txt    
2009-01-21 18:44:36 UTC (rev 18608)
@@ -34,7 +34,7 @@
 
 IF(NOT WITH_YAFRAY)
   ADD_DEFINITIONS(-DDISABLE_YAFRAY)
-ENDIF(WITH_YAFRAY)
+ENDIF(NOT WITH_YAFRAY)
 
 
 IF(WITH_OPENEXR)


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to