style cleanup
This commit is contained in:
@@ -220,7 +220,7 @@ void defvert_normalize_lock(MDeformVert *dvert, const int def_nr_lock)
|
|||||||
float lock_iweight = 1.0f;
|
float lock_iweight = 1.0f;
|
||||||
|
|
||||||
for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
|
for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
|
||||||
if(dw->def_nr != def_nr_lock) {
|
if (dw->def_nr != def_nr_lock) {
|
||||||
tot_weight += dw->weight;
|
tot_weight += dw->weight;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -235,7 +235,7 @@ void defvert_normalize_lock(MDeformVert *dvert, const int def_nr_lock)
|
|||||||
|
|
||||||
float scalar = (1.0f / tot_weight) * lock_iweight;
|
float scalar = (1.0f / tot_weight) * lock_iweight;
|
||||||
for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
|
for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
|
||||||
if(dw != dw_lock) {
|
if (dw != dw_lock) {
|
||||||
dw->weight *= scalar;
|
dw->weight *= scalar;
|
||||||
|
|
||||||
/* in case of division errors with very low weights */
|
/* in case of division errors with very low weights */
|
||||||
@@ -638,7 +638,7 @@ void defvert_add_index_notest(MDeformVert *dvert, int defgroup, const float weig
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
dw_new = MEM_callocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "defvert_add_to group, new deformWeight");
|
dw_new = MEM_callocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "defvert_add_to group, new deformWeight");
|
||||||
if(dvert->dw) {
|
if (dvert->dw) {
|
||||||
memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight);
|
memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight);
|
||||||
MEM_freeN(dvert->dw);
|
MEM_freeN(dvert->dw);
|
||||||
}
|
}
|
||||||
@@ -659,7 +659,7 @@ void defvert_remove_group(MDeformVert *dvert, MDeformWeight *dw)
|
|||||||
int i = dw - dvert->dw;
|
int i = dw - dvert->dw;
|
||||||
|
|
||||||
/* Security check! */
|
/* Security check! */
|
||||||
if(i < 0 || i >= dvert->totweight) {
|
if (i < 0 || i >= dvert->totweight) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -329,8 +329,8 @@ int BM_vert_edge_count_nonwire(BMVert *v)
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
BMIter eiter;
|
BMIter eiter;
|
||||||
BMEdge *edge;
|
BMEdge *edge;
|
||||||
BM_ITER(edge, &eiter, NULL, BM_EDGES_OF_VERT, v){
|
BM_ITER(edge, &eiter, NULL, BM_EDGES_OF_VERT, v) {
|
||||||
if(edge->l) {
|
if (edge->l) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -467,7 +467,7 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
|
|||||||
l = BM_face_other_vert_loop(owalk.f_hub, lwalk->lastv, v);
|
l = BM_face_other_vert_loop(owalk.f_hub, lwalk->lastv, v);
|
||||||
nexte = BM_edge_exists(v, l->v);
|
nexte = BM_edge_exists(v, l->v);
|
||||||
|
|
||||||
if(!BLI_ghash_haskey(walker->visithash, nexte)){
|
if (!BLI_ghash_haskey(walker->visithash, nexte)) {
|
||||||
lwalk = BMW_state_add(walker);
|
lwalk = BMW_state_add(walker);
|
||||||
lwalk->cur = nexte;
|
lwalk->cur = nexte;
|
||||||
lwalk->lastv = v;
|
lwalk->lastv = v;
|
||||||
|
|||||||
@@ -1005,7 +1005,7 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
|
|||||||
if(l2->f->len > 3)
|
if(l2->f->len > 3)
|
||||||
BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e, FALSE); /* clip this corner off */
|
BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e, FALSE); /* clip this corner off */
|
||||||
curedge = bmesh_disk_edge_next(curedge, v);
|
curedge = bmesh_disk_edge_next(curedge, v);
|
||||||
} while(curedge != v->e);
|
} while (curedge != v->e);
|
||||||
BME_Bevel_Dissolve_Disk(bm, v);
|
BME_Bevel_Dissolve_Disk(bm, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1170,17 +1170,13 @@ static void edgetag_context_set(BMEditMesh *em, Scene *scene, BMEdge *e, int val
|
|||||||
case EDGE_MODE_TAG_CREASE:
|
case EDGE_MODE_TAG_CREASE:
|
||||||
{
|
{
|
||||||
float *crease = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_CREASE);
|
float *crease = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_CREASE);
|
||||||
|
*crease = (val) ? 1.0f : 0.0f;
|
||||||
if (val) *crease = 1.0f;
|
|
||||||
else *crease = 0.0f;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EDGE_MODE_TAG_BEVEL:
|
case EDGE_MODE_TAG_BEVEL:
|
||||||
{
|
{
|
||||||
float *bweight = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_BWEIGHT);
|
float *bweight = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_BWEIGHT);
|
||||||
|
*bweight = (val) ? 1.0f : 0.0f;
|
||||||
if (val) *bweight = 1.0f;
|
|
||||||
else *bweight = 0.0f;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ static int mathutils_bmloopcol_set(BaseMathObject *bmo, int UNUSED(subtype))
|
|||||||
static int mathutils_bmloopcol_get_index(BaseMathObject *bmo, int subtype, int UNUSED(index))
|
static int mathutils_bmloopcol_get_index(BaseMathObject *bmo, int subtype, int UNUSED(index))
|
||||||
{
|
{
|
||||||
/* lazy, avoid repeteing the case statement */
|
/* lazy, avoid repeteing the case statement */
|
||||||
if(mathutils_bmloopcol_get(bmo, subtype) == -1)
|
if (mathutils_bmloopcol_get(bmo, subtype) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ static int mathutils_bmloopcol_set_index(BaseMathObject *bmo, int subtype, int i
|
|||||||
const float f = bmo->data[index];
|
const float f = bmo->data[index];
|
||||||
|
|
||||||
/* lazy, avoid repeteing the case statement */
|
/* lazy, avoid repeteing the case statement */
|
||||||
if(mathutils_bmloopcol_get(bmo, subtype) == -1)
|
if (mathutils_bmloopcol_get(bmo, subtype) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
bmo->data[index] = f;
|
bmo->data[index] = f;
|
||||||
|
|||||||
Reference in New Issue
Block a user