Revision: 39712
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39712
Author:   nazgul
Date:     2011-08-26 16:38:23 +0000 (Fri, 26 Aug 2011)
Log Message:
-----------
Fix #28301: Sculpting a object with rotational have desface

Patch from Juha Maki-Kanto

- initgrabz was called with local space coord.
- Brush radiu was multiplying by 2.0 for grab and snake brushes.
  Not sure why this was needed. Made some tests and didn't notice
  any regressions without this multiplication.

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  2011-08-26 
15:16:27 UTC (rev 39711)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c  2011-08-26 
16:38:23 UTC (rev 39712)
@@ -2979,7 +2979,7 @@
                 SCULPT_TOOL_GRAB, SCULPT_TOOL_NUDGE,
                 SCULPT_TOOL_CLAY_TUBES, SCULPT_TOOL_SNAKE_HOOK,
                 SCULPT_TOOL_THUMB)) {
-               float grab_location[3], imat[4][4], delta[3];
+               float grab_location[3], imat[4][4], delta[3], loc[3];
 
                if(cache->first_time) {
                        copy_v3_v3(cache->orig_grab_location,
@@ -2989,10 +2989,8 @@
                        add_v3_v3(cache->true_location, cache->grab_delta);
 
                /* compute 3d coordinate at same z from original location + 
mouse */
-               initgrabz(cache->vc->rv3d,
-                         cache->orig_grab_location[0],
-                         cache->orig_grab_location[1],
-                         cache->orig_grab_location[2]);
+               mul_v3_m4v3(loc, ob->obmat, cache->orig_grab_location);
+               initgrabz(cache->vc->rv3d, loc[0], loc[1], loc[2]);
 
                ED_view3d_win_to_delta(cache->vc->ar, cache->mouse, 
grab_location);
 
@@ -3088,9 +3086,6 @@
                else {
                        cache->initial_radius= brush_unprojected_radius(brush);
                }
-
-               if (ELEM(brush->sculpt_tool, SCULPT_TOOL_GRAB, 
SCULPT_TOOL_SNAKE_HOOK))
-                       cache->initial_radius *= 2.0f;
        }
 
        if(brush_use_size_pressure(brush)) {

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

Reply via email to