[Bf-blender-cvs] [936604e] master: Cleanup: get rid of sculpt minmax and reuse last stroke function (code did that anyway, just kept the result in an intermediate variable)

Antony Riakiotakis noreply at git.blender.org
Mon Dec 29 11:01:22 CET 2014


Commit: 936604e80104c8f93f5220294c6475a026578ba2
Author: Antony Riakiotakis
Date:   Mon Dec 29 11:01:10 2014 +0100
Branches: master
https://developer.blender.org/rB936604e80104c8f93f5220294c6475a026578ba2

Cleanup: get rid of sculpt minmax and reuse last stroke function (code
did that anyway, just kept the result in an intermediate variable)

===================================================================

M	source/blender/blenkernel/BKE_paint.h
M	source/blender/editors/include/ED_sculpt.h
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/space_view3d/view3d_edit.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 8cf6fdc..ff1305b 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -194,7 +194,6 @@ typedef struct SculptSession {
 
 	/* last paint/sculpt stroke location */
 	bool last_stroke_valid;
-	float last_stroke[3];
 
 	float average_stroke_accum[3];
 	int average_stroke_counter;
diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h
index 85ff9b5..60c7dc8 100644
--- a/source/blender/editors/include/ED_sculpt.h
+++ b/source/blender/editors/include/ED_sculpt.h
@@ -42,7 +42,6 @@ void ED_operatortypes_sculpt(void);
 void ED_sculpt_redraw_planes_get(float planes[4][4], struct ARegion *ar,
                                  struct RegionView3D *rv3d, struct Object *ob);
 void ED_sculpt_stroke_get_average(struct Object *ob, float stroke[3]);
-bool ED_sculpt_minmax(struct bContext *C, float min[3], float max[3]);
 int  ED_sculpt_mask_box_select(struct bContext *C, struct ViewContext *vc, const struct rcti *rect, bool select, bool extend);
 
 #endif /* __ED_SCULPT_H__ */
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 6df5c14..50587c8 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -126,22 +126,6 @@ void ED_sculpt_stroke_get_average(Object *ob, float stroke[3])
 	}
 }
 
-bool ED_sculpt_minmax(bContext *C, float min[3], float max[3])
-{
-	Object *ob = CTX_data_active_object(C);
-
-	if (ob && ob->sculpt && ob->sculpt->last_stroke_valid) {
-		copy_v3_v3(min, ob->sculpt->last_stroke);
-		copy_v3_v3(max, ob->sculpt->last_stroke);
-
-		return 1;
-	}
-	else {
-		return 0;
-	}
-}
-
-
 /* Check if there are any active modifiers in stack (used for flushing updates at enter/exit sculpt mode) */
 static bool sculpt_has_active_modifiers(Scene *scene, Object *ob)
 {
@@ -4366,7 +4350,6 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
 
 		/* update last stroke position */
 		ob->sculpt->last_stroke_valid = 1;
-		ED_sculpt_stroke_get_average(ob, ob->sculpt->last_stroke);
 
 		sculpt_cache_free(ss->cache);
 		ss->cache = NULL;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 8ee6c7d..2f4502e 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2976,7 +2976,9 @@ static int viewselected_exec(bContext *C, wmOperator *op)
 		ok = PE_minmax(scene, min, max);
 	}
 	else if (ob && (ob->mode & OB_MODE_SCULPT)) {
-		ok = ED_sculpt_minmax(C, min, max);
+		ED_sculpt_stroke_get_average(ob, min);
+		copy_v3_v3(max, min);
+		ok = true;
 		ok_dist = 0; /* don't zoom */
 	}
 	else {




More information about the Bf-blender-cvs mailing list