use_verify option to defvert_sync_mapped and defvert_sync was flipped, also minor edits to defvert_verify_index() - no functional change.

This commit is contained in:
Campbell Barton
2011-10-31 06:13:20 +00:00
parent 9905094f5d
commit 797d2bbd88
3 changed files with 18 additions and 27 deletions

View File

@@ -104,8 +104,8 @@ void defvert_sync (MDeformVert *dvert_r, const MDeformVert *dvert, int use_verif
MDeformWeight *dw; MDeformWeight *dw;
for(i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) { for(i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) {
MDeformWeight *dw_r; MDeformWeight *dw_r;
if(use_verify) dw_r= defvert_find_index(dvert_r, dw->def_nr); if(use_verify) dw_r= defvert_verify_index(dvert_r, dw->def_nr);
else dw_r= defvert_verify_index(dvert_r, dw->def_nr); else dw_r= defvert_find_index(dvert_r, dw->def_nr);
if(dw_r) { if(dw_r) {
dw_r->weight= dw->weight; 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++) { for (i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) {
if (dw->def_nr < flip_map_len) { if (dw->def_nr < flip_map_len) {
MDeformWeight *dw_r; MDeformWeight *dw_r;
if(use_verify) dw_r= defvert_find_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_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) { if(dw_r) {
dw_r->weight= dw->weight; dw_r->weight= dw->weight;
@@ -487,25 +487,25 @@ MDeformWeight *defvert_verify_index(MDeformVert *dv, const int defgroup)
MDeformWeight *newdw; MDeformWeight *newdw;
/* do this check always, this function is used to check for it */ /* do this check always, this function is used to check for it */
if(!dv || defgroup<0) if(!dv || defgroup < 0)
return NULL; return NULL;
newdw = defvert_find_index(dv, defgroup); newdw= defvert_find_index(dv, defgroup);
if(newdw) if(newdw)
return newdw; return newdw;
newdw = MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight"); newdw= MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
if(dv->dw) { if (dv->dw) {
memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight);
MEM_freeN(dv->dw); MEM_freeN(dv->dw);
} }
dv->dw=newdw; dv->dw= newdw;
newdw += dv->totweight;
dv->dw[dv->totweight].weight=0.0f; newdw->weight= 0.0f;
dv->dw[dv->totweight].def_nr=defgroup; newdw->def_nr= defgroup;
/* Group index */ /* Group index */
dv->totweight++; dv->totweight++;
return dv->dw+(dv->totweight-1); return newdw;
} }

View File

@@ -346,7 +346,6 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
paintface_flush_flags(ob); 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) void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
{ {
Mesh *me; Mesh *me;

View File

@@ -20,7 +20,10 @@
* *
* The Original Code was in: source/blender/bpython/include/BPY_extern.h * 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 ***** * ***** END GPL LICENSE BLOCK *****
*/ */
@@ -39,14 +42,10 @@ struct ID; /* DNA_ID.h */
struct Object; /* DNA_object_types.h */ struct Object; /* DNA_object_types.h */
struct ChannelDriver; /* DNA_anim_types.h */ struct ChannelDriver; /* DNA_anim_types.h */
struct ListBase; /* DNA_listBase.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 bConstraint; /* DNA_constraint_types.h */
struct bPythonConstraint; /* DNA_constraint_types.h */ struct bPythonConstraint; /* DNA_constraint_types.h */
struct bConstraintOb; /* DNA_constraint_types.h */ struct bConstraintOb; /* DNA_constraint_types.h */
struct bConstraintTarget; /* DNA_constraint_types.h*/ struct bConstraintTarget; /* DNA_constraint_types.h*/
struct BPyMenu;
struct bContext; struct bContext;
struct bContextDataResult; struct bContextDataResult;
struct ReportList; 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); void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con);
int BPY_is_pyconstraint(struct Text *text); int BPY_is_pyconstraint(struct Text *text);
// void BPY_free_pyconstraint_links(struct Text *text); // void BPY_free_pyconstraint_links(struct Text *text);
//
void BPY_python_start(int argc, const char **argv); void BPY_python_start(int argc, const char **argv);
void BPY_python_end(void); 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 */ /* 2.5 UI Scripts */
int BPY_filepath_exec(struct bContext *C, const char *filepath, struct ReportList *reports); int BPY_filepath_exec(struct bContext *C, const char *filepath, struct ReportList *reports);