forked from bartvdbraak/blender
Code cleanup: style
This commit is contained in:
parent
930765faa8
commit
8480bb64ec
@ -877,7 +877,7 @@ static void xml_read_mesh(const XMLReadState& state, pugi::xml_node node)
|
||||
SubdParams sdparams(mesh, shader, smooth);
|
||||
xml_read_float(&sdparams.dicing_rate, node, "dicing_rate");
|
||||
|
||||
DiagSplit dsplit(sdparams);;
|
||||
DiagSplit dsplit(sdparams);
|
||||
sdmesh.tessellate(&dsplit);
|
||||
}
|
||||
else {
|
||||
|
@ -414,7 +414,7 @@ static void create_subd_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, PointerR
|
||||
//sdparams.camera = scene->camera;
|
||||
|
||||
/* tesselate */
|
||||
DiagSplit dsplit(sdparams);;
|
||||
DiagSplit dsplit(sdparams);
|
||||
sdmesh.tessellate(&dsplit);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ size_t (*MEM_allocN_len)(const void *vmemh) = MEM_lockfree_allocN_len;
|
||||
void (*MEM_freeN)(void *vmemh) = MEM_lockfree_freeN;
|
||||
void *(*MEM_dupallocN)(const void *vmemh) = MEM_lockfree_dupallocN;
|
||||
void *(*MEM_reallocN_id)(void *vmemh, size_t len, const char *str) = MEM_lockfree_reallocN_id;
|
||||
void *(*MEM_recallocN_id)(void *vmemh, size_t len, const char *str) = MEM_lockfree_recallocN_id;;
|
||||
void *(*MEM_recallocN_id)(void *vmemh, size_t len, const char *str) = MEM_lockfree_recallocN_id;
|
||||
void *(*MEM_callocN)(size_t len, const char *str) = MEM_lockfree_callocN;
|
||||
void *(*MEM_mallocN)(size_t len, const char *str) = MEM_lockfree_mallocN;
|
||||
void *(*MEM_mapallocN)(size_t len, const char *str) = MEM_lockfree_mapallocN;
|
||||
@ -71,7 +71,7 @@ void MEM_use_guarded_allocator(void)
|
||||
MEM_freeN = MEM_guarded_freeN;
|
||||
MEM_dupallocN = MEM_guarded_dupallocN;
|
||||
MEM_reallocN_id = MEM_guarded_reallocN_id;
|
||||
MEM_recallocN_id = MEM_guarded_recallocN_id;;
|
||||
MEM_recallocN_id = MEM_guarded_recallocN_id;
|
||||
MEM_callocN = MEM_guarded_callocN;
|
||||
MEM_mallocN = MEM_guarded_mallocN;
|
||||
MEM_mapallocN = MEM_guarded_mapallocN;
|
||||
|
@ -1149,13 +1149,14 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
|
||||
if ( spring ) {
|
||||
spring_verts_ordered_set(spring, medge[i].v1, medge[i].v2);
|
||||
if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW && medge[i].flag & ME_LOOSEEDGE) {
|
||||
if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW && medge[i].flag & ME_LOOSEEDGE) {
|
||||
// handle sewing (loose edges will be pulled together)
|
||||
spring->restlen = 0.0f;
|
||||
spring->stiffness = 1.0f;
|
||||
spring->type = CLOTH_SPRING_TYPE_SEWING;
|
||||
} else {
|
||||
if(clmd->sim_parms->vgroup_shrink > 0)
|
||||
}
|
||||
else {
|
||||
if (clmd->sim_parms->vgroup_shrink > 0)
|
||||
shrink_factor = 1.0f - ((cloth->verts[spring->ij].shrink_factor + cloth->verts[spring->kl].shrink_factor) / 2.0f);
|
||||
else
|
||||
shrink_factor = 1.0f - clmd->sim_parms->shrink_min;
|
||||
@ -1200,7 +1201,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
}
|
||||
|
||||
spring_verts_ordered_set(spring, mface[i].v1, mface[i].v3);
|
||||
if(clmd->sim_parms->vgroup_shrink > 0)
|
||||
if (clmd->sim_parms->vgroup_shrink > 0)
|
||||
shrink_factor = 1.0f - ((cloth->verts[spring->ij].shrink_factor + cloth->verts[spring->kl].shrink_factor) / 2.0f);
|
||||
else
|
||||
shrink_factor = 1.0f - clmd->sim_parms->shrink_min;
|
||||
@ -1224,7 +1225,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
|
||||
}
|
||||
|
||||
spring_verts_ordered_set(spring, mface[i].v2, mface[i].v4);
|
||||
if(clmd->sim_parms->vgroup_shrink > 0)
|
||||
if (clmd->sim_parms->vgroup_shrink > 0)
|
||||
shrink_factor = 1.0f - ((cloth->verts[spring->ij].shrink_factor + cloth->verts[spring->kl].shrink_factor) / 2.0f);
|
||||
else
|
||||
shrink_factor = 1.0f - clmd->sim_parms->shrink_min;
|
||||
|
@ -596,7 +596,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
|
||||
while (dl) {
|
||||
if (dl->type == DL_SURF) {
|
||||
if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U) == 0) {
|
||||
if ( (cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE)) {
|
||||
if ((cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE)) {
|
||||
dlnew = MEM_callocN(sizeof(DispList), "filldisp");
|
||||
BLI_addtail(&front, dlnew);
|
||||
dlnew->verts = fp1 = MEM_mallocN(sizeof(float) * 3 * dl->parts, "filldisp1");
|
||||
|
@ -1271,16 +1271,17 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
|
||||
k = scaling / (clmd->sim_parms->avg_spring_len + FLT_EPSILON);
|
||||
|
||||
// TODO: verify, half verified (couldn't see error)
|
||||
if(s->type & CLOTH_SPRING_TYPE_SEWING) {
|
||||
// sewing springs usually have a large distance at first so clamp the force so we don't get tunnelling through colission objects
|
||||
float force = k*(length-L);
|
||||
if(force > clmd->sim_parms->max_sewing) {
|
||||
force = clmd->sim_parms->max_sewing;
|
||||
}
|
||||
mul_fvector_S(stretch_force, dir, force);
|
||||
} else {
|
||||
mul_fvector_S(stretch_force, dir, k*(length-L));
|
||||
}
|
||||
if (s->type & CLOTH_SPRING_TYPE_SEWING) {
|
||||
// sewing springs usually have a large distance at first so clamp the force so we don't get tunnelling through colission objects
|
||||
float force = k*(length-L);
|
||||
if (force > clmd->sim_parms->max_sewing) {
|
||||
force = clmd->sim_parms->max_sewing;
|
||||
}
|
||||
mul_fvector_S(stretch_force, dir, force);
|
||||
}
|
||||
else {
|
||||
mul_fvector_S(stretch_force, dir, k * (length - L));
|
||||
}
|
||||
|
||||
VECADD(s->f, s->f, stretch_force);
|
||||
|
||||
|
@ -4369,7 +4369,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
|
||||
if (isNurbsel_count(cu, nu) == 1) {
|
||||
/* only 1 selected, not first or last, a little complex, but intuitive */
|
||||
if (nu->pntsv == 1) {
|
||||
if ( (nu->bp->f1 & SELECT) || (nu->bp[nu->pntsu - 1].f1 & SELECT)) {
|
||||
if ((nu->bp->f1 & SELECT) || (nu->bp[nu->pntsu - 1].f1 & SELECT)) {
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
|
@ -494,7 +494,7 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op)
|
||||
|
||||
if (RNA_struct_find_property(op->ptr, "index")) {
|
||||
int index = RNA_int_get(op->ptr, "index");
|
||||
if ( (index > -1) && (index < nentries)) {
|
||||
if ((index > -1) && (index < nentries)) {
|
||||
char name[FILE_MAX];
|
||||
|
||||
fsmenu_remove_entry(fsmenu, FS_CATEGORY_BOOKMARKS, index);
|
||||
|
@ -882,7 +882,7 @@ static void stitch_propagate_uv_final_position(Scene *scene,
|
||||
}
|
||||
|
||||
/* end of calculations, keep only the selection flag */
|
||||
if ( (!state->snap_islands) || ((!state->midpoints) && (element_iter->island == state->static_island))) {
|
||||
if ((!state->snap_islands) || ((!state->midpoints) && (element_iter->island == state->static_island))) {
|
||||
element_iter->flag &= STITCH_SELECTED;
|
||||
}
|
||||
|
||||
|
@ -2321,7 +2321,7 @@ void do_material_tex(ShadeInput *shi, Render *re)
|
||||
|
||||
/* texture output */
|
||||
|
||||
if ( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
|
||||
if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
|
||||
texres.tin = rgb_to_grayscale(&texres.tr);
|
||||
rgbnor -= TEX_RGB;
|
||||
}
|
||||
@ -2759,7 +2759,7 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float col_
|
||||
|
||||
/* texture output */
|
||||
|
||||
if ( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
|
||||
if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
|
||||
texres.tin = rgb_to_grayscale(&texres.tr);
|
||||
rgbnor -= TEX_RGB;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user