2.5 Paint:
[blender.git] / source / blender / editors / object / object_vgroup.c
index fb71fc091086ec3d4148d381b7885d83c4773cdb..154ab14df60100189a94fd1b11af1db93446af7d 100644 (file)
@@ -57,6 +57,7 @@
 #include "BKE_global.h"
 #include "BKE_lattice.h"
 #include "BKE_mesh.h"
+#include "BKE_paint.h"
 #include "BKE_utildefines.h"
 
 #include "RNA_access.h"
@@ -230,8 +231,8 @@ void duplicate_defgroup ( Object *ob )
        bDeformGroup *dg, *cdg;
        char name[32], s[32];
        MDeformWeight *org, *cpy;
-       MDeformVert *dvert, *dvert_array;
-       int i, idg, icdg, dvert_tot;
+       MDeformVert *dvert, *dvert_array=NULL;
+       int i, idg, icdg, dvert_tot=0;
 
        if (ob->type != OB_MESH && ob->type != OB_LATTICE)
                return;
@@ -353,9 +354,8 @@ static void del_defgroup_update_users(Object *ob, int id)
 void del_defgroup_in_object_mode ( Object *ob )
 {
        bDeformGroup *dg;
-       MDeformVert *dvert_array, *dvert;
-       
-       int i, e, dvert_tot;
+       MDeformVert *dvert, *dvert_array=NULL;
+       int i, e, dvert_tot=0;
 
        if ((!ob) || (ob->type != OB_MESH && ob->type != OB_LATTICE))
                return;
@@ -1029,11 +1029,11 @@ void vgroup_assign_with_menu(Scene *scene, Object *ob)
        switch (mode) {
                case 1: /* add to new group */
                        add_defgroup(ob);
-                       assign_verts_defgroup(ob, wp->brush->alpha);
+                       assign_verts_defgroup(ob, paint_brush(&wp->paint)->alpha);
                        BIF_undo_push("Assign to vertex group");
                        break;
                case 2: /* add to current group */
-                       assign_verts_defgroup(ob, wp->brush->alpha);
+                       assign_verts_defgroup(ob, paint_brush(&wp->paint)->alpha);
                        BIF_undo_push("Assign to vertex group");
                        break;
                case 3: /* remove from current group */