Revision: 56135
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56135
Author:   psy-fi
Date:     2013-04-18 12:03:27 +0000 (Thu, 18 Apr 2013)
Log Message:
-----------
Fix: view plane for sculpting did not work correctly for rotated
objects. Reuse the object space view vector. Also, minor cleanup, reused
cache values instead of requering.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c  2013-04-18 
11:44:00 UTC (rev 56134)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c  2013-04-18 
12:03:27 UTC (rev 56135)
@@ -1138,9 +1138,7 @@
 
        switch (brush->sculpt_plane) {
                case SCULPT_DISP_DIR_VIEW:
-                       ED_view3d_global_to_vector(ss->cache->vc->rv3d,
-                                                  
ss->cache->vc->rv3d->twmat[3],
-                                                  an);
+                       copy_v3_v3(an, ss->cache->true_view_normal);
                        break;
 
                case SCULPT_DISP_DIR_X:
@@ -2410,7 +2408,7 @@
        {
                switch (brush->sculpt_plane) {
                        case SCULPT_DISP_DIR_VIEW:
-                               ED_view3d_global_to_vector(ss->cache->vc->rv3d, 
ss->cache->vc->rv3d->twmat[3], an);
+                               copy_v3_v3(an, ss->cache->true_view_normal);
                                break;
 
                        case SCULPT_DISP_DIR_X:
@@ -3870,7 +3868,6 @@
 
 /* Initialize the stroke cache variants from operator properties */
 static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
-                                         struct PaintStroke *stroke,
                                          PointerRNA *ptr)
 {
        Scene *scene = CTX_data_scene(C);
@@ -3937,7 +3934,7 @@
                        }
                }
 
-               cache->radius = 
paint_calc_object_space_radius(paint_stroke_view_context(stroke),
+               cache->radius = paint_calc_object_space_radius(cache->vc,
                                                               
cache->true_location,
                                                               
ups->pixel_radius);
                cache->radius_squared = cache->radius * cache->radius;
@@ -4249,7 +4246,7 @@
                return 0;
 }
 
-static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *stroke, 
PointerRNA *itemptr)
+static void sculpt_stroke_update_step(bContext *C, struct PaintStroke 
*UNUSED(stroke), PointerRNA *itemptr)
 {
        UnifiedPaintSettings *ups = 
&CTX_data_tool_settings(C)->unified_paint_settings;
        Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
@@ -4258,7 +4255,7 @@
        const Brush *brush = BKE_paint_brush(&sd->paint);
        
        sculpt_stroke_modifiers_check(C, ob);
-       sculpt_update_cache_variants(C, sd, ob, stroke, itemptr);
+       sculpt_update_cache_variants(C, sd, ob, itemptr);
        sculpt_restore_mesh(sd, ob);
 
        BKE_pbvh_bmesh_detail_size_set(ss->pbvh,

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

Reply via email to