Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-05 07:45:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-05 07:45:32 +0400
commita512cac545dcb233e9487b327cf18da58bd61218 (patch)
tree795fb3fd90960f602f1eb671e992b6928f907d17 /source/blender/editors/sculpt_paint
parent84dc5c2992553270d267ac8c0e06defd1c78238e (diff)
code cleanup: move get_selected_defgroups into object_deform.c and make it behave like similar functions, also when drawing vertex weight colors, only call this function when multi-paint is enabled.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 4e246c61259..bf948bf9dd8 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -2160,7 +2160,6 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
float alpha;
float mval[2];
int use_vert_sel;
- char *defbase_sel;
const float pressure = RNA_float_get(itemptr, "pressure");
const float brush_size_pressure = BKE_brush_size_get(scene, brush) * (BKE_brush_use_size_pressure(scene, brush) ? pressure : 1.0f);
@@ -2194,12 +2193,13 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
+
/* *** setup WeightPaintInfo - pass onto do_weight_paint_vertex *** */
wpi.defbase_tot = wpd->defbase_tot;
- defbase_sel = MEM_mallocN(wpi.defbase_tot * sizeof(char), "wpi.defbase_sel");
- wpi.defbase_tot_sel = get_selected_defgroups(ob, defbase_sel, wpi.defbase_tot);
- wpi.defbase_sel = defbase_sel; /* so we can stay const */
- if (wpi.defbase_tot_sel == 0 && ob->actdef > 0) wpi.defbase_tot_sel = 1;
+ wpi.defbase_sel = BKE_objdef_selected_get(ob, wpi.defbase_tot, &wpi.defbase_tot_sel);
+ if (wpi.defbase_tot_sel == 0 && ob->actdef > 0) {
+ wpi.defbase_tot_sel = 1;
+ }
wpi.defbase_tot_unsel = wpi.defbase_tot - wpi.defbase_tot_sel;
wpi.vgroup_active = wpd->vgroup_active;