[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24498] trunk/blender/source/blender/ editors/sculpt_paint/sculpt.c: Fix #19368: sculpting with subsurf modifier applied did not update correct.

Brecht Van Lommel brecht at blender.org
Wed Nov 11 16:50:50 CET 2009


Revision: 24498
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24498
Author:   blendix
Date:     2009-11-11 16:50:49 +0100 (Wed, 11 Nov 2009)

Log Message:
-----------
Fix #19368: sculpting with subsurf modifier applied did not update correct.
Fix #19438: sculpt anchored + texture did not center texture correctly.

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	2009-11-11 15:29:22 UTC (rev 24497)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2009-11-11 15:50:49 UTC (rev 24498)
@@ -140,6 +140,7 @@
 	float flip;
 	float pressure;
 	float mouse[2];
+	float tex_mouse[2];
 
 	/* The rest is temporary storage that isn't saved as a property */
 
@@ -777,8 +778,8 @@
 			avg= get_texcache_pixel_bilinear(ss, ss->texcache_side*px/sx, ss->texcache_side*py/sy);
 		}
 		else if(tex->brush_map_mode == MTEX_MAP_MODE_FIXED) {
-			float fx= (point_2d[0] - ss->cache->mouse[0]) / bsize;
-			float fy= (point_2d[1] - ss->cache->mouse[1]) / bsize;
+			float fx= (point_2d[0] - ss->cache->tex_mouse[0]) / bsize;
+			float fy= (point_2d[1] - ss->cache->tex_mouse[1]) / bsize;
 
 			float angle= atan2(fy, fx) - rot;
 			float flen= sqrtf(fx*fx + fy*fy);
@@ -1096,7 +1097,7 @@
 	ModifierData *md;
 	
 	for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) {
-		if(md->mode & eModifierMode_Realtime && md->type != eModifierType_Multires)
+		if(modifier_isEnabled(md, eModifierMode_Realtime) && md->type != eModifierType_Multires)
 			return 1;
 	}
 	
@@ -1292,8 +1293,8 @@
 	RNA_float_get_array(op->ptr, "initial_mouse", cache->initial_mouse);
 	cache->depth = RNA_float_get(op->ptr, "depth");
 
-	cache->mouse[0] = cache->initial_mouse[0];
-	cache->mouse[1] = cache->initial_mouse[1];
+	copy_v2_v2(cache->mouse, cache->initial_mouse);
+	copy_v2_v2(cache->tex_mouse, cache->initial_mouse);
 
 	/* Truly temporary data that isn't stored in properties */
 
@@ -1371,6 +1372,9 @@
 	else
 		cache->radius = cache->initial_radius;
 
+	if(!(brush->flag & BRUSH_ANCHORED))
+		copy_v2_v2(cache->tex_mouse, cache->mouse);
+
 	if(brush->flag & BRUSH_ANCHORED) {
 		dx = cache->mouse[0] - cache->initial_mouse[0];
 		dy = cache->mouse[1] - cache->initial_mouse[1];
@@ -1527,6 +1531,9 @@
 		multires_mark_as_modified(ob);
 	}
 
+	if(sculpt_modifiers_active(ob))
+		DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+
 	ED_region_tag_redraw(ar);
 }
 





More information about the Bf-blender-cvs mailing list