forked from bartvdbraak/blender
Style Cleanup: whitespace
This commit is contained in:
parent
c3788b60f4
commit
8f7f8d679c
@ -335,9 +335,10 @@ void defvert_normalize_lock_single(MDeformVert *dvert,
|
||||
}
|
||||
|
||||
/* Same as defvert_normalize() if no locked vgroup is a member of the subset */
|
||||
void defvert_normalize_lock_map(MDeformVert *dvert,
|
||||
const bool *vgroup_subset, const int vgroup_tot,
|
||||
const bool *lock_flags, const int defbase_tot)
|
||||
void defvert_normalize_lock_map(
|
||||
MDeformVert *dvert,
|
||||
const bool *vgroup_subset, const int vgroup_tot,
|
||||
const bool *lock_flags, const int defbase_tot)
|
||||
{
|
||||
if (dvert->totweight == 0) {
|
||||
/* nothing */
|
||||
|
@ -543,7 +543,7 @@ static void offset_meet(EdgeHalf *e1, EdgeHalf *e2, BMVert *v, BMFace *f,
|
||||
* of not meeting at the same point by choosing to change the bevel offset on one
|
||||
* of the appropriate side of either e1 or e2, in order that the lines can meet on emid. */
|
||||
static void offset_on_edge_between(BevelParams *bp, EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid,
|
||||
BMVert *v, float meetco[3])
|
||||
BMVert *v, float meetco[3])
|
||||
{
|
||||
BLI_assert(e1->is_bev && e2->is_bev && !emid->is_bev);
|
||||
|
||||
@ -1965,7 +1965,8 @@ static void build_vmesh(BevelParams *bp, BMesh *bm, BevVert *bv)
|
||||
|
||||
/* Return the angle between the two faces adjacent to e.
|
||||
* If there are not two, return 0. */
|
||||
static float edge_face_angle(EdgeHalf *e) {
|
||||
static float edge_face_angle(EdgeHalf *e)
|
||||
{
|
||||
if (e->fprev && e->fnext) {
|
||||
/* angle between faces is supplement of angle between face normals */
|
||||
return (float)M_PI - angle_normalized_v3v3(e->fprev->no, e->fnext->no);
|
||||
@ -2160,30 +2161,31 @@ static void bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v)
|
||||
}
|
||||
else {
|
||||
switch (bp->offset_type) {
|
||||
case BEVEL_AMT_OFFSET:
|
||||
e->offset_l = bp->offset;
|
||||
break;
|
||||
case BEVEL_AMT_WIDTH:
|
||||
z = fabs(2.0f * sinf(edge_face_angle(e) / 2.0f));
|
||||
if (z < BEVEL_EPSILON)
|
||||
e->offset_l = 0.01f * bp->offset; /* undefined behavior, so tiny bevel */
|
||||
else
|
||||
e->offset_l = bp->offset / z;
|
||||
break;
|
||||
case BEVEL_AMT_DEPTH:
|
||||
z = fabs(cosf(edge_face_angle(e) / 2.0f));
|
||||
if (z < BEVEL_EPSILON)
|
||||
e->offset_l = 0.01f * bp->offset; /* undefined behavior, so tiny bevel */
|
||||
else
|
||||
e->offset_l = bp->offset / z;
|
||||
break;
|
||||
case BEVEL_AMT_PERCENT:
|
||||
e->offset_l = BM_edge_calc_length(e->prev->e) * bp->offset / 100.0f;
|
||||
e->offset_r = BM_edge_calc_length(e->next->e) * bp->offset / 100.0f;
|
||||
break;
|
||||
default:
|
||||
BLI_assert(!"bad bevel offset kind");
|
||||
e->offset_l = bp->offset;
|
||||
case BEVEL_AMT_OFFSET:
|
||||
e->offset_l = bp->offset;
|
||||
break;
|
||||
case BEVEL_AMT_WIDTH:
|
||||
z = fabsf(2.0f * sinf(edge_face_angle(e) / 2.0f));
|
||||
if (z < BEVEL_EPSILON)
|
||||
e->offset_l = 0.01f * bp->offset; /* undefined behavior, so tiny bevel */
|
||||
else
|
||||
e->offset_l = bp->offset / z;
|
||||
break;
|
||||
case BEVEL_AMT_DEPTH:
|
||||
z = fabsf(cosf(edge_face_angle(e) / 2.0f));
|
||||
if (z < BEVEL_EPSILON)
|
||||
e->offset_l = 0.01f * bp->offset; /* undefined behavior, so tiny bevel */
|
||||
else
|
||||
e->offset_l = bp->offset / z;
|
||||
break;
|
||||
case BEVEL_AMT_PERCENT:
|
||||
e->offset_l = BM_edge_calc_length(e->prev->e) * bp->offset / 100.0f;
|
||||
e->offset_r = BM_edge_calc_length(e->next->e) * bp->offset / 100.0f;
|
||||
break;
|
||||
default:
|
||||
BLI_assert(!"bad bevel offset kind");
|
||||
e->offset_l = bp->offset;
|
||||
break;
|
||||
}
|
||||
if (bp->offset_type != BEVEL_AMT_PERCENT)
|
||||
e->offset_r = e->offset_l;
|
||||
|
@ -397,7 +397,7 @@ void applyGridAbsolute(TransInfo *t)
|
||||
copy_v3_v3(iloc, td->ob->obmat[3]);
|
||||
}
|
||||
|
||||
mul_v3_v3fl(loc, iloc, 1.0f/grid_size);
|
||||
mul_v3_v3fl(loc, iloc, 1.0f / grid_size);
|
||||
loc[0] = floorf(loc[0]);
|
||||
loc[1] = floorf(loc[1]);
|
||||
loc[2] = floorf(loc[2]);
|
||||
@ -1441,7 +1441,7 @@ static bool snapCurve(short snap_mode, ARegion *ar, Object *ob, Curve *cu, float
|
||||
mul_mat3_m4_v3(imat, ray_normal_local);
|
||||
|
||||
for (nu = (ob->mode == OB_MODE_EDIT ? cu->editnurb->nurbs.first : cu->nurb.first); nu; nu = nu->next) {
|
||||
for (u = 0; u < nu->pntsu; u++){
|
||||
for (u = 0; u < nu->pntsu; u++) {
|
||||
switch (snap_mode) {
|
||||
case SCE_SNAP_MODE_VERTEX:
|
||||
{
|
||||
@ -1458,7 +1458,8 @@ static bool snapCurve(short snap_mode, ARegion *ar, Object *ob, Curve *cu, float
|
||||
if (!(nu->bezt[u].f3 & SELECT) && !(nu->bezt[u].h2 & HD_ALIGN && nu->bezt[u].f1 & SELECT)) {
|
||||
retval |= snapVertex(ar, nu->bezt[u].vec[2], NULL, obmat, NULL, ray_start, ray_start_local, ray_normal_local, mval, r_loc, NULL, r_dist_px, r_depth);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* curve is not visible outside editmode if nurb length less than two */
|
||||
if (nu->pntsu > 1) {
|
||||
retval |= snapVertex(ar, nu->bezt[u].vec[1], NULL, obmat, NULL, ray_start, ray_start_local, ray_normal_local, mval, r_loc, NULL, r_dist_px, r_depth);
|
||||
|
@ -70,7 +70,7 @@ void ntreeCompositColorBalanceSyncFromCDL(bNodeTree *UNUSED(ntree), bNode *node)
|
||||
|
||||
for (c = 0; c < 3; ++c) {
|
||||
float d = n->slope[c] + n->offset[c];
|
||||
n->lift[c] = (d != 0.0f ? n->slope[c] + 2.0f*n->offset[c] / d : 0.0f);
|
||||
n->lift[c] = (d != 0.0f ? n->slope[c] + 2.0f * n->offset[c] / d : 0.0f);
|
||||
n->gain[c] = d;
|
||||
n->gamma[c] = (n->power[c] != 0.0f) ? 1.0f / n->power[c] : 1000000.0f;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user