From 936604e80104c8f93f5220294c6475a026578ba2 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Mon, 29 Dec 2014 11:01:10 +0100 Subject: Cleanup: get rid of sculpt minmax and reuse last stroke function (code did that anyway, just kept the result in an intermediate variable) --- source/blender/editors/include/ED_sculpt.h | 1 - source/blender/editors/sculpt_paint/sculpt.c | 17 ----------------- source/blender/editors/space_view3d/view3d_edit.c | 4 +++- 3 files changed, 3 insertions(+), 19 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h index 85ff9b5d246..60c7dc8b8c7 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 6df5c146b49..50587c87bea 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 8ee6c7d8df4..2f4502eddcd 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 { -- cgit v1.2.3