Split do_weight_paint_vertex() to isolate the simple case.
authorJason Hays <jason_hays22@mymail.eku.edu>
Sun, 18 Sep 2011 17:10:28 +0000 (17:10 +0000)
committerJason Hays <jason_hays22@mymail.eku.edu>
Sun, 18 Sep 2011 17:10:28 +0000 (17:10 +0000)
Added a tool-tip to the "fix deforms" op.

Removed code markers:
"Radish"

32 files changed:
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/imbuf/intern/md5.c
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c

index 17249de97173e076c4ba005793e5e3714c0fae18..ad5fa13126facdd68ecf511dfb5806df9a1c54d9 100644 (file)
@@ -59,7 +59,7 @@ void paint_brush_set(struct Paint *paint, struct Brush *br);
  * Texture paint could be removed since selected faces are not used
  * however hiding faces is useful */
 int paint_facesel_test(struct Object *ob);
-/* Radish */
+
 int paint_vertsel_test(struct Object *ob);
 /* Session data (mode-specific) */
 
index 06c1c4163b71ca6c120615e11a0bfe9d071474ed..46f59c327aa1f8011d6ab4a5ce73e95d00c486a5 100644 (file)
@@ -40,7 +40,7 @@
 #include "DNA_cloth_types.h"
 #include "DNA_key_types.h"
 #include "DNA_meshdata_types.h"
-/* Radish */
+
 #include "DNA_armature_types.h"
 
 #include "DNA_object_types.h"
@@ -1689,12 +1689,12 @@ static void calc_weightpaint_vert_color(Object *ob, ColorBand *coba, int vert, u
        float colf[4], input = 0.0f;
        int i;
 
-       /* Radish */
+       
        int make_black= FALSE;
 
        if (me->dvert) {
                if ((selected > 1) && (draw_flag & CALC_WP_MULTIPAINT)) {
-                       /* Radish */
+                       
                        int was_a_nonzero= FALSE;
                        for (i=0; i<me->dvert[vert].totweight; i++) {
                                /* in multipaint, get the average if auto normalize is inactive
@@ -1761,7 +1761,7 @@ static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag)
        unsigned char *wtcol;
        int i;
 
-       /* Radish */
+       
        int defbase_len = BLI_countlist(&ob->defbase);
        char *defbase_sel = MEM_mallocN(defbase_len * sizeof(char), __func__);
        int selected = get_selected_defgroups(ob, defbase_sel, defbase_len);
@@ -1777,7 +1777,7 @@ static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag)
                if (mf->v4)
                        calc_weightpaint_vert_color(ob, coba, mf->v4, &wtcol[(i*4 + 3)*4], defbase_sel, selected, unselected, draw_flag);
        }
-       /* Radish */
+       
        MEM_freeN(defbase_sel);
 
        CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_ASSIGN, wtcol, dm->numFaceData);
@@ -1807,7 +1807,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
        int has_multires = mmd != NULL, multires_applied = 0;
        int sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt;
 
-       /* Radish */
+       
        int draw_flag= ((scene->toolsettings->multipaint ? CALC_WP_MULTIPAINT : 0) |
                        (scene->toolsettings->auto_normalize ? CALC_WP_AUTO_NORMALIZE : 0));
 
@@ -1990,7 +1990,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                                }
 
                                if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT))
-                                       add_weight_mcol_dm(ob, dm, draw_flag); /* Radish */
+                                       add_weight_mcol_dm(ob, dm, draw_flag); 
 
                                /* Constructive modifiers need to have an origindex
                                 * otherwise they wont have anywhere to copy the data from.
@@ -2102,7 +2102,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                CDDM_calc_normals(finaldm);
 
                if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT))
-                       add_weight_mcol_dm(ob, finaldm, draw_flag);/* Radish */
+                       add_weight_mcol_dm(ob, finaldm, draw_flag);
        } else if(dm) {
                finaldm = dm;
        } else {
@@ -2114,7 +2114,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                }
 
                if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT))
-                       add_weight_mcol_dm(ob, finaldm, draw_flag);/* Radish */
+                       add_weight_mcol_dm(ob, finaldm, draw_flag);
        }
 
        /* add an orco layer if needed */
@@ -2387,7 +2387,7 @@ static void clear_mesh_caches(Object *ob)
 static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask)
 {
        Object *obact = scene->basact?scene->basact->object:NULL;
-       int editing = paint_facesel_test(ob) || paint_vertsel_test(ob);/* Radish: paint_vertsel_test */
+       int editing = paint_facesel_test(ob) || paint_vertsel_test(ob);/* paint_vertsel_test */
        /* weight paint and face select need original indices because of selection buffer drawing */
        int needMapping = (ob==obact) && (editing || (ob->mode & (OB_MODE_WEIGHT_PAINT|OB_MODE_VERTEX_PAINT)));
 
index a4908294b4b09a4ad5a9dbd63ac2bd4e4e5f8bb7..b3b7d07f2cf11e5e64d435dadd99b164bd0fde11 100644 (file)
@@ -2465,7 +2465,7 @@ void where_is_pose (Scene *scene, Object *ob)
        }
 }
 
-/* Radish */
+
 /* Returns total selected vgroups */
 int get_selected_defgroups(Object *ob, char *dg_selection, int defbase_len)
 {
index dac3630f3969eec6804a36582bab5e2546b36419..ddeb42d608e0c8e0432152c53eb28c3c54467b5a 100644 (file)
@@ -96,7 +96,7 @@ int paint_facesel_test(Object *ob)
 {
        return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)));
 }
-/* Radish */
+
 int paint_vertsel_test(Object *ob)
 {
        return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) && (ob->mode & OB_MODE_WEIGHT_PAINT));
index 82a2436a01043869c0e48e5ebd1237fad5c67110..afdbbccff2cfa7b11bab86ca1ba750ca4c931f85 100644 (file)
@@ -2870,7 +2870,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
        PARTICLE_P;
        
        float birthtime = 0.0, dietime = 0.0;
-       float t, time = 0.0, dfra = 1.0 /* frs_sec = sim->scene->r.frs_sec*/ /*UNUSED*/;
+       float t, time = 0.0, dfra = 1.0 /* frs_sec = sim->scene->r.frs_sec*/ /*UNUSED*/;
        float col[4] = {0.5f, 0.5f, 0.5f, 1.0f};
        float prev_tangent[3] = {0.0f, 0.0f, 0.0f}, hairmat[4][4];
        float rotmat[3][3];
index 7ab8d29680d20813eb5a4b086661d9fde8b34207..d023889c89a3940293370377626b49ca67d02390 100644 (file)
@@ -5066,7 +5066,7 @@ void POSE_OT_select_inverse(wmOperatorType *ot)
 static int pose_de_select_all_exec(bContext *C, wmOperator *op)
 {
        int action = RNA_enum_get(op->ptr, "action");
-       //Radish
+       
        Object *ob = NULL;
        Scene *scene= CTX_data_scene(C);
        int multipaint = scene->toolsettings->multipaint;
@@ -5099,7 +5099,7 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, NULL);
-       /* Radish */
+       
        if(multipaint) {
                ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
                DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
index 20cf91e870a3ded7771450dbacaad9920cf55109..ad1d1f23c2b31df948956d6eb0b2a8ddf260795e 100644 (file)
@@ -657,7 +657,7 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
        int *vertsflipped = NULL, *mask= NULL;
        int a, totface, j, bbone, firstsegment, lastsegment;
 
-       /* Radish */
+       
        MVert *mv = me->mvert;
        int use_vert_sel= FALSE;
 
@@ -670,7 +670,7 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
        for(totface=0, a=0, mface=me->mface; a<me->totface; a++, mface++) {
                totface++;
                if(mface->v4) totface++;
-               /* Radish (added selectedVerts content for vertex mask, they used to just equal 1) */
+               /*  (added selectedVerts content for vertex mask, they used to just equal 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;
index 93f8c3fb0032c68ac55829110793974a2f4242fb..9709979ff6a912dd911021c74077f0be37897047 100644 (file)
@@ -122,7 +122,7 @@ int                 EM_texFaceCheck(struct EditMesh *em);
 int                    EM_vertColorCheck(struct EditMesh *em);
 
 void           undo_push_mesh(struct bContext *C, const char *name);
-/* Radish */
+
 void           paintvert_flush_flags(struct Object *ob);
 void           paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags);
 
index 985130bb97ff2b8f91f5d87fc192185b191a05df..47984af5951958f99597de93544977eefc28bea2 100644 (file)
@@ -216,7 +216,7 @@ void ED_view3d_project_float(struct ARegion *a, const float vec[3], float adr[2]
 void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, struct rctf *viewborder_r, short do_shift);
 
 /* drawobject.c iterators */
-/* Radish */
+
 void mesh_obmode_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct MVert *mv, int x, int y, int index), void *userData, int clipVerts);
 
 void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts);
index 7661fa5994b95db7b4a2b976f6a1d4aecf200900..d9e9ef8730d653154d2957671838879daeedefe4 100644 (file)
@@ -3778,7 +3778,7 @@ static int ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx,
        Scopes *scopes = (Scopes *)but->poin;
        /* rcti rect; */
        int changed= 1;
-       float /* dx, */ dy /* yfac=1.f */; /* UNUSED */
+       float /* dx, */ dy /* yfac=1.f */; /* UNUSED */
 
        /* rect.xmin= but->x1; rect.xmax= but->x2; */
        /* rect.ymin= but->y1; rect.ymax= but->y2; */
index 9e5cda43b7485ab5b41eb11fd1cbe1f39469b692..7c4b182d8596b761e090072eac2c3bcff9c46e07 100644 (file)
@@ -2124,7 +2124,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
                //uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
                uiBlockSetEmboss(block, UI_EMBOSS);
        }
-       /* Radish: I need the RNA struct for vertex groups */
+       /* I need the RNA struct for vertex groups */
        else if(itemptr->type == &RNA_VertexGroup) {
                bDeformGroup *dg= (bDeformGroup *)itemptr->data;
                uiItemL(sub, name, icon);
index a868ee947128828ee50d229e829e8e5a7f122583..f74d419151ea50930b2ade65e854732e6b001416 100644 (file)
@@ -1960,7 +1960,7 @@ void em_setup_viewcontext(bContext *C, ViewContext *vc)
 }
 
 
-/* Radish (similar to void paintface_flush_flags(Object *ob))
+/*  (similar to void paintface_flush_flags(Object *ob))
  * copy the vertex flags, most importantly selection from the mesh to the final derived mesh,
  * use in object mode when selecting vertices (while painting) */
 void paintvert_flush_flags(Object *ob)
@@ -1992,7 +1992,7 @@ void paintvert_flush_flags(Object *ob)
                }
        }
 }
-/* Radish note: if the caller passes FALSE to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
+/*  note: if the caller passes FALSE to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
 void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
 {
        Mesh *me;
index b0bf7915d7c09a93ea1ce6f22428c228508614d6..f7c2f895ba575cd3d6c808b41e249d17d060cb84 100644 (file)
@@ -266,7 +266,7 @@ int EM_mask_init_backbuf_border(ViewContext *vc, int mcords[][2], short tot, sho
        /* method in use for face selecting too */
        if(vc->obedit==NULL) {
                if(paint_facesel_test(vc->obact));
-               else if(paint_vertsel_test(vc->obact));//Radish
+               else if(paint_vertsel_test(vc->obact));
                else return 0;
        }
        else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;
@@ -329,7 +329,7 @@ int EM_init_backbuf_circle(ViewContext *vc, short xs, short ys, short rads)
        /* method in use for face selecting too */
        if(vc->obedit==NULL) {
                if(paint_facesel_test(vc->obact));
-               else if (paint_vertsel_test(vc->obact));//Radish
+               else if (paint_vertsel_test(vc->obact));
                else return 0;
        }
        else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;
index bc086283cb91a4fb27a28b029ca9a678125b69f0..6ba17076c23a24aa18adb0fb633acac87e361fae 100644 (file)
@@ -200,7 +200,7 @@ void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_normalize(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_normalize_all(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_levels(struct wmOperatorType *ot);
-/* Radish */
+
 void OBJECT_OT_vertex_group_lock(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_group_fix(struct wmOperatorType *ot);
 
index f4cb976bac6d36750875cefd5aea0d90bb399ea2..a150b7469017297b07d37f3af991b1ad81be256c 100644 (file)
@@ -174,7 +174,7 @@ void ED_operatortypes_object(void)
        WM_operatortype_append(OBJECT_OT_vertex_group_copy);
        WM_operatortype_append(OBJECT_OT_vertex_group_normalize);
        WM_operatortype_append(OBJECT_OT_vertex_group_normalize_all);
-       /* Radish */
+       
        WM_operatortype_append(OBJECT_OT_vertex_group_lock);
        WM_operatortype_append(OBJECT_OT_vertex_group_fix);
 
index d96a667857225ad1dfa0d395ed20e6c512b206d6..5401b637646da46208aa09214c3801e09c6803e6 100644 (file)
@@ -61,7 +61,7 @@
 #include "BKE_global.h"
 #include "BKE_mesh.h"
 #include "BKE_report.h"
-#include "BKE_DerivedMesh.h"//Radish
+#include "BKE_DerivedMesh.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
@@ -703,7 +703,7 @@ static void vgroup_normalize(Object *ob)
        MDeformWeight *dw;
        MDeformVert *dvert, **dvert_array=NULL;
        int i, def_nr, dvert_tot=0;
-       /* Radish */
+       
        Mesh *me = ob->data;
        MVert *mvert = me->mvert;
        const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
@@ -718,7 +718,7 @@ static void vgroup_normalize(Object *ob)
                def_nr= ob->actdef-1;
 
                for(i = 0; i < dvert_tot; i++) {
-                       /* Radish */
+                       
                        if(use_vert_sel && !((mvert+i)->flag & SELECT)) {
                                continue;
                        }
@@ -732,7 +732,7 @@ static void vgroup_normalize(Object *ob)
 
                if(weight_max > 0.0f) {
                        for(i = 0; i < dvert_tot; i++) {
-                               /* Radish */
+                               
                                if(use_vert_sel && !((mvert+i)->flag & SELECT)) {
                                        continue;
                                }
@@ -751,7 +751,7 @@ static void vgroup_normalize(Object *ob)
 
        if (dvert_array) MEM_freeN(dvert_array);
 }
-/* Radish */
+
 /* This adds the indices of vertices to a list if they are not already present
 It returns the number that it added (0-2)
 It relies on verts having -1 for unassigned indices
@@ -780,7 +780,7 @@ static int tryToAddVerts(int *verts, int length, int a, int b) {
        }
        return added;
 }
-//Radish
+
 /* This finds all of the vertices connected to vert by an edge
 and returns an array of indices of size count
 
@@ -844,7 +844,7 @@ static int* getSurroundingVerts(Mesh *me, int vert, int *count) {
        MEM_freeN(tverts);
        return verts;
 }
-/* Radish */
+
 /* get a single point in space by averaging a point cloud (vectors of size 3)
 coord is the place the average is stored, points is the point cloud, count is the number of points in the cloud
 */
@@ -856,7 +856,7 @@ static void getSingleCoordinate(MVert *points, int count, float coord[3]) {
        }
        mul_v3_fl(coord, 1.0f/count);
 }
-/* Radish */
+
 /* find the closest point on a plane to another point and store it in dst */
 /* coord is a point on the plane */
 /* point is the point that you want the nearest of */
@@ -873,7 +873,7 @@ static void getNearestPointOnPlane(const float norm[3], const float coord[3], co
        dst_r[1] = point[1] - (norm[1] * dotprod);
        dst_r[2] = point[2] - (norm[2] * dotprod);
 }
-/* Radish */
+
 /* distance of two vectors a and b of size length */
 static float distance(float* a, float *b, int length) {
        int i;
@@ -883,7 +883,7 @@ static float distance(float* a, float *b, int length) {
        }
        return sqrt(sum);
 }
-/* Radish */
+
 /* given a plane and a start and end position,
 compute the amount of vertical distance relative to the plane and store it in dists,
 then get the horizontal and vertical change and store them in changes
@@ -904,7 +904,7 @@ static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, f
        // horizontal change
        changes[index][1] = distance(projA, projB, 3);
 }
-/* Radish */
+
 // I need the derived mesh to be forgotten so the positions are recalculated with weight changes (see dm_deform_recalc)
 static void dm_deform_clear(DerivedMesh *dm, Object *ob) {
        if(ob->derivedDeform && (ob->derivedDeform)==dm) {
@@ -917,12 +917,12 @@ static void dm_deform_clear(DerivedMesh *dm, Object *ob) {
                dm->release(dm);
        }
 }
-/* Radish */
+
 // recalculate the deformation
 static DerivedMesh* dm_deform_recalc(Scene *scene, Object *ob) {
        return mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
 }
-/* Radish */
+
 /* by changing nonzero weights, try to move a vertex in me->mverts with index 'index' to distToBe distance away from the provided plane
 strength can change distToBe so that it moves towards distToBe by that percentage
 cp changes how much the weights are adjusted to check the distance
@@ -1094,7 +1094,7 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
        MEM_freeN(dists);
        MEM_freeN(dwIndices);
 }
-/* Radish */
+
 /* this is used to try to smooth a surface by only adjusting the nonzero weights of a vertex 
 but it could be used to raise or lower an existing 'bump.' */
 static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength, float cp)
@@ -1106,7 +1106,7 @@ static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength,
        const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
        int *verts = NULL;
        for(i = 0; i < me->totvert && mvert; i++, mvert++) {
-               /* Radish */
+               
                if(use_vert_sel && (mvert->flag & SELECT)) {
                        
                        int count=0;
@@ -1153,7 +1153,7 @@ static void vgroup_levels(Object *ob, float offset, float gain)
        MDeformWeight *dw;
        MDeformVert *dvert, **dvert_array=NULL;
        int i, def_nr, dvert_tot=0;
-       /* Radish */
+       
        Mesh *me = ob->data;
        MVert *mvert = me->mvert;
        const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
@@ -1166,7 +1166,7 @@ static void vgroup_levels(Object *ob, float offset, float gain)
                def_nr= ob->actdef-1;
                
                for(i = 0; i < dvert_tot; i++) {
-                       /* Radish */
+                       
                        if(use_vert_sel && !((mvert+i)->flag & SELECT)) {
                                continue;
                        }
@@ -1192,7 +1192,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
        int i, dvert_tot=0;
        float tot_weight;
 
-       /* Radish */
+       
        Mesh *me = ob->data;
        MVert *mvert = me->mvert;
        const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
@@ -1206,7 +1206,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
                        for(i = 0; i < dvert_tot; i++) {
                                float lock_iweight= 1.0f;
                                int j;
-                               /* Radish */
+                               
                                if(use_vert_sel && !((mvert+i)->flag & SELECT)) {
                                        continue;
                                }
@@ -1250,7 +1250,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
                else {
                        for(i = 0; i < dvert_tot; i++) {
                                int j;
-                               /* Radish */
+                               
                                if(use_vert_sel && !((mvert+i)->flag & SELECT)) {
                                        continue;
                                }
@@ -1281,7 +1281,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
        if (dvert_array) MEM_freeN(dvert_array);
 }
 
-/* Radish */
+
 static void vgroup_lock_all(Object *ob, int action)
 {
        bDeformGroup *dg;
@@ -1317,7 +1317,7 @@ static void vgroup_invert(Object *ob, int auto_assign, int auto_remove)
        MDeformWeight *dw;
        MDeformVert *dvert, **dvert_array=NULL;
        int i, def_nr, dvert_tot=0;
-       /* Radish */
+       
        Mesh *me = ob->data;
        MVert *mvert = me->mvert;
        const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
@@ -1331,7 +1331,7 @@ static void vgroup_invert(Object *ob, int auto_assign, int auto_remove)
 
 
                for(i = 0; i < dvert_tot; i++) {
-                       /* Radish */
+                       
                        if(use_vert_sel && !((mvert+i)->flag & SELECT)) {
                                continue;
                        }
@@ -1447,7 +1447,7 @@ static void vgroup_clean(Object *ob, float eul, int keep_single)
        MDeformWeight *dw;
        MDeformVert *dvert, **dvert_array=NULL;
        int i, def_nr, dvert_tot=0;
-       /* Radish */
+       
        Mesh *me = ob->data;
        MVert *mvert = me->mvert;
        const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
@@ -1460,7 +1460,7 @@ static void vgroup_clean(Object *ob, float eul, int keep_single)
                def_nr= ob->actdef-1;
 
                for(i = 0; i < dvert_tot; i++) {
-                       /* Radish */
+                       
                        if(use_vert_sel && !((mvert+i)->flag & SELECT)) {
                                continue;
                        }
@@ -1485,7 +1485,7 @@ static void vgroup_clean_all(Object *ob, float eul, int keep_single)
        MDeformWeight *dw;
        MDeformVert *dvert, **dvert_array=NULL;
        int i, dvert_tot=0;
-       /* Radish */
+       
        Mesh *me = ob->data;
        MVert *mvert = me->mvert;
        const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
@@ -1495,7 +1495,7 @@ static void vgroup_clean_all(Object *ob, float eul, int keep_single)
        if(dvert_array) {
                for(i = 0; i < dvert_tot; i++) {
                        int j;
-                       /* Radish */
+                       
                        if(use_vert_sel && !((mvert+i)->flag & SELECT)) {
                                continue;
                        }
@@ -2319,7 +2319,7 @@ void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot)
 
        RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", "Keep the values of the active group while normalizing others.");
 }
-/* Radish */
+
 static int vertex_group_fix_exec(bContext *C, wmOperator *op)
 {
        Object *ob= CTX_data_active_object(C);
@@ -2355,6 +2355,7 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
        /* identifiers */
        ot->name= "Fix Vertex Group Deform";
        ot->idname= "OBJECT_OT_vertex_group_fix";
+       ot->description= "Modify the position of selected vertices by changing only their respective groups' weights (this tool may be slow for many vertices).";
        
        /* api callbacks */
        ot->poll= vertex_group_poll;
@@ -2367,7 +2368,7 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
        RNA_def_float(ot->srna, "cp", 1.0f, 0.05f, FLT_MAX, "Change Sensitivity", "Changes the amount weights are altered with each iteration: lower values are slower.", 0.05f, 1.f);
 }
 
-/* Radish */
+
 static int vertex_group_lock_exec(bContext *C, wmOperator *op)
 {
        Object *ob= CTX_data_active_object(C);
@@ -2378,7 +2379,7 @@ static int vertex_group_lock_exec(bContext *C, wmOperator *op)
 
        return OPERATOR_FINISHED;
 }
-/* Radish */
+
 void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
 {
        /* identifiers */
index b116d86335e9878162a58673c6c53f86d69f5b18..3b656338fd40edd68819a4087be0f5e845abb2d8 100644 (file)
@@ -5408,12 +5408,12 @@ int facemask_paint_poll(bContext *C)
 {
        return paint_facesel_test(CTX_data_active_object(C));
 }
-/* Radish */
+
 int vert_paint_poll(bContext *C)
 {
        return paint_vertsel_test(CTX_data_active_object(C));
 }
-/* Radish */
+
 int mask_paint_poll(bContext *C)
 {
        return paint_facesel_test(CTX_data_active_object(C)) || paint_vertsel_test(CTX_data_active_object(C));
index c70835907dc5c48449eecdbc93ae83d70278b7cc..f671b7b171303896a242d8f233ab1629fd2beac6 100644 (file)
@@ -121,7 +121,7 @@ void PAINT_OT_face_select_all(struct wmOperatorType *ot);
 void PAINT_OT_face_select_inverse(struct wmOperatorType *ot);
 void PAINT_OT_face_select_hide(struct wmOperatorType *ot);
 void PAINT_OT_face_select_reveal(struct wmOperatorType *ot);
-/* Radish */
+
 void PAINT_OT_vert_select_all(struct wmOperatorType *ot);
 void PAINT_OT_vert_select_inverse(struct wmOperatorType *ot);
 int vert_paint_poll(struct bContext *C);
index 6708c40e6aec021f1ed9d3bdfba21957eeabbbbc..287d204115c763fc714c707a67038cf7e9eb398b 100644 (file)
@@ -373,7 +373,7 @@ void ED_operatortypes_paint(void)
        WM_operatortype_append(PAINT_OT_weight_sample);
        WM_operatortype_append(PAINT_OT_weight_sample_group);
 
-       /* Radish, vertex selection */
+       /* vertex selection */
        WM_operatortype_append(PAINT_OT_vert_select_all);
        WM_operatortype_append(PAINT_OT_vert_select_inverse);
 
@@ -611,7 +611,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
 
        WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0);
 
-       /* Radish */
+       
        /*Weight paint's Vertex Selection Mode */
        keymap= WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0);
        keymap->poll= vert_paint_poll;
index e76d21a9eec51038d2bb719cfa283ade3acab132..fe749011b982865c47810c02aafb16f41ff24843 100644 (file)
@@ -358,7 +358,7 @@ void PAINT_OT_face_select_all(wmOperatorType *ot)
        WM_operator_properties_select_all(ot);
 }
 
-/* Radish */
+
 static int vert_select_all_exec(bContext *C, wmOperator *op)
 {
        Object *ob= CTX_data_active_object(C);
@@ -367,7 +367,7 @@ static int vert_select_all_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-/* Radish */
+
 void PAINT_OT_vert_select_all(wmOperatorType *ot)
 {
        ot->name= "Vertex Selection";
@@ -381,7 +381,7 @@ void PAINT_OT_vert_select_all(wmOperatorType *ot)
 
        WM_operator_properties_select_all(ot);
 }
-/* Radish */
+
 static int vert_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
 {
        Object *ob= CTX_data_active_object(C);
@@ -389,7 +389,7 @@ static int vert_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
        ED_region_tag_redraw(CTX_wm_region(C));
        return OPERATOR_FINISHED;
 }
-/* Radish */
+
 void PAINT_OT_vert_select_inverse(wmOperatorType *ot)
 {
        ot->name= "Vertex Select Invert";
index f8874fe10b709f3ccaf4d52091e6d9951fbfd55b..6898febf09279eb7e001e902d3b8c1efb67dcf36 100644 (file)
@@ -399,14 +399,14 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
        unsigned char i;
        int vgroup_mirror= -1;
        int selected;
-       /* Radish */
+       
        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);
-       /* Radish */
+       
        use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        indexar= get_indexarray(me);
@@ -443,7 +443,7 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
                        faceverts[3]= mface->v4;
                        for (i=0; i<3 || faceverts[i]; i++) {
                                if(!me->dvert[faceverts[i]].flag) {
-                                       /* Radish */
+                                       
                                        if(use_vert_sel && ((me->mvert[faceverts[i]].flag & SELECT) == 0)) {
                                                continue;
                                        }
@@ -840,8 +840,10 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float
                if (dw->weight > paintval)
                        dw->weight = paintval*alpha + dw->weight*(1.0f-alpha);
        }
-       /* Radish delay clamping until the end so multi-paint can function when the active group is at the limits */
-       //CLAMP(dw->weight, 0.0f, 1.0f);
+       /*  delay clamping until the end so multi-paint can function when the active group is at the limits */
+       if(multipaint == FALSE) {
+               CLAMP(dw->weight, 0.0f, 1.0f);
+       }
        
        /* if no spray, clip result with orig weight & orig alpha */
        if((wp->flag & VP_SPRAY)==0) {
@@ -868,8 +870,9 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float
                        else
                                testw = uw->weight;
                }
-               //CLAMP(testw, 0.0f, 1.0f);
-               if(!multipaint) {
+
+               if(multipaint == FALSE) {
+                       CLAMP(testw, 0.0f, 1.0f);
                        if( testw<uw->weight ) {
                                if(dw->weight < testw) dw->weight= testw;
                                else if(dw->weight > uw->weight) dw->weight= uw->weight;
@@ -1111,7 +1114,7 @@ static void do_weight_paint_auto_normalize(MDeformVert *dvert,
 }
 #endif
 
-/* Radish: the active group should be involved in auto normalize */
+/* the active group should be involved in auto normalize */
 static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, char *map)
 {
 //     MDeformWeight *dw = dvert->dw;
@@ -1140,7 +1143,7 @@ static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, char *
                }
        }
 }
-/* Radish */
+
 /*
 See if the current deform vertex has a locked group
 */
@@ -1154,7 +1157,7 @@ static char has_locked_group(MDeformVert *dvert, char *flags)
        }
        return FALSE;
 }
-/* Radish
+/* 
  * gen_lck_flags gets the status of "flag" for each bDeformGroup
  *in ob->defbase and returns an array containing them
  */
@@ -1177,7 +1180,7 @@ static char *gen_lck_flags(Object* ob, int defbase_len)
        MEM_freeN(flags);
        return NULL;
 }
-/* Radish */
+
 static int has_locked_group_selected(int defbase_len, char *defbase_sel, char *flags) {
        int i;
        for(i = 0; i < defbase_len; i++) {
@@ -1188,7 +1191,7 @@ static int has_locked_group_selected(int defbase_len, char *defbase_sel, char *f
        return FALSE;
 }
 
-/* Radish */
+
 #if 0 /* UNUSED */
 static int has_unselected_unlocked_bone_group(int defbase_len, char *defbase_sel, int selected, char *flags, char *bone_groups) {
        int i;
@@ -1204,7 +1207,7 @@ static int has_unselected_unlocked_bone_group(int defbase_len, char *defbase_sel
 }
 #endif
 
-/* Radish */
+
 static void multipaint_selection(MDeformVert *dvert, float change, char *defbase_sel, int defbase_len) {
        int i;
        MDeformWeight *dw;
@@ -1216,7 +1219,7 @@ static void multipaint_selection(MDeformVert *dvert, float change, char *defbase
                        if(dw && dw->weight) {
                                val = dw->weight * change;
                                if(val > 1) {
-                                       /* Radish TODO: when the change is reduced, you need to recheck the earlier values to make sure they are not 0 (precision error) */
+                                       /*  TODO: when the change is reduced, you need to recheck the earlier values to make sure they are not 0 (precision error) */
                                        change = 1.0f/dw->weight;
                                }
                                // the value should never reach zero while multi-painting if it was nonzero beforehand
@@ -1236,7 +1239,7 @@ static void multipaint_selection(MDeformVert *dvert, float change, char *defbase
                }
        }
 }
-/* Radish */
+
 // move all change onto valid, unchanged groups.  If there is change left over, then return it.
 // assumes there are valid groups to shift weight onto
 static float redistribute_change(MDeformVert *ndv, char *change_status, int changeme, int changeto, char *validmap, float totchange, float total_valid) {
@@ -1282,7 +1285,7 @@ static float redistribute_change(MDeformVert *ndv, char *change_status, int chan
        // left overs
        return totchange;
 }
-/* Radish */
+
 // observe the changes made to the weights of groups.
 // make sure all locked groups on the vertex have the same deformation
 // by moving the changes made to groups onto other unlocked groups
@@ -1406,7 +1409,7 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_len, c
 
        MEM_freeN(change_status);
 }
-/* Radish */
+
 // multi-paint's initial, potential change is computed here based on the user's stroke
 static float get_mp_change(MDeformVert *odv, char *defbase_sel, float brush_change) {
        float selwsum = 0.0f;
@@ -1422,7 +1425,7 @@ static float get_mp_change(MDeformVert *odv, char *defbase_sel, float brush_chan
        }
        return 0.0f;
 }
-/* Radish */
+
 // change the weights back to the wv's weights
 // it assumes you already have the correct pointer index
 static void reset_to_prev(MDeformVert *wv, MDeformVert *dv) {
@@ -1440,14 +1443,14 @@ static void reset_to_prev(MDeformVert *wv, MDeformVert *dv) {
                }
        }
 }
-/* Radish */
+
 static void clamp_weights(MDeformVert *dvert) {
        int i;
        for (i = 0; i < dvert->totweight; i++) {
                CLAMP((dvert->dw+i)->weight, 0.0f, 1.0f);
        }
 }
-/* Radish */
+
 /* fresh start to make multi-paint and locking modular */
 /* returns TRUE if it thinks you need to reset the weights due to normalizing while multi-painting */
 static int apply_mp_lcks_normalize(Mesh *me, int index, MDeformWeight *dw, MDeformWeight *tdw, int defbase_len, float change, float oldChange, float oldw, float neww, char *defbase_sel, int selected, char *bone_groups, char *validmap, char *flags, int multipaint) {
@@ -1506,7 +1509,7 @@ static int get_first_selected_nonzero_weight(MDeformVert *dvert, char *defbase_s
        }
        return -1;
 }
-/* Radish */
+
 static char *wpaint_make_validmap(Object *ob);
 
 static void do_weight_paint_vertex(VPaint *wp, Object *ob, int index, 
@@ -1514,26 +1517,16 @@ static void do_weight_paint_vertex(VPaint *wp, Object *ob, int index,
                                   int vgroup_mirror, char *validmap, int multipaint)
 {
        Mesh *me= ob->data;
-       //                                              Radish: tdw, tuw
-       MDeformWeight *dw, *uw, *tdw = NULL, *tuw;
+       
+       MDeformWeight *dw, *uw;
        int vgroup= ob->actdef-1;
        
-       /* Radish */
        char *flags;
-       char *bone_groups;
+       
        char *defbase_sel;
        int selected;
-       float oldw;
-       float neww;
-       float testw=0;
        int defbase_len;
-       float change = 0;
-       float oldChange = 0;
-       int i;
-       MDeformVert dv= {NULL};
 
-       // Need to know which groups are bone groups
-       bone_groups = validmap ? validmap : wpaint_make_validmap(ob);
 
        if(wp->flag & VP_ONLYVGROUP) {
                dw= defvert_find_index(me->dvert+index, vgroup);
@@ -1545,99 +1538,129 @@ static void do_weight_paint_vertex(VPaint *wp, Object *ob, int index,
        }
        if(dw==NULL || uw==NULL)
                return;
-       /* Radish */
+
        flags = gen_lck_flags(ob, defbase_len = BLI_countlist(&ob->defbase));
        defbase_sel = MEM_mallocN(defbase_len * sizeof(char), "dg_selected_flags");
        selected = get_selected_defgroups(ob, defbase_sel, defbase_len);
        if(!selected && ob->actdef) {
                selected = 1;
        }
-       
-       oldw = dw->weight;
-       wpaint_blend(wp, dw, uw, alpha, paintweight, flip, multipaint && selected >1);
-       neww = dw->weight;
-       dw->weight = oldw;
-       
-       // setup multi-paint
-       if(selected > 1 && multipaint) {
-               dv.dw= MEM_dupallocN((me->dvert+index)->dw);
-               dv.flag = me->dvert[index].flag;
-               dv.totweight = (me->dvert+index)->totweight;
-               tdw = dw;
-               tuw = uw;
-               change = get_mp_change(wp->wpaint_prev+index, defbase_sel, neww-oldw);
-               if(change) {
-                       if(!tdw->weight) {
-                               i = get_first_selected_nonzero_weight(me->dvert+index, defbase_sel);
-                               if(i>=0) {
-                                       tdw = ((me->dvert+index)->dw+i);
-                                       tuw = defvert_verify_index(wp->wpaint_prev+index, tdw->def_nr);
-                               }
-                               else {
-                                       change = 0;
-                               }
+       // TODO: De-duplicate the simple weight paint
+       // If there are no locks or multipaint, then there is no need to run the more complicated checks
+       if((multipaint == FALSE || selected <= 1) && (flags == NULL || has_locked_group(me->dvert+index, flags) == FALSE)) {
+               wpaint_blend(wp, dw, uw, alpha, paintweight, flip, FALSE);
+               do_weight_paint_auto_normalize_all_groups(me->dvert+index, validmap);
+
+               if(me->editflag & ME_EDIT_MIRROR_X) {   /* x mirror painting */
+                       int j= mesh_get_x_mirror_vert(ob, index);
+                       if(j>=0) {
+                               /* copy, not paint again */
+                               uw= defvert_verify_index(me->dvert+j, (vgroup_mirror != -1) ? vgroup_mirror : vgroup);
+                                       
+                               uw->weight= dw->weight;
+
+                               do_weight_paint_auto_normalize_all_groups(me->dvert+j, validmap);
                        }
-                       if(change && tuw->weight && tuw->weight * change) {
-                               if(tdw->weight != tuw->weight) {
-                                       oldChange = tdw->weight/tuw->weight;
-                                       testw = tuw->weight*change;
-                                       if( testw > tuw->weight ) {
-                                               if(change > oldChange) {
-                                                       // reset the weights and use the new change
-                                                       reset_to_prev(wp->wpaint_prev+index, me->dvert+index);
-                                               }
-                                               else {
-                                                       // the old change was more significant,
-                                                       // so set the change to 0 so that it will not do another multi-paint
-                                                       change = 0;
-                                               }
+               }
+       } else {
+               // use locks and/or multipaint
+               // Need to know which groups are bone groups
+               char *bone_groups = validmap ? validmap : wpaint_make_validmap(ob);
+
+               float oldw;
+               float neww;
+               float testw=0;
+               float change = 0;
+               float oldChange = 0;
+               int i;
+               MDeformWeight *tdw = NULL, *tuw;
+               MDeformVert dv= {NULL};
+
+               oldw = dw->weight;
+               wpaint_blend(wp, dw, uw, alpha, paintweight, flip, multipaint && selected >1);
+               neww = dw->weight;
+               dw->weight = oldw;
+               
+               // setup multi-paint
+               if(selected > 1 && multipaint) {
+                       dv.dw= MEM_dupallocN((me->dvert+index)->dw);
+                       dv.flag = me->dvert[index].flag;
+                       dv.totweight = (me->dvert+index)->totweight;
+                       tdw = dw;
+                       tuw = uw;
+                       change = get_mp_change(wp->wpaint_prev+index, defbase_sel, neww-oldw);
+                       if(change) {
+                               if(!tdw->weight) {
+                                       i = get_first_selected_nonzero_weight(me->dvert+index, defbase_sel);
+                                       if(i>=0) {
+                                               tdw = ((me->dvert+index)->dw+i);
+                                               tuw = defvert_verify_index(wp->wpaint_prev+index, tdw->def_nr);
                                        }
                                        else {
-                                               if(change < oldChange) {
-                                                       reset_to_prev(wp->wpaint_prev+index, me->dvert+index);
+                                               change = 0;
+                                       }
+                               }
+                               if(change && tuw->weight && tuw->weight * change) {
+                                       if(tdw->weight != tuw->weight) {
+                                               oldChange = tdw->weight/tuw->weight;
+                                               testw = tuw->weight*change;
+                                               if( testw > tuw->weight ) {
+                                                       if(change > oldChange) {
+                                                               // reset the weights and use the new change
+                                                               reset_to_prev(wp->wpaint_prev+index, me->dvert+index);
+                                                       }
+                                                       else {
+                                                               // the old change was more significant,
+                                                               // so set the change to 0 so that it will not do another multi-paint
+                                                               change = 0;
+                                                       }
                                                }
                                                else {
-                                                       change = 0;
+                                                       if(change < oldChange) {
+                                                               reset_to_prev(wp->wpaint_prev+index, me->dvert+index);
+                                                       }
+                                                       else {
+                                                               change = 0;
+                                                       }
                                                }
                                        }
                                }
+                               else {
+                                       change = 0;
+                               }
                        }
-                       else {
-                               change = 0;
+               }
+               
+               if(apply_mp_lcks_normalize(me, index, dw, tdw, defbase_len, change, oldChange, oldw, neww, defbase_sel, selected, bone_groups, validmap, flags, multipaint)) {
+                       reset_to_prev(&dv, me->dvert+index);
+                       change = 0;
+                       oldChange = 0;
+               }
+               if(dv.dw) {
+                       MEM_freeN(dv.dw);
+               }
+               // dvert may have been altered greatly
+               dw = defvert_find_index(me->dvert+index, vgroup);
+
+               if(me->editflag & ME_EDIT_MIRROR_X) {   /* x mirror painting */
+                       int j= mesh_get_x_mirror_vert(ob, index);
+                       if(j>=0) {
+                               /* copy, not paint again */
+                               uw= defvert_verify_index(me->dvert+j, (vgroup_mirror != -1) ? vgroup_mirror : vgroup);
+                               
+                               //uw->weight= dw->weight;
+                               
+                               apply_mp_lcks_normalize(me, j, uw, tdw, defbase_len, change, oldChange, oldw, neww, defbase_sel, selected, bone_groups, validmap, flags, multipaint);
                        }
                }
-       }
-       /* Radish */
-       if(apply_mp_lcks_normalize(me, index, dw, tdw, defbase_len, change, oldChange, oldw, neww, defbase_sel, selected, bone_groups, validmap, flags, multipaint)) {
-               reset_to_prev(&dv, me->dvert+index);
-               change = 0;
-               oldChange = 0;
-       }
-       if(dv.dw) {
-               MEM_freeN(dv.dw);
-       }
-       // dvert may have been altered greatly
-       dw = defvert_find_index(me->dvert+index, vgroup);
-
-       if(me->editflag & ME_EDIT_MIRROR_X) {   /* x mirror painting */
-               int j= mesh_get_x_mirror_vert(ob, index);
-               if(j>=0) {
-                       /* copy, not paint again */
-                       uw= defvert_verify_index(me->dvert+j, (vgroup_mirror != -1) ? vgroup_mirror : vgroup);
-                       /* Radish */
-                       //uw->weight= dw->weight;
-                       /* Radish */
-                       apply_mp_lcks_normalize(me, j, uw, tdw, defbase_len, change, oldChange, oldw, neww, defbase_sel, selected, bone_groups, validmap, flags, multipaint);
+               if(!validmap) {
+                       MEM_freeN(bone_groups);
                }
        }
-       /* Radish */
        if(flags) {
                MEM_freeN(flags);
        }
        MEM_freeN(defbase_sel);
-       if(!validmap) {
-               MEM_freeN(bone_groups);
-       }
 }
 
 
@@ -1894,7 +1917,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        float alpha;
        float mval[2], pressure;
        
-       /* Radish */
+       
        int use_vert_sel;
 
        /* cannot paint if there is no stroke data */
@@ -1923,7 +1946,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
                        
        swap_m4m4(wpd->vc.rv3d->persmat, mat);
 
-       /* Radish */
+       
        use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
 
        /* which faces are involved */
@@ -2167,7 +2190,7 @@ void PAINT_OT_weight_set(wmOperatorType *ot)
 
        /* api callbacks */
        ot->exec= weight_paint_set_exec;
-       ot->poll= mask_paint_poll; /* Radish, it was facemask_paint_poll */
+       ot->poll= mask_paint_poll; /* it was facemask_paint_poll */
 
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
index 44adca688cc0df66ad2fc14f61217cdaa06b6aeb..a0269d5e0df539c55d6b198cf423c30134911458 100644 (file)
@@ -86,7 +86,7 @@
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
 
-#include "GPU_buffers.h"/* Radish */
+#include "GPU_buffers.h"
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
 
@@ -1741,7 +1741,7 @@ void mesh_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, EditVe
 
        dm->release(dm);
 }
-/* Radish */
+
 static void mesh_obmode_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
 {
        struct { void (*func)(void *userData, MVert *mv, int x, int y, int index); void *userData; ViewContext vc; int clipVerts; } *data = userData;
@@ -1762,7 +1762,7 @@ static void mesh_obmode_foreachScreenVert__mapFunc(void *userData, int index, fl
                        data->func(data->userData, mv, s[0], s[1], index);
        }
 }
-/* Radish */
+
 void mesh_obmode_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, MVert *mv, int x, int y, int index), void *userData, int clipVerts)
 {
        struct { void (*func)(void *userData, MVert *mv, int x, int y, int index); void *userData; ViewContext vc; int clipVerts; } data;
@@ -1781,7 +1781,7 @@ void mesh_obmode_foreachScreenVert(ViewContext *vc, void (*func)(void *userData,
        dm->release(dm);
 }
 
-/* Radish draw callback */
+/*  draw callback */
 static void drawSelectedVertices__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
 {
        MVert *mv = userData;
@@ -1800,7 +1800,7 @@ static void drawSelectedVertices__mapFunc(void *userData, int index, float *co,
                glVertex3fv(co);
        }
 }
-/* Radish */
+
 static void drawSelectedVertices(DerivedMesh *dm, Mesh *me) {
        glBegin(GL_POINTS);
        dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, me->mvert);
@@ -2990,7 +2990,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
                        bglPolygonOffset(rv3d->dist, 0.0);
                }
        }
-       /* Radish */
+       
        if(paint_vertsel_test(ob)) {
                
                glColor3f(0.0f, 0.0f, 0.0f);
@@ -6590,7 +6590,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
 }
 
 /* ***************** BACKBUF SEL (BBS) ********* */
-/* Radish */
+
 static void bbs_obmode_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
 {
        struct {void* offset; MVert *mvert;} *data = userData;
@@ -6602,7 +6602,7 @@ static void bbs_obmode_mesh_verts__mapFunc(void *userData, int index, float *co,
                bglVertex3fv(co);
        }
 }
-/* Radish */
+
 static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset)
 {
        struct {void* offset; struct MVert *mvert;} data;
@@ -6714,7 +6714,7 @@ static int bbs_mesh_solid_hide__setDrawOpts(void *userData, int index, int *UNUS
                return 0;
        }
 }
-/* Radish */
+
 // must have called WM_set_framebuffer_index_color beforehand
 static int bbs_mesh_solid_hide2__setDrawOpts(void *userData, int index, int *UNUSED(drawSmooth_r))
 {
index 3399ab4e2607604021ff242d717f0c1d6a45d578..c46b6b6d70bad632ef90118eb9201c2a466c8a4e 100644 (file)
@@ -371,7 +371,7 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
        keymap= WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
        
-       /* Radish */
+       
        keymap= WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
index 6429730c4298d4341d8166304aa7a4e8a3dc46f6..1b6bd7ed0e76faad3c790d8c765acd54ca02e022 100644 (file)
@@ -503,7 +503,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) {
                        uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
                } else {
-                       /* Radish */
+                       
                        row= uiLayoutRow(layout, 1);
                        uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
                        uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
index e9719e8e8687b53aa42972431ee57db862e2fe1d..77823c2d163b873ab86f4dc36ce054ba6efc9096 100644 (file)
@@ -54,7 +54,7 @@
 #include "BLI_linklist.h"
 #include "BLI_utildefines.h"
 
-/* Radish--vertex box select */
+/* vertex box select */
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
 #include "BKE_global.h"
@@ -203,7 +203,7 @@ static void EM_backbuf_checkAndSelectFaces(EditMesh *em, int select)
        }
 }
 
-/* Radish */
+
 /* object mode, EM_ prefix is confusing here, rename? */
 static void EM_backbuf_checkAndSelectVerts_obmode(Mesh *me, int select)
 {
@@ -254,7 +254,7 @@ static int view3d_selectable_data(bContext *C)
                        if (ob->mode & OB_MODE_SCULPT) {
                                return 0;
                        }
-                       if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob) && !paint_vertsel_test(ob)) {//Radish
+                       if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob) && !paint_vertsel_test(ob)) {
                                return 0;
                        }
                }
@@ -749,7 +749,7 @@ static void do_lasso_select_meta(ViewContext *vc, int mcords[][2], short moves,
                }
        }
 }
-/* Radish */
+
 int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend)
 {
        Mesh *me;
@@ -809,7 +809,7 @@ int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend)
 
        return OPERATOR_FINISHED;
 }
-/* Radish */
+
 static void do_lasso_select_paintvert(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
 {
        Object *ob= vc->obact;
@@ -1943,7 +1943,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot)
        /* rna */
        WM_operator_properties_gesture_border(ot, TRUE);
 }
-/* Radish */
+
 /* much like facesel_face_pick()*/
 /* returns 0 if not found, otherwise 1 */
 static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, short rect)
@@ -1973,7 +1973,7 @@ static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], un
        
        return 1;
 }
-/* Radish */
+
 /* mouse selection in weight paint */
 /* gets called via generic mouse select operator */
 int mouse_wp_select(bContext *C, const int mval[2], short extend, Object *obact, Mesh* me)
@@ -2039,7 +2039,7 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
                return PE_mouse_particles(C, event->mval, extend);
        else if(obact && paint_facesel_test(obact))
                retval = paintface_mouse_select(C, obact, event->mval, extend);
-       /* Radish */
+       
        else if (paint_vertsel_test(obact)) {
                retval = mouse_wp_select(C, event->mval, extend, obact, obact->data);
        } else {
@@ -2168,7 +2168,7 @@ static void paint_facesel_circle_select(ViewContext *vc, int select, const int m
        }
 }
 
-/* Radish */
+
 static void paint_vertsel_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
 {
        Object *ob= vc->obact;
@@ -2440,7 +2440,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
        int select;
        
        select= (gesture_mode==GESTURE_MODAL_SELECT);
-                                                                                                                               /* Radish */
+                                                                                                                               
        if( CTX_data_edit_object(C) || paint_facesel_test(obact) || paint_vertsel_test(obact) ||
                (obact && (obact->mode & (OB_MODE_PARTICLE_EDIT|OB_MODE_POSE))) )
        {
@@ -2460,7 +2460,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
                else if(paint_facesel_test(obact)) {
                        paint_facesel_circle_select(&vc, select, mval, (float)radius);
                        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
-               }/* Radish */
+               }
                else if(paint_vertsel_test(obact)) {
                        paint_vertsel_circle_select(&vc, select, mval, (float)radius);
                        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
index 18148143eb993a299ce0c7d28a4d5f12ad11c0f9..3721f7a2af59caac1d110dbac4188992c34f891c 100644 (file)
@@ -38,7 +38,7 @@
 
 /* This array contains the bytes used to pad the buffer to the next
    64-byte boundary.  (RFC 1321, 3.1: Step 1)  */
-static const unsigned char fillbuf[64] = { 0x80, 0 /* 0, 0, ...  */ };
+static const unsigned char fillbuf[64] = { 0x80, 0 /* 0, 0, ...  */ };
 
 
 /* Initialize structure containing state of computation.
index 1cf2e46c375dc15735e3280d8aed62ca486ab081..25bb4958c977027c9ed32bc8d08ea8c4ff09c90c 100644 (file)
@@ -125,7 +125,7 @@ typedef struct TFace {
 
 #define ME_EDIT_PAINT_MASK (1 << 3)
 #define ME_EDIT_MIRROR_TOPO (1 << 4)
-#define ME_EDIT_VERT_SEL (1 << 5)/* Radish */
+#define ME_EDIT_VERT_SEL (1 << 5)
 
 /* me->flag */
 /* #define ME_ISDONE           1 */
index 6d0899d1fa9382e284555b5adcbcc1df66ddc586..f32f8d626deb68232a06aecf423becc4853b72fd 100644 (file)
@@ -62,7 +62,7 @@ struct bGPdata;
 typedef struct bDeformGroup {
        struct bDeformGroup *next, *prev;
        char name[32];
-       /* Radish: need this flag for locking weights */
+       /* need this flag for locking weights */
        char flag, pad[7];
 } bDeformGroup;
 #define MAX_VGROUP_NAME 32
index 7e2278cd30e2ab72b4489e1b867d59232f24112f..24072e9f2c8e4bd93208aeae77251671811c583e 100644 (file)
@@ -763,7 +763,7 @@ typedef struct ToolSettings {
 
        char auto_normalize; /*auto normalizing mode in wpaint*/
 
-       //Radish
+       
        char multipaint; /* paint multiple bones in wpaint */
 
        short sculpt_paint_settings; /* user preferences for sculpt and paint */
index d7d7fb932dcb6201291c55642830c6ff63f1c553..a439ec471cd40924c56e4a13cc134b8b82958c97 100644 (file)
@@ -90,7 +90,7 @@ void rna_Mesh_update_draw(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA
        }
 }
 
-/* Radish */
+
 void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        Mesh* me = ptr->data;
@@ -99,7 +99,7 @@ void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
        }
        rna_Mesh_update_draw(bmain, scene, ptr);
 }
-/* Radish */
+
 void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        Mesh* me = ptr->data;
@@ -2095,7 +2095,7 @@ static void rna_def_mesh(BlenderRNA *brna)
        RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
        RNA_def_property_update(prop, 0, "rna_Mesh_update_facemask");
 
-       /* Radish */
+       
        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 (weight paint only)");
index c4e0db98f5fcfa799bab513aecddf4295b3cb5e9..ee9d016dfe29331565af8032e14c843f41b7054a 100644 (file)
@@ -1265,7 +1265,7 @@ static void rna_def_vertex_group(BlenderRNA *brna)
        RNA_def_struct_name_property(srna, prop);
        RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set");
        RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */
-       /* Radish */
+       
        prop= RNA_def_property(srna, "lock_weight", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_ui_text(prop, "", "Maintain the relative weights for the group");
        RNA_def_property_boolean_sdna(prop, NULL, "flag", 0);
index a325e1b9d6711ad85a5b17b94a0a6fadfc6dcf33..025bea8d190efad4091bb3c844057230d328375d 100644 (file)
@@ -1044,7 +1044,7 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons
        }
 }
 
-/* Radish */
+
 
 /* note: without this, when Multi-Paint is activated/deactivated, the colors
  * will not change right away when multiple bones are selected, this function