[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30928] branches/soc-2010-jwilkins/source/ blender/editors/sculpt_paint: * Fix: some sculpt tools were not working with new wrap texture mapping mode

Jason Wilkins Jason.A.Wilkins at gmail.com
Sun Aug 1 02:01:51 CEST 2010


Revision: 30928
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30928
Author:   jwilkins
Date:     2010-08-01 02:01:51 +0200 (Sun, 01 Aug 2010)

Log Message:
-----------
* Fix: some sculpt tools were not working with new wrap texture mapping mode
* Fix: anchored stroke cursor was not drawing properly

Modified Paths:
--------------
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c

Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c	2010-07-31 19:26:21 UTC (rev 30927)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c	2010-08-01 00:01:51 UTC (rev 30928)
@@ -1399,30 +1399,32 @@
 				const float outer_radius=  sd->draw_anchored ? 1.0f/thickness * unprojected_radius : unprojected_radius;
 				Object *ob= CTX_data_active_object(C);
 
+				float *location0 = sd->draw_anchored ? sd->anchored_location : location;
+
 				if (!sd->sculpting && brush->flag & BRUSH_TEXTURE_OVERLAY) {
 					if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_FIXED)
-						ED_draw_fixed_overlay_on_surface(modelview, projection, ob->size, viewport, location, outer_radius, sd, brush, &vc, t, b, l, r, angle);
+						ED_draw_fixed_overlay_on_surface(modelview, projection, ob->size, viewport, location0, outer_radius, sd, brush, &vc, t, b, l, r, angle);
 					else if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_WRAP) {
 						float up_vec[3]= {0,1,0};
 
 						// if raking, up is the direction of the mouse (grab delta),
 						if (brush->flag & BRUSH_RAKE) {
 							negate_v3_v3(up_vec, rake_delta);
-							ED_draw_wrapped_overlay_on_surface(modelview, projection, ob->size, viewport, location, outer_radius, sd, brush, &vc, 0, up_vec);
+							ED_draw_wrapped_overlay_on_surface(modelview, projection, ob->size, viewport, location0, outer_radius, sd, brush, &vc, 0, up_vec);
 						}
 						// otherwise, it is the view up vector
 						else {
 							mul_mat3_m4_v3(vc.rv3d->viewinv, up_vec);
-							ED_draw_wrapped_overlay_on_surface(modelview, projection, ob->size, viewport, location, outer_radius, sd, brush, &vc, angle, up_vec);
+							ED_draw_wrapped_overlay_on_surface(modelview, projection, ob->size, viewport, location0, outer_radius, sd, brush, &vc, angle, up_vec);
 						}
 					}
 				}
 
-				ED_draw_on_surface_cursor(modelview, projection, col, alpha, ob->size, viewport, location, inner_radius, outer_radius, brush_size(brush));
+				ED_draw_on_surface_cursor(modelview, projection, col, alpha, ob->size, viewport, location0, inner_radius, outer_radius, brush_size(brush));
 
 				{
 					float scale = 1.0f/(20.0f*(brush_size(brush)/100.0f));
-					draw_symmetric_brush_dots(sd, sd->draw_anchored ? sd->anchored_location : location, col, modelview, projection, viewport,scale*inner_radius, brush_size(brush) >= 8);
+					draw_symmetric_brush_dots(sd, sd->draw_anchored ? sd->anchored_location : location0, col, modelview, projection, viewport,scale*inner_radius, brush_size(brush) >= 8);
 				}
 			}
 #endif

Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c	2010-07-31 19:26:21 UTC (rev 30927)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c	2010-08-01 00:01:51 UTC (rev 30928)
@@ -1292,10 +1292,11 @@
 	count = (int)(bstrength*max_iterations);
 	last  = max_iterations*(bstrength - count*fract);
 
+	set_brush_local_mat(sd, ss, brush, nodes, totnode, NULL);
+
 	for(iteration = 0; iteration <= count; ++iteration) {
 		#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
 		for(n=0; n<totnode; n++) {
-			set_brush_local_mat(sd, ss, brush, NULL, 0, 0);
 
 			if(ss->multires) {
 				do_multires_smooth_brush(sd, ss, nodes[n], iteration != count ? 1.0f : last);
@@ -1428,7 +1429,7 @@
 	float bstrength= ss->cache->bstrength;
 	int n;
 
-	set_brush_local_mat(sd, ss, brush, NULL, 0, NULL);
+	set_brush_local_mat(sd, ss, brush, nodes, totnode, NULL);
 
 	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
 	for(n=0; n<totnode; n++) {
@@ -1467,7 +1468,7 @@
 	if (brush->normal_weight > 0)
 		calc_sculpt_normal(sd, ss, an, nodes, totnode);
 
-	set_brush_local_mat(sd, ss, brush, NULL, 0, brush->normal_weight > 0 ? an : NULL);
+	set_brush_local_mat(sd, ss, brush, nodes, totnode, brush->normal_weight > 0 ? an : NULL);
 
 	copy_v3_v3(grab_delta, ss->cache->grab_delta_symmetry);
 
@@ -1563,7 +1564,7 @@
 	if (brush->normal_weight > 0)
 		calc_sculpt_normal(sd, ss, an, nodes, totnode);
 
-	set_brush_local_mat(sd, ss, brush, NULL, 0, brush->normal_weight > 0 ? an : NULL);
+	set_brush_local_mat(sd, ss, brush, nodes, totnode, brush->normal_weight > 0 ? an : NULL);
 
 	copy_v3_v3(grab_delta, ss->cache->grab_delta_symmetry);
 
@@ -1778,7 +1779,7 @@
 	float bstrength= ss->cache->bstrength;
 	int n;
 
-	set_brush_local_mat(sd, ss, brush, NULL, 0, NULL);
+	set_brush_local_mat(sd, ss, brush, nodes, totnode, NULL);
 
 	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
 	for(n=0; n<totnode; n++) {
@@ -2231,7 +2232,7 @@
 
 	calc_sculpt_plane(sd, ss, nodes, totnode, sn, fc);
 
-	set_brush_local_mat(sd, ss, brush, NULL, 0, an);
+	set_brush_local_mat(sd, ss, brush, NULL, 0, sn);
 
 	if (brush->sculpt_plane != SCULPT_DISP_DIR_AREA || (brush->flag & BRUSH_ORIGINAL_NORMAL))
 		calc_area_normal(sd, ss, an, nodes, totnode);





More information about the Bf-blender-cvs mailing list