some picky rna/variable renaming:
authorCampbell Barton <ideasman42@gmail.com>
Wed, 14 Sep 2011 08:45:12 +0000 (08:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 14 Sep 2011 08:45:12 +0000 (08:45 +0000)
 Mesh.wp_vert_sel --> use_paint_mask_vertex

source/blender/editors/armature/meshlaplacian.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/makesrna/intern/rna_mesh.c

index 127b2f4..4ce4a78 100644 (file)
@@ -659,24 +659,24 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
 
        // Jason
        MVert *mv = me->mvert;
-       int selectedVerts;
+       int use_vert_sel= FALSE;
 
        *err_str= NULL;
 
        /* count triangles and create mask */
-       if((me->editflag & ME_EDIT_PAINT_MASK) || (selectedVerts=(me->editflag & ME_EDIT_VERT_SEL)))
+       if((me->editflag & ME_EDIT_PAINT_MASK) || (use_vert_sel= ((me->editflag & ME_EDIT_VERT_SEL) != 0)))
                mask= MEM_callocN(sizeof(int)*me->totvert, "heat_bone_weighting mask");
 
        for(totface=0, a=0, mface=me->mface; a<me->totface; a++, mface++) {
                totface++;
                if(mface->v4) totface++;
                // Jason (added selectedVerts content for vertex mask, they used to just equal 1)
-               if(mask && ((mface->flag & ME_FACE_SEL) || selectedVerts)) {
-                       mask[mface->v1]= selectedVerts ? ((mv+mface->v1)->flag & 1): 1;
-                       mask[mface->v2]= selectedVerts ? ((mv+mface->v2)->flag & 1): 1;
-                       mask[mface->v3]= selectedVerts ? ((mv+mface->v3)->flag & 1): 1;
+               if(mask && ((mface->flag & ME_FACE_SEL) || use_vert_sel)) {
+                       mask[mface->v1]= use_vert_sel ? ((mv+mface->v1)->flag & 1): 1;
+                       mask[mface->v2]= use_vert_sel ? ((mv+mface->v2)->flag & 1): 1;
+                       mask[mface->v3]= use_vert_sel ? ((mv+mface->v3)->flag & 1): 1;
                        if(mface->v4)
-                               mask[mface->v4]= selectedVerts ? ((mv+mface->v4)->flag & 1): 1;
+                               mask[mface->v4]= use_vert_sel ? ((mv+mface->v4)->flag & 1): 1;
                }
        }
 
index 49ff4ac..7f78f25 100644 (file)
@@ -706,7 +706,7 @@ static void vgroup_normalize(Object *ob)
        // Jason
        Mesh *me = ob->data;
        MVert *mv = me->mvert;
-       int selectedVerts = me->editflag & ME_EDIT_VERT_SEL;
+       const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
 
@@ -719,7 +719,7 @@ static void vgroup_normalize(Object *ob)
 
                for(i = 0; i < dvert_tot; i++) {
                        // Jason
-                       if(selectedVerts && !((mv+i)->flag & SELECT)) {
+                       if(use_vert_sel && !((mv+i)->flag & SELECT)) {
                                continue;
                        }
 
@@ -733,7 +733,7 @@ static void vgroup_normalize(Object *ob)
                if(weight_max > 0.0f) {
                        for(i = 0; i < dvert_tot; i++) {
                                // Jason
-                               if(selectedVerts && !((mv+i)->flag & SELECT)) {
+                               if(use_vert_sel && !((mv+i)->flag & SELECT)) {
                                        continue;
                                }
 
@@ -1114,11 +1114,11 @@ static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength,
 
        Mesh *me = ob->data;
        MVert *mv = me->mvert;
-       int selectedVerts = me->editflag & ME_EDIT_VERT_SEL;
+       const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
        int *verts = NULL;
        for(i = 0; i < me->totvert && mv; i++, mv++) {
                // Jason
-               if(selectedVerts && (mv->flag & SELECT)) {
+               if(use_vert_sel && (mv->flag & SELECT)) {
                        
                        int count=0;
                        if((verts = getSurroundingVerts(me, i, &count))) {
@@ -1168,7 +1168,7 @@ static void vgroup_levels(Object *ob, float offset, float gain)
        // Jason
        Mesh *me = ob->data;
        MVert *mv = me->mvert;
-       int selectedVerts = me->editflag & ME_EDIT_VERT_SEL;
+       const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
        
@@ -1179,7 +1179,7 @@ static void vgroup_levels(Object *ob, float offset, float gain)
                
                for(i = 0; i < dvert_tot; i++) {
                        // Jason
-                       if(selectedVerts && !((mv+i)->flag & SELECT)) {
+                       if(use_vert_sel && !((mv+i)->flag & SELECT)) {
                                continue;
                        }
 
@@ -1207,7 +1207,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
        // Jason
        Mesh *me = ob->data;
        MVert *mv = me->mvert;
-       int selectedVerts = me->editflag & ME_EDIT_VERT_SEL;
+       const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
 
@@ -1219,7 +1219,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
                                float lock_iweight= 1.0f;
                                int j;
                                // Jason
-                               if(selectedVerts && !((mv+i)->flag & SELECT)) {
+                               if(use_vert_sel && !((mv+i)->flag & SELECT)) {
                                        continue;
                                }
 
@@ -1263,7 +1263,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
                        for(i = 0; i < dvert_tot; i++) {
                                int j;
                                // Jason
-                               if(selectedVerts && !((mv+i)->flag & SELECT)) {
+                               if(use_vert_sel && !((mv+i)->flag & SELECT)) {
                                        continue;
                                }
 
@@ -1332,7 +1332,7 @@ static void vgroup_invert(Object *ob, int auto_assign, int auto_remove)
        // Jason
        Mesh *me = ob->data;
        MVert *mv = me->mvert;
-       int selectedVerts = me->editflag & ME_EDIT_VERT_SEL;
+       const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
 
@@ -1344,7 +1344,7 @@ static void vgroup_invert(Object *ob, int auto_assign, int auto_remove)
 
                for(i = 0; i < dvert_tot; i++) {
                        // Jason
-                       if(selectedVerts && !((mv+i)->flag & SELECT)) {
+                       if(use_vert_sel && !((mv+i)->flag & SELECT)) {
                                continue;
                        }
                        dvert = dvert_array[i];
@@ -1462,7 +1462,7 @@ static void vgroup_clean(Object *ob, float eul, int keep_single)
        // Jason
        Mesh *me = ob->data;
        MVert *mv = me->mvert;
-       int selectedVerts = me->editflag & ME_EDIT_VERT_SEL;
+       const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
 
@@ -1473,7 +1473,7 @@ static void vgroup_clean(Object *ob, float eul, int keep_single)
 
                for(i = 0; i < dvert_tot; i++) {
                        // Jason
-                       if(selectedVerts && !((mv+i)->flag & SELECT)) {
+                       if(use_vert_sel && !((mv+i)->flag & SELECT)) {
                                continue;
                        }
                        dvert = dvert_array[i];
@@ -1500,7 +1500,7 @@ static void vgroup_clean_all(Object *ob, float eul, int keep_single)
        // Jason
        Mesh *me = ob->data;
        MVert *mv = me->mvert;
-       int selectedVerts = me->editflag & ME_EDIT_VERT_SEL;
+       const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
 
@@ -1508,7 +1508,7 @@ static void vgroup_clean_all(Object *ob, float eul, int keep_single)
                for(i = 0; i < dvert_tot; i++) {
                        int j;
                        // Jason
-                       if(selectedVerts && !((mv+i)->flag & SELECT)) {
+                       if(use_vert_sel && !((mv+i)->flag & SELECT)) {
                                continue;
                        }
 
index 584e88d..ec2e976 100644 (file)
@@ -400,14 +400,14 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
        int vgroup_mirror= -1;
        int selected;
        // Jason
-       int selectedVerts;
+       int use_vert_sel;
 
        me= ob->data;
        if(me==NULL || me->totface==0 || me->dvert==NULL || !me->mface) return;
        
        selected= (me->editflag & ME_EDIT_PAINT_MASK);
        // Jason
-       selectedVerts = (me->editflag & ME_EDIT_VERT_SEL);
+       use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        indexar= get_indexarray(me);
 
@@ -444,7 +444,7 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
                        for (i=0; i<3 || faceverts[i]; i++) {
                                if(me->dvert[faceverts[i]].flag) {
                                        // Jason
-                                       if(selectedVerts && ((me->mvert[faceverts[i]].flag & SELECT) == 0)) {
+                                       if(use_vert_sel && ((me->mvert[faceverts[i]].flag & SELECT) == 0)) {
                                                continue;
                                        }
 
@@ -1900,7 +1900,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        float mval[2], pressure;
        
        // Jason
-       int selectedVerts;
+       int use_vert_sel;
 
        /* cannot paint if there is no stroke data */
        if (wpd == NULL) {
@@ -1950,7 +1950,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
                }
        }
        // Jason
-       selectedVerts = (me->editflag & ME_EDIT_VERT_SEL);
+       use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
                        
        if((me->editflag & ME_EDIT_PAINT_MASK) && me->mface) {
                for(index=0; index<totindex; index++) {
@@ -1976,7 +1976,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
                if(indexar[index] && indexar[index]<=me->totface) {
                        MFace *mface= me->mface + (indexar[index]-1);
 
-                       if(selectedVerts) {
+                       if(use_vert_sel) {
                                me->dvert[mface->v1].flag = (me->mvert[mface->v1].flag & SELECT);
                                me->dvert[mface->v2].flag = (me->mvert[mface->v2].flag & SELECT);
                                me->dvert[mface->v3].flag = (me->mvert[mface->v3].flag & SELECT);
index b29373d..359f695 100644 (file)
@@ -505,7 +505,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                        // Jason
                        row= uiLayoutRow(layout, 1);
                        uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-                       uiItemR(row, &meshptr, "wp_vert_sel", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+                       uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
                }
        } else {
                const char *str_menu;
index a8b191c..1681700 100644 (file)
@@ -2096,9 +2096,9 @@ static void rna_def_mesh(BlenderRNA *brna)
        RNA_def_property_update(prop, 0, "rna_Mesh_update_facemask");
 
        /* Jason */
-       prop= RNA_def_property(srna, "wp_vert_sel", PROP_BOOLEAN, PROP_NONE);
+       prop= RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL);
-       RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting");
+       RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)");
        RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0);
        RNA_def_property_update(prop, 0, "rna_Mesh_update_vertmask");