use_verify option to defvert_sync_mapped and defvert_sync was flipped, also minor...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 31 Oct 2011 06:13:20 +0000 (06:13 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 31 Oct 2011 06:13:20 +0000 (06:13 +0000)
source/blender/blenkernel/intern/deform.c
source/blender/editors/mesh/editface.c
source/blender/python/BPY_extern.h

index a961002..83eda86 100644 (file)
@@ -104,8 +104,8 @@ void defvert_sync (MDeformVert *dvert_r, const MDeformVert *dvert, int use_verif
                MDeformWeight *dw;
                for(i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) {
                        MDeformWeight *dw_r;
-                       if(use_verify)  dw_r= defvert_find_index(dvert_r, dw->def_nr);
-                       else                    dw_r= defvert_verify_index(dvert_r, dw->def_nr);
+                       if(use_verify)  dw_r= defvert_verify_index(dvert_r, dw->def_nr);
+                       else                    dw_r= defvert_find_index(dvert_r, dw->def_nr);
 
                        if(dw_r) {
                                dw_r->weight= dw->weight;
@@ -123,8 +123,8 @@ void defvert_sync_mapped (MDeformVert *dvert_r, const MDeformVert *dvert, const
                for (i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) {
                        if (dw->def_nr < flip_map_len) {
                                MDeformWeight *dw_r;
-                               if(use_verify)  dw_r= defvert_find_index(dvert_r, flip_map[dw->def_nr]);
-                               else                    dw_r= defvert_verify_index(dvert_r, flip_map[dw->def_nr]);
+                               if(use_verify)  dw_r= defvert_verify_index(dvert_r, flip_map[dw->def_nr]);
+                               else                    dw_r= defvert_find_index(dvert_r, flip_map[dw->def_nr]);
 
                                if(dw_r) {
                                        dw_r->weight= dw->weight;
@@ -487,25 +487,25 @@ MDeformWeight *defvert_verify_index(MDeformVert *dv, const int defgroup)
        MDeformWeight *newdw;
 
        /* do this check always, this function is used to check for it */
-       if(!dv || defgroup<0)
+       if(!dv || defgroup < 0)
                return NULL;
 
-       newdw = defvert_find_index(dv, defgroup);
+       newdw= defvert_find_index(dv, defgroup);
        if(newdw)
                return newdw;
 
-       newdw = MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
-       if(dv->dw) {
+       newdw= MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
+       if (dv->dw) {
                memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight);
                MEM_freeN(dv->dw);
        }
-       dv->dw=newdw;
-
-       dv->dw[dv->totweight].weight=0.0f;
-       dv->dw[dv->totweight].def_nr=defgroup;
+       dv->dw= newdw;
+       newdw += dv->totweight;
+       newdw->weight= 0.0f;
+       newdw->def_nr= defgroup;
        /* Group index */
 
        dv->totweight++;
 
-       return dv->dw+(dv->totweight-1);
+       return newdw;
 }
index 279657e..02d20e6 100644 (file)
@@ -346,7 +346,6 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
        paintface_flush_flags(ob);
 }
 
-/* note: caller needs to run paintface_flush_flags(ob) after this */
 void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
 {
        Mesh *me;
index c43a252..d8ddcd5 100644 (file)
  *
  * The Original Code was in: source/blender/bpython/include/BPY_extern.h
  *
- * Contributor(s): Michel Selten, Willian P. Germano, Chris Keith
+ * Contributor(s): Michel Selten,
+ *                 Willian P. Germano,
+ *                 Chris Keith,
+ *                 Campbell Barton
  *
  * ***** END GPL LICENSE BLOCK *****
  */
@@ -39,14 +42,10 @@ struct ID; /* DNA_ID.h */
 struct Object; /* DNA_object_types.h */
 struct ChannelDriver; /* DNA_anim_types.h */
 struct ListBase; /* DNA_listBase.h */
-struct SpaceText; /* DNA_space_types.h */
-struct ScrArea; /* DNA_screen_types.h */
-struct bScreen; /* DNA_screen_types.h */
 struct bConstraint; /* DNA_constraint_types.h */
 struct bPythonConstraint; /* DNA_constraint_types.h */
 struct bConstraintOb; /* DNA_constraint_types.h */
 struct bConstraintTarget; /* DNA_constraint_types.h*/
-struct BPyMenu;
 struct bContext;
 struct bContextDataResult;
 struct ReportList;
@@ -61,16 +60,9 @@ void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTa
 void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con);
 int BPY_is_pyconstraint(struct Text *text);
 //     void BPY_free_pyconstraint_links(struct Text *text);
-//
+
 void BPY_python_start(int argc, const char **argv);
 void BPY_python_end(void);
-//     void init_syspath(int first_time);
-//     void syspath_append(char *dir);
-//     void BPY_rebuild_syspath(void);
-//     int BPY_path_update(void);
-//
-//     int BPY_Err_getLinenumber(void);
-//     const char *BPY_Err_getFilename(void);
 
 /* 2.5 UI Scripts */
 int            BPY_filepath_exec(struct bContext *C, const char *filepath, struct ReportList *reports);