From 1eed46c788f1c9e0d92985857bdbf5a7045f6791 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Jun 2018 17:04:27 +0200 Subject: Cleanup: trailing space for modifiers --- source/blender/modifiers/CMakeLists.txt | 2 +- source/blender/modifiers/intern/MOD_armature.c | 4 +- source/blender/modifiers/intern/MOD_bevel.c | 2 +- source/blender/modifiers/intern/MOD_boolean.c | 2 +- source/blender/modifiers/intern/MOD_build.c | 26 ++++----- source/blender/modifiers/intern/MOD_cast.c | 4 +- source/blender/modifiers/intern/MOD_cloth.c | 26 ++++----- source/blender/modifiers/intern/MOD_collision.c | 30 +++++----- source/blender/modifiers/intern/MOD_displace.c | 2 +- source/blender/modifiers/intern/MOD_dynamicpaint.c | 8 +-- source/blender/modifiers/intern/MOD_edgesplit.c | 6 +- source/blender/modifiers/intern/MOD_explode.c | 14 ++--- source/blender/modifiers/intern/MOD_fluidsim.c | 12 ++-- .../blender/modifiers/intern/MOD_fluidsim_util.c | 26 ++++----- source/blender/modifiers/intern/MOD_hook.c | 12 ++-- source/blender/modifiers/intern/MOD_lattice.c | 2 +- source/blender/modifiers/intern/MOD_mask.c | 66 +++++++++++----------- source/blender/modifiers/intern/MOD_meshdeform.c | 8 +-- source/blender/modifiers/intern/MOD_mirror.c | 12 ++-- source/blender/modifiers/intern/MOD_multires.c | 6 +- .../blender/modifiers/intern/MOD_particlesystem.c | 4 +- source/blender/modifiers/intern/MOD_remesh.c | 16 +++--- source/blender/modifiers/intern/MOD_screw.c | 44 +++++++-------- source/blender/modifiers/intern/MOD_shrinkwrap.c | 2 +- source/blender/modifiers/intern/MOD_skin.c | 64 ++++++++++----------- source/blender/modifiers/intern/MOD_smoke.c | 8 +-- source/blender/modifiers/intern/MOD_smooth.c | 4 +- source/blender/modifiers/intern/MOD_surface.c | 14 ++--- source/blender/modifiers/intern/MOD_util.c | 2 +- source/blender/modifiers/intern/MOD_uvproject.c | 6 +- .../modifiers/intern/MOD_weightvgproximity.c | 2 +- 31 files changed, 218 insertions(+), 218 deletions(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index a70612447d3..80a67083582 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -24,7 +24,7 @@ # # ***** END GPL LICENSE BLOCK ***** -set(INC +set(INC . intern ../blenkernel diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index 0075e87e63b..5b5e139d33a 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -58,7 +58,7 @@ static void initData(ModifierData *md) { ArmatureModifierData *amd = (ArmatureModifierData *) md; - + amd->deformflag = ARM_DEF_VGROUP; } @@ -131,7 +131,7 @@ static void deformVerts( ArmatureModifierData *amd = (ArmatureModifierData *) md; modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ - + armature_deform_verts(amd->object, ob, derivedData, vertexCos, NULL, numVerts, amd->deformflag, (float(*)[3])amd->prevCos, amd->defgrp_name); diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index b033327da01..c70870d5671 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -31,7 +31,7 @@ /** \file blender/modifiers/intern/MOD_bevel.c * \ingroup modifiers */ - + #include "DNA_object_types.h" #include "BLI_utildefines.h" diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index 8644d9fd203..edbfd0408b5 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -346,7 +346,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED( CustomDataMask dataMask = CD_MASK_MTFACE | CD_MASK_MEDGE; dataMask |= CD_MASK_MDEFORMVERT; - + return dataMask; } diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index c3fea60fe88..e877d5649d4 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -106,11 +106,11 @@ static DerivedMesh *applyModifier( frac = (BKE_scene_frame_get(md->scene) - bmd->start) / bmd->length; CLAMP(frac, 0.0f, 1.0f); - + if (bmd->flag & MOD_BUILD_FLAG_REVERSE) { frac = 1.0f - frac; } - + numFaces_dst = numPoly_src * frac; numEdges_dst = numEdge_src * frac; @@ -120,7 +120,7 @@ static DerivedMesh *applyModifier( MLoop *ml, *mloop; MEdge *medge; uintptr_t hash_num, hash_num_alt; - + if (bmd->flag & MOD_BUILD_FLAG_RANDOMIZE) { BLI_array_randomize(faceMap, sizeof(*faceMap), numPoly_src, bmd->seed); @@ -198,7 +198,7 @@ static DerivedMesh *applyModifier( /* get the set of edges that will be in the new mesh */ for (i = 0; i < numEdges_dst; i++) { j = BLI_ghash_len(edgeHash); - + BLI_ghash_insert(edgeHash, SET_INT_IN_POINTER(j), SET_INT_IN_POINTER(edgeMap[i])); BLI_ghash_insert(edgeHash2, SET_INT_IN_POINTER(edgeMap[i]), @@ -240,39 +240,39 @@ static DerivedMesh *applyModifier( DM_copy_vert_data(dm, result, oldIndex, newIndex, 1); *dest = source; } - + /* copy the edges across, remapping indices */ for (i = 0; i < BLI_ghash_len(edgeHash); i++) { MEdge source; MEdge *dest; int oldIndex = GET_INT_FROM_POINTER(BLI_ghash_lookup(edgeHash, SET_INT_IN_POINTER(i))); - + source = medge_src[oldIndex]; dest = CDDM_get_edge(result, i); - + source.v1 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v1))); source.v2 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v2))); - + DM_copy_edge_data(dm, result, oldIndex, i, 1); *dest = source; } mpoly_dst = CDDM_get_polys(result); /* mloop_dst = */ ml_dst = CDDM_get_loops(result); - + /* copy the faces across, remapping indices */ k = 0; for (i = 0; i < numFaces_dst; i++) { MPoly *source; MPoly *dest; - + source = mpoly_src + faceMap[i]; dest = mpoly_dst + i; DM_copy_poly_data(dm, result, faceMap[i], i, 1); - + *dest = *source; dest->loopstart = k; - + DM_copy_loop_data(dm, result, source->loopstart, dest->loopstart, dest->totloop); ml_src = mloop_src + source->loopstart; @@ -285,7 +285,7 @@ static DerivedMesh *applyModifier( BLI_ghash_free(vertHash, NULL, NULL); BLI_ghash_free(edgeHash, NULL, NULL); BLI_ghash_free(edgeHash2, NULL, NULL); - + MEM_freeN(vertMap); MEM_freeN(edgeMap); MEM_freeN(faceMap); diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index 3416190b7b0..f09f2d619a2 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -67,7 +67,7 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { CastModifierData *cmd = (CastModifierData *) md; short flag; - + flag = cmd->flag & (MOD_CAST_X | MOD_CAST_Y | MOD_CAST_Z); if ((cmd->fac == 0.0f) || flag == 0) return true; @@ -137,7 +137,7 @@ static void sphere_do( flag = cmd->flag; type = cmd->type; /* projection type: sphere or cylinder */ - if (type == MOD_CAST_TYPE_CYLINDER) + if (type == MOD_CAST_TYPE_CYLINDER) flag &= ~MOD_CAST_Z; ctrl_ob = cmd->object; diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 5b7ebe94c32..0317e0a92e4 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -57,18 +57,18 @@ #include "MOD_util.h" -static void initData(ModifierData *md) +static void initData(ModifierData *md) { ClothModifierData *clmd = (ClothModifierData *) md; - + clmd->sim_parms = MEM_callocN(sizeof(ClothSimSettings), "cloth sim parms"); clmd->coll_parms = MEM_callocN(sizeof(ClothCollSettings), "cloth coll parms"); clmd->point_cache = BKE_ptcache_add(&clmd->ptcaches); - + /* check for alloc failing */ if (!clmd->sim_parms || !clmd->coll_parms || !clmd->point_cache) return; - + cloth_init(clmd); } @@ -78,7 +78,7 @@ static void deformVerts( { DerivedMesh *dm; ClothModifierData *clmd = (ClothModifierData *) md; - + /* check for alloc failing */ if (!clmd->sim_parms || !clmd->coll_parms) { initData(md); @@ -121,7 +121,7 @@ static void deformVerts( static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) { ClothModifierData *clmd = (ClothModifierData *) md; - + if (clmd) { /* Actual code uses get_collisionobjects */ #ifdef WITH_LEGACY_DEPSGRAPH @@ -171,7 +171,7 @@ static void copyData(const ModifierData *md, ModifierData *target) if (tclmd->coll_parms) MEM_freeN(tclmd->coll_parms); - + BKE_ptcache_free_list(&tclmd->ptcaches); tclmd->point_cache = NULL; @@ -194,13 +194,13 @@ static bool dependsOnTime(ModifierData *UNUSED(md)) static void freeData(ModifierData *md) { ClothModifierData *clmd = (ClothModifierData *) md; - + if (clmd) { if (G.debug_value > 0) printf("clothModifier_freeData\n"); - + cloth_free_modifier_extern(clmd); - + if (clmd->sim_parms) { if (clmd->sim_parms->effector_weights) MEM_freeN(clmd->sim_parms->effector_weights); @@ -208,13 +208,13 @@ static void freeData(ModifierData *md) } if (clmd->coll_parms) MEM_freeN(clmd->coll_parms); - + BKE_ptcache_free_list(&clmd->ptcaches); clmd->point_cache = NULL; - + if (clmd->hairdata) MEM_freeN(clmd->hairdata); - + if (clmd->solver_result) MEM_freeN(clmd->solver_result); } diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index 067f6ddf3ef..4390a5830d8 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -49,10 +49,10 @@ #include "MOD_modifiertypes.h" -static void initData(ModifierData *md) +static void initData(ModifierData *md) { CollisionModifierData *collmd = (CollisionModifierData *) md; - + collmd->x = NULL; collmd->xnew = NULL; collmd->current_x = NULL; @@ -68,7 +68,7 @@ static void initData(ModifierData *md) static void freeData(ModifierData *md) { CollisionModifierData *collmd = (CollisionModifierData *) md; - + if (collmd) { /* Seriously? */ if (collmd->bvhtree) { BLI_bvhtree_free(collmd->bvhtree); @@ -105,30 +105,30 @@ static void deformVerts( CollisionModifierData *collmd = (CollisionModifierData *) md; DerivedMesh *dm = NULL; MVert *tempVert = NULL; - + /* if possible use/create DerivedMesh */ if (derivedData) dm = CDDM_copy(derivedData); else if (ob->type == OB_MESH) dm = CDDM_from_mesh(ob->data); - + if (!ob->pd) { printf("CollisionModifier deformVerts: Should not happen!\n"); return; } - + if (dm) { float current_time = 0; unsigned int mvert_num = 0; CDDM_apply_vert_coords(dm, vertexCos); CDDM_calc_normals(dm); - + current_time = BKE_scene_frame_get(md->scene); - + if (G.debug_value > 0) printf("current_time %f, collmd->time_xnew %f\n", current_time, collmd->time_xnew); - + mvert_num = dm->getNumVerts(dm); - + if (current_time > collmd->time_xnew) { unsigned int i; @@ -144,7 +144,7 @@ static void deformVerts( /* we save global positions */ mul_m4_v3(ob->obmat, collmd->x[i].co); } - + collmd->xnew = MEM_dupallocN(collmd->x); // frame end position collmd->current_x = MEM_dupallocN(collmd->x); // inter-frame collmd->current_xnew = MEM_dupallocN(collmd->x); // inter-frame @@ -201,9 +201,9 @@ static void deformVerts( collmd->tri, collmd->tri_num, ob->pd->pdef_sboft); } - + } - + /* happens on file load (ONLY when i decomment changes in readfile.c) */ if (!collmd->bvhtree) { collmd->bvhtree = bvhtree_build_from_mvert( @@ -226,7 +226,7 @@ static void deformVerts( else if (mvert_num != collmd->mvert_num) { freeData((ModifierData *)collmd); } - + } else if (current_time < collmd->time_xnew) { freeData((ModifierData *)collmd); @@ -237,7 +237,7 @@ static void deformVerts( } } } - + if (dm) dm->release(dm); } diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index a71f58aa4a0..ed78e026a7f 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -150,7 +150,7 @@ static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContex dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Displace Modifier"); } - + if (dmd->texmapping == MOD_DISP_MAP_GLOBAL || (ELEM(dmd->direction, MOD_DISP_DIR_X, MOD_DISP_DIR_Y, MOD_DISP_DIR_Z, MOD_DISP_DIR_RGB_XYZ) && diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index 8fa8ddd3098..8d3aea2d5c8 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -47,10 +47,10 @@ #include "MOD_modifiertypes.h" -static void initData(ModifierData *md) +static void initData(ModifierData *md) { DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md; - + pmd->canvas = NULL; pmd->brush = NULL; pmd->type = MOD_DYNAMICPAINT_TYPE_CANVAS; @@ -60,7 +60,7 @@ static void copyData(const ModifierData *md, ModifierData *target) { const DynamicPaintModifierData *pmd = (const DynamicPaintModifierData *)md; DynamicPaintModifierData *tpmd = (DynamicPaintModifierData *)target; - + dynamicPaint_Modifier_copy(pmd, tpmd); } @@ -79,7 +79,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) DynamicPaintSurface *surface = pmd->canvas->surfaces.first; for (; surface; surface = surface->next) { /* tface */ - if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ || + if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ || surface->init_color_type == MOD_DPAINT_INITIAL_TEXTURE) { dataMask |= CD_MASK_MLOOPUV | CD_MASK_MTEXPOLY; diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index a0d717f1c0f..1de698a6218 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -60,7 +60,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd) const bool calc_face_normals = (emd->flags & MOD_EDGESPLIT_FROMANGLE) != 0; bm = DM_to_bmesh(dm, calc_face_normals); - + if (emd->flags & MOD_EDGESPLIT_FROMANGLE) { BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { /* check for 1 edge having 2 face users */ @@ -78,7 +78,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd) } } } - + if (emd->flags & MOD_EDGESPLIT_FROMFLAG) { BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { /* check for 2 or more edge users */ @@ -91,7 +91,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd) } } } - + BM_mesh_edgesplit(bm, false, true, false); /* BM_mesh_validate(bm); */ /* for troubleshooting */ diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index dc36156e953..a7f09aec481 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -65,7 +65,7 @@ static void initData(ModifierData *md) static void freeData(ModifierData *md) { ExplodeModifierData *emd = (ExplodeModifierData *) md; - + MEM_SAFE_FREE(emd->facepa); } static void copyData(const ModifierData *md, ModifierData *target) @@ -192,7 +192,7 @@ static int edgecut_get(EdgeHash *edgehash, unsigned int v1, unsigned int v2) return GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, v1, v2)); } - + static const short add_faces[24] = { 0, 0, 0, 2, 0, 1, 2, 2, 0, 2, 1, @@ -634,7 +634,7 @@ static DerivedMesh *cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) /* count new faces due to splitting */ for (i = 0, fs = facesplit; i < totface; i++, fs++) totfsplit += add_faces[*fs]; - + splitdm = CDDM_from_template_ex( dm, totesplit, 0, totface + totfsplit, 0, 0, CD_MASK_DERIVEDMESH | CD_MASK_FACECORNERS); @@ -843,7 +843,7 @@ static DerivedMesh *explodeMesh( * with BLI_edgehashIterator_getKey */ if (facepa[i] == totpart || cfra < (pars + facepa[i])->time) mindex = totvert + totpart; - else + else mindex = totvert + facepa[i]; mf = &mface[i]; @@ -934,12 +934,12 @@ static DerivedMesh *explodeMesh( dm->getTessFace(dm, i, &source); mf = CDDM_get_tessface(explode, u); - + orig_v4 = source.v4; if (facepa[i] != totpart && cfra < pa->time) mindex = totvert + totpart; - else + else mindex = totvert + facepa[i]; source.v1 = edgecut_get(vertpahash, source.v1, mindex); @@ -1021,7 +1021,7 @@ static DerivedMesh *applyModifier( { if (psmd->flag & eParticleSystemFlag_Pars) psmd->flag &= ~eParticleSystemFlag_Pars; - + if (emd->flag & eExplodeFlag_CalcFaces) emd->flag &= ~eExplodeFlag_CalcFaces; diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c index 3e339b4f974..00b7f245d4c 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim.c +++ b/source/blender/modifiers/intern/MOD_fluidsim.c @@ -55,13 +55,13 @@ static void initData(ModifierData *md) { FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; - + fluidsim_init(fluidmd); } static void freeData(ModifierData *md) { FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; - + fluidsim_free(fluidmd); } @@ -69,7 +69,7 @@ static void copyData(const ModifierData *md, ModifierData *target) { const FluidsimModifierData *fluidmd = (const FluidsimModifierData *) md; FluidsimModifierData *tfluidmd = (FluidsimModifierData *) target; - + if (fluidmd->fss) { tfluidmd->fss = MEM_dupallocN(fluidmd->fss); if (tfluidmd->fss && (tfluidmd->fss->meshVelocities != NULL)) { @@ -92,11 +92,11 @@ static DerivedMesh *applyModifier( { FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; DerivedMesh *result = NULL; - + /* check for alloc failing */ if (!fluidmd->fss) { initData(md); - + if (!fluidmd->fss) { return dm; } @@ -119,7 +119,7 @@ static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContex if (ob1 != ctx->object) { FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob1, eModifierType_Fluidsim); - + /* only put dependencies from NON-DOMAIN fluids in here */ if (fluidmdtmp && fluidmdtmp->fss && (fluidmdtmp->fss->type != OB_FLUIDSIM_DOMAIN)) { DagNode *curNode = dag_get_node(ctx->forest, ob1); diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 479466ead65..e366116a5fb 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -69,10 +69,10 @@ void fluidsim_init(FluidsimModifierData *fluidmd) FluidsimSettings *fss = MEM_callocN(sizeof(FluidsimSettings), "fluidsimsettings"); fluidmd->fss = fss; - + if (!fss) return; - + fss->fmd = fluidmd; fss->type = OB_FLUIDSIM_ENABLE; fss->threads = 0; @@ -86,12 +86,12 @@ void fluidsim_init(FluidsimModifierData *fluidmd) fss->viscosityValue = 1.0; fss->viscosityExponent = 6; - + fss->grav[0] = 0.0; fss->grav[1] = 0.0; fss->grav[2] = -9.81; - fss->animStart = 0.0; + fss->animStart = 0.0; fss->animEnd = 4.0; fss->animRate = 1.0; fss->gstar = 0.005; // used as normgstar @@ -127,18 +127,18 @@ void fluidsim_init(FluidsimModifierData *fluidmd) fss->cpsTimeStart = fss->animStart; fss->cpsTimeEnd = fss->animEnd; fss->cpsQuality = 10.0; // 1.0 / 10.0 => means 0.1 width - + /* * BAD TODO: this is done in buttons_object.c in the moment * Mesh *mesh = ob->data; * // calculate bounding box * fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize); */ - + fss->meshVelocities = NULL; - + fss->lastgoodframe = -1; - + fss->flag |= OB_FLUIDSIM_ACTIVE; } @@ -160,7 +160,7 @@ void fluidsim_free(FluidsimModifierData *fluidmd) /* Seems to never be used, but for sqke of consistency... */ BLI_assert(fluidmd->point_cache == NULL); fluidmd->point_cache = NULL; - + return; } @@ -431,7 +431,7 @@ static DerivedMesh *fluidsim_read_cache( Object *ob, DerivedMesh *orgdm, FluidsimModifierData *fluidmd, int framenr, int useRenderParams) { - int curFrame = framenr /* - 1 */ /*scene->r.sfra*/; /* start with 0 at start frame */ + int curFrame = framenr /* - 1 */ /*scene->r.sfra*/; /* start with 0 at start frame */ /* why start with 0 as start frame?? Animations + time are frozen for frame 0 anyway. (See physics_fluid.c for that. - DG */ /* If we start with frame 0, we need to remap all animation channels, too, because they will all be 1 frame late if using frame-1! - DG */ @@ -524,7 +524,7 @@ DerivedMesh *fluidsimModifier_do( FluidsimSettings *fss = NULL; framenr = (int)scene->r.cfra; - + /* only handle fluidsim domains */ if (fluidmd && fluidmd->fss && (fluidmd->fss->type != OB_FLUIDSIM_DOMAIN)) return dm; @@ -543,12 +543,12 @@ DerivedMesh *fluidsimModifier_do( framenr = fss->lastgoodframe - framenr + 1; CLAMP(framenr, 1, fss->lastgoodframe); } - + /* try to read from cache */ /* if the frame is there, fine, otherwise don't do anything */ if ((result = fluidsim_read_cache(ob, dm, fluidmd, framenr, useRenderParams))) return result; - + return dm; #else /* unused */ diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 05defc85024..5bbcaee2caa 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -52,7 +52,7 @@ #include "MOD_util.h" -static void initData(ModifierData *md) +static void initData(ModifierData *md) { HookModifierData *hmd = (HookModifierData *) md; @@ -117,7 +117,7 @@ static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContex if (hmd->object) { DagNode *curNode = dag_get_node(ctx->forest, hmd->object); - + if (hmd->subtarget[0]) dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Hook Modifier"); else @@ -272,7 +272,7 @@ static void deformVerts_do( float dmat[4][4]; int i, *index_pt; struct HookData_cb hd; - + if (hmd->curfalloff == NULL) { /* should never happen, but bad lib linking could cause it */ hmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); @@ -321,7 +321,7 @@ static void deformVerts_do( /* Regarding index range checking below. * - * This should always be true and I don't generally like + * This should always be true and I don't generally like * "paranoid" style code like this, but old files can have * indices that are out of range because old blender did * not correct them on exit editmode. - zr @@ -332,13 +332,13 @@ static void deformVerts_do( } else if (hmd->indexar) { /* vertex indices? */ const int *origindex_ar; - + /* if DerivedMesh is present and has original index data, use it */ if (dm && (origindex_ar = dm->getVertDataArray(dm, CD_ORIGINDEX))) { for (i = 0, index_pt = hmd->indexar; i < hmd->totindex; i++, index_pt++) { if (*index_pt < numVerts) { int j; - + for (j = 0; j < numVerts; j++) { if (origindex_ar[j] == *index_pt) { hook_co_apply(&hd, j); diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index 9f4e87026e5..760e3c0e22a 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -114,7 +114,7 @@ static void deformVerts( modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ - + lattice_deform_verts(lmd->object, ob, derivedData, vertexCos, numVerts, lmd->name, lmd->strength); } diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index 326ff707225..25db2d5ff0b 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -77,7 +77,7 @@ static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContex if (mmd->ob_arm) { bArmature *arm = (bArmature *)mmd->ob_arm->data; DagNode *armNode = dag_get_node(ctx->forest, mmd->ob_arm); - + /* tag relationship in depsgraph, but also on the armature */ dag_add_relation(ctx->forest, armNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Mask Modifier"); arm->flag |= ARM_HAS_VIZ_DEPS; @@ -129,17 +129,17 @@ static DerivedMesh *applyModifier( } /* Overview of Method: - * 1. Get the vertices that are in the vertexgroup of interest + * 1. Get the vertices that are in the vertexgroup of interest * 2. Filter out unwanted geometry (i.e. not in vertexgroup), by populating mappings with new vs old indices * 3. Make a new mesh containing only the mapping data */ - + /* get original number of verts, edges, and faces */ maxVerts = dm->getNumVerts(dm); maxEdges = dm->getNumEdges(dm); maxPolys = dm->getNumPolys(dm); - - /* check if we can just return the original mesh + + /* check if we can just return the original mesh * - must have verts and therefore verts assigned to vgroups to do anything useful */ if (!(ELEM(mmd->mode, MOD_MASK_MODE_ARM, MOD_MASK_MODE_VGROUP)) || @@ -147,7 +147,7 @@ static DerivedMesh *applyModifier( { return dm; } - + /* if mode is to use selected armature bones, aggregate the bone groups */ if (mmd->mode == MOD_MASK_MODE_ARM) { /* --- using selected bones --- */ Object *oba = mmd->ob_arm; @@ -156,17 +156,17 @@ static DerivedMesh *applyModifier( bool *bone_select_array; int bone_select_tot = 0; const int defbase_tot = BLI_listbase_count(&ob->defbase); - + /* check that there is armature object with bones to use, otherwise return original mesh */ if (ELEM(NULL, oba, oba->pose, ob->defbase.first)) return dm; - - /* determine whether each vertexgroup is associated with a selected bone or not + + /* determine whether each vertexgroup is associated with a selected bone or not * - each cell is a boolean saying whether bone corresponding to the ith group is selected * - groups that don't match a bone are treated as not existing (along with the corresponding ungrouped verts) */ bone_select_array = MEM_malloc_arrayN((size_t)defbase_tot, sizeof(char), "mask array"); - + for (i = 0, def = ob->defbase.first; def; def = def->next, i++) { pchan = BKE_pose_channel_find_name(oba->pose, def->name); if (pchan && pchan->bone && (pchan->bone->flag & BONE_SELECTED)) { @@ -182,8 +182,8 @@ static DerivedMesh *applyModifier( * key = oldindex, value = newindex */ vertHash = BLI_ghash_int_new_ex("mask vert gh", (unsigned int)maxVerts); - - /* add vertices which exist in vertexgroups into vertHash for filtering + + /* add vertices which exist in vertexgroups into vertHash for filtering * - dv = for each vertex, what vertexgroups does it belong to * - dw = weight that vertex was assigned to a vertexgroup it belongs to */ @@ -191,7 +191,7 @@ static DerivedMesh *applyModifier( MDeformWeight *dw = dv->dw; bool found = false; int j; - + /* check the groups that vertex is assigned to, and see if it was any use */ for (j = 0; j < dv->totweight; j++, dw++) { if (dw->def_nr < defbase_tot) { @@ -203,16 +203,16 @@ static DerivedMesh *applyModifier( } } } - + if (found_test != found) { continue; } - + /* add to ghash for verts (numVerts acts as counter for mapping) */ BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numVerts)); numVerts++; } - + /* free temp hashes */ MEM_freeN(bone_select_array); } @@ -222,10 +222,10 @@ static DerivedMesh *applyModifier( /* if no vgroup (i.e. dverts) found, return the initial mesh */ if (defgrp_index == -1) return dm; - + /* hashes for quickly providing a mapping from old to new - use key=oldindex, value=newindex */ vertHash = BLI_ghash_int_new_ex("mask vert2 bh", (unsigned int)maxVerts); - + /* add vertices which exist in vertexgroup into ghash for filtering */ for (i = 0, dv = dvert; i < maxVerts; i++, dv++) { const bool found = defvert_find_weight(dv, defgrp_index) != 0.0f; @@ -251,12 +251,12 @@ static DerivedMesh *applyModifier( /* overalloc, assume all polys are seen */ loop_mapping = MEM_malloc_arrayN((size_t)maxPolys, sizeof(int), "mask loopmap"); - /* loop over edges and faces, and do the same thing to - * ensure that they only reference existing verts + /* loop over edges and faces, and do the same thing to + * ensure that they only reference existing verts */ for (i = 0; i < maxEdges; i++) { const MEdge *me = &medge_src[i]; - + /* only add if both verts will be in new mesh */ if (BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v1)) && BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v2))) @@ -270,14 +270,14 @@ static DerivedMesh *applyModifier( const MLoop *ml_src = &mloop_src[mp_src->loopstart]; bool ok = true; int j; - + for (j = 0; j < mp_src->totloop; j++, ml_src++) { if (!BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(ml_src->v))) { ok = false; break; } } - + /* all verts must be available */ if (ok) { BLI_ghash_insert(polyHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numPolys)); @@ -286,13 +286,13 @@ static DerivedMesh *applyModifier( numLoops += mp_src->totloop; } } - - - /* now we know the number of verts, edges and faces, + + + /* now we know the number of verts, edges and faces, * we can create the new (reduced) mesh */ result = CDDM_from_template(dm, numVerts, numEdges, 0, numLoops, numPolys); - + mpoly_dst = CDDM_get_polys(result); mloop_dst = CDDM_get_loops(result); medge_dst = CDDM_get_edges(result); @@ -305,21 +305,21 @@ static DerivedMesh *applyModifier( MVert *v_dst; const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter)); const int i_dst = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)); - + v_src = &mvert_src[i_src]; v_dst = &mvert_dst[i_dst]; *v_dst = *v_src; DM_copy_vert_data(dm, result, i_src, i_dst, 1); } - + /* edges */ GHASH_ITER (gh_iter, edgeHash) { const MEdge *e_src; MEdge *e_dst; const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter)); const int i_dst = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)); - + e_src = &medge_src[i_src]; e_dst = &medge_dst[i_dst]; @@ -328,7 +328,7 @@ static DerivedMesh *applyModifier( e_dst->v1 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src->v1))); e_dst->v2 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src->v2))); } - + /* faces */ GHASH_ITER (gh_iter, polyHash) { const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter)); @@ -339,7 +339,7 @@ static DerivedMesh *applyModifier( const int i_ml_dst = loop_mapping[i_dst]; const MLoop *ml_src = &mloop_src[i_ml_src]; MLoop *ml_dst = &mloop_dst[i_ml_dst]; - + DM_copy_poly_data(dm, result, i_src, i_dst, 1); DM_copy_loop_data(dm, result, i_ml_src, i_ml_dst, mp_src->totloop); @@ -356,7 +356,7 @@ static DerivedMesh *applyModifier( /* why is this needed? - campbell */ /* recalculate normals */ result->dirty |= DM_DIRTY_NORMALS; - + /* free hashes */ BLI_ghash_free(vertHash, NULL, NULL); BLI_ghash_free(edgeHash, NULL, NULL); diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index c45f778f2db..39a6e9029b4 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -96,7 +96,7 @@ static void copyData(const ModifierData *md, ModifierData *target) } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) -{ +{ MeshDeformModifierData *mmd = (MeshDeformModifierData *)md; CustomDataMask dataMask = 0; @@ -327,7 +327,7 @@ static void meshdeformModifier_do( if (cagedm) cagedm->needsFree = 1; } - + if (!cagedm) { modifier_setError(md, "Cannot get mesh from cage object"); return; @@ -465,7 +465,7 @@ void modifier_mdef_compact_influences(ModifierData *md) weights = mmd->bindweights; if (!weights) return; - + totvert = mmd->totvert; totcagevert = mmd->totcagevert; @@ -511,7 +511,7 @@ void modifier_mdef_compact_influences(ModifierData *md) } mmd->bindoffsets[b] = totinfluence; - + /* free */ MEM_freeN(mmd->bindweights); mmd->bindweights = NULL; diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 23ee6379dee..3f6480562d9 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -200,7 +200,7 @@ static DerivedMesh *doMirrorOnAxis( vtmap_b++; } } - + /* handle shape keys */ totshape = CustomData_number_of_layers(&result->vertData, CD_SHAPEKEY); for (a = 0; a < totshape; a++) { @@ -209,14 +209,14 @@ static DerivedMesh *doMirrorOnAxis( mul_m4_v3(mtx, cos[i]); } } - + /* adjust mirrored edge vertex indices */ me = CDDM_get_edges(result) + maxEdges; for (i = 0; i < maxEdges; i++, me++) { me->v1 += maxVerts; me->v2 += maxVerts; } - + /* adjust mirrored poly loopstart indices, and reverse loop order (normals) */ mp = CDDM_get_polys(result) + maxPolys; ml = CDDM_get_loops(result); @@ -236,7 +236,7 @@ static DerivedMesh *doMirrorOnAxis( ml2[j].e = ml2[j + 1].e; } ml2[mp->totloop - 1].e = e; - + mp->loopstart += maxLoops; } @@ -274,7 +274,7 @@ static DerivedMesh *doMirrorOnAxis( int *flip_map = NULL, flip_map_len = 0; flip_map = defgroup_flip_map(ob, &flip_map_len, false); - + if (flip_map) { for (i = 0; i < maxVerts; dvert++, i++) { /* merged vertices get both groups, others get flipped */ @@ -336,7 +336,7 @@ static DerivedMesh *applyModifier( if (result != derivedData) result->dirty |= DM_DIRTY_NORMALS; - + return result; } diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index 183881d7d02..cdbacac97b9 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -93,17 +93,17 @@ static DerivedMesh *applyModifier( if (useRenderParams || !(flag & MOD_APPLY_USECACHE)) { DerivedMesh *cddm; - + cddm = CDDM_copy(result); /* copy hidden/masks to vertices */ if (!useRenderParams) { struct MDisps *mdisps; struct GridPaintMask *grid_paint_mask; - + mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS); grid_paint_mask = CustomData_get_layer(&me->ldata, CD_GRID_PAINT_MASK); - + if (mdisps) { subsurf_copy_grid_hidden(result, me->mpoly, cddm->getVertArray(cddm), diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c index 04aec23e38c..80b6c16b382 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.c +++ b/source/blender/modifiers/intern/MOD_particlesystem.c @@ -49,7 +49,7 @@ #include "MOD_util.h" -static void initData(ModifierData *md) +static void initData(ModifierData *md) { ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md; psmd->psys = NULL; @@ -117,7 +117,7 @@ static void deformVerts( psys = psmd->psys; else return; - + if (!psys_check_enabled(ob, psys, (flag & MOD_APPLY_RENDER) != 0)) return; diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c index cfe99c9a91b..bd25f2cc727 100644 --- a/source/blender/modifiers/intern/MOD_remesh.c +++ b/source/blender/modifiers/intern/MOD_remesh.c @@ -96,7 +96,7 @@ static void *dualcon_alloc_output(int totvert, int totquad) { return NULL; } - + output->dm = CDDM_new(totvert, 0, 0, 4 * totquad, totquad); return output; } @@ -105,9 +105,9 @@ static void dualcon_add_vert(void *output_v, const float co[3]) { DualConOutput *output = output_v; DerivedMesh *dm = output->dm; - + assert(output->curvert < dm->getNumVerts(dm)); - + copy_v3_v3(CDDM_get_verts(dm)[output->curvert].co, co); output->curvert++; } @@ -119,17 +119,17 @@ static void dualcon_add_quad(void *output_v, const int vert_indices[4]) MLoop *mloop; MPoly *cur_poly; int i; - + assert(output->curface < dm->getNumPolys(dm)); mloop = CDDM_get_loops(dm); cur_poly = CDDM_get_poly(dm, output->curface); - + cur_poly->loopstart = output->curface * 4; cur_poly->totloop = 4; for (i = 0; i < 4; i++) mloop[output->curface * 4 + i].v = vert_indices[i]; - + output->curface++; } @@ -164,7 +164,7 @@ static DerivedMesh *applyModifier( mode = DUALCON_SHARP_FEATURES; break; } - + output = dualcon(&input, dualcon_alloc_output, dualcon_add_vert, @@ -181,7 +181,7 @@ static DerivedMesh *applyModifier( if (rmd->flag & MOD_REMESH_SMOOTH_SHADING) { MPoly *mpoly = CDDM_get_polys(result); int i, totpoly = result->getNumPolys(result); - + /* Apply smooth shading to output faces */ for (i = 0; i < totpoly; i++) { mpoly[i].flag |= ME_SMOOTH; diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 882dcb79462..5c1296d222e 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -89,7 +89,7 @@ static void screwvert_iter_init(ScrewVertIter *iter, ScrewVertConnect *array, un iter->v_poin = NULL; iter->e = NULL; } -} +} static void screwvert_iter_step(ScrewVertIter *iter) @@ -185,7 +185,7 @@ static DerivedMesh *applyModifier( DerivedMesh *result; ScrewModifierData *ltmd = (ScrewModifierData *) md; const bool use_render_params = (flag & MOD_APPLY_RENDER) != 0; - + int *origindex; int mpoly_index = 0; unsigned int step; @@ -228,18 +228,18 @@ static DerivedMesh *applyModifier( float angle = ltmd->angle; float screw_ofs = ltmd->screw_ofs; float axis_vec[3] = {0.0f, 0.0f, 0.0f}; - float tmp_vec1[3], tmp_vec2[3]; + float tmp_vec1[3], tmp_vec2[3]; float mat3[3][3]; float mtx_tx[4][4]; /* transform the coords by an object relative to this objects transformation */ float mtx_tx_inv[4][4]; /* inverted */ float mtx_tmp_a[4][4]; - + unsigned int vc_tot_linked = 0; short other_axis_1, other_axis_2; const float *tmpf1, *tmpf2; unsigned int edge_offset; - + MPoly *mpoly_orig, *mpoly_new, *mp_new; MLoop *mloop_orig, *mloop_new, *ml_new; MEdge *medge_orig, *med_orig, *med_new, *med_new_firstloop, *medge_new; @@ -354,7 +354,7 @@ static DerivedMesh *applyModifier( close = 1; step_tot--; if (step_tot < 3) step_tot = 3; - + maxVerts = totvert * step_tot; /* -1 because we're joining back up */ maxEdges = (totvert * step_tot) + /* these are the edges between new verts */ (totedge * step_tot); /* -1 because vert edges join */ @@ -375,13 +375,13 @@ static DerivedMesh *applyModifier( if ((ltmd->flag & MOD_SCREW_UV_STRETCH_U) == 0) { uv_u_scale = (uv_u_scale / (float)ltmd->iter) * (angle / ((float)M_PI * 2.0f)); } - + result = CDDM_from_template(dm, (int)maxVerts, (int)maxEdges, 0, (int)maxPolys * 4, (int)maxPolys); - + /* copy verts from mesh */ mvert_orig = dm->getVertArray(dm); medge_orig = dm->getEdgeArray(dm); - + mvert_new = result->getVertArray(result); mpoly_new = result->getPolyArray(result); mloop_new = result->getLoopArray(result); @@ -421,10 +421,10 @@ static DerivedMesh *applyModifier( } /* Set the locations of the first set of verts */ - + mv_new = mvert_new; mv_orig = mvert_orig; - + /* Copy the first set of edges */ med_orig = medge_orig; med_new = medge_new; @@ -434,7 +434,7 @@ static DerivedMesh *applyModifier( med_new->crease = med_orig->crease; med_new->flag = med_orig->flag & ~ME_LOOSEEDGE; } - + /* build polygon -> edge map */ if (totpoly) { MPoly *mp_orig; @@ -829,7 +829,7 @@ static DerivedMesh *applyModifier( } } /* done with edge connectivity based normal flipping */ - + /* Add Faces */ for (step = 1; step < step_tot; step++) { const unsigned int varray_stride = totvert * step; @@ -852,10 +852,10 @@ static DerivedMesh *applyModifier( /* copy a slice */ DM_copy_vert_data(dm, result, 0, (int)varray_stride, (int)totvert); - + mv_new_base = mvert_new; mv_new = &mvert_new[varray_stride]; /* advance to the next slice */ - + for (j = 0; j < totvert; j++, mv_new_base++, mv_new++) { /* set normal */ if (vert_connect) { @@ -864,13 +864,13 @@ static DerivedMesh *applyModifier( /* set the normal now its transformed */ normal_float_to_short_v3(mv_new->no, nor_tx); } - + /* set location */ copy_v3_v3(mv_new->co, mv_new_base->co); - + /* only need to set these if using non cleared memory */ /*mv_new->mat_nr = mv_new->flag = 0;*/ - + if (ltmd->ob_axis) { sub_v3_v3(mv_new->co, mtx_tx[3]); @@ -881,7 +881,7 @@ static DerivedMesh *applyModifier( else { mul_m4_v3(mat, mv_new->co); } - + /* add the new edge */ med_new->v1 = varray_stride + j; med_new->v2 = med_new->v1 - totvert; @@ -907,11 +907,11 @@ static DerivedMesh *applyModifier( med_new++; } } - + mp_new = mpoly_new; ml_new = mloop_new; med_new_firstloop = medge_new; - + /* more of an offset in this case */ edge_offset = totedge + (totvert * (step_tot - (close ? 0 : 1))); @@ -1048,7 +1048,7 @@ static DerivedMesh *applyModifier( ml_new += 4; mpoly_index++; } - + /* new vertical edge */ med_new->v1 = i1; med_new->v2 = i2; diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index 1925bb23971..c30be7d3a11 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -168,7 +168,7 @@ static bool dependsOnNormals(ModifierData *md) if (smd->target && smd->shrinkType == MOD_SHRINKWRAP_PROJECT) return (smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL); - + return false; } diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 9fe1dad1fff..13e8f232b78 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -268,7 +268,7 @@ static bool build_hull(SkinOutput *so, Frame **frames, int totframe) BMO_ITER (v, &oiter, op.slots_out, "geom_interior.out", BM_VERT) { for (i = 0; i < totframe; i++) { Frame *frame = frames[i]; - + if (!frame->detached) { for (j = 0; j < 4; j++) { if (frame->verts[j] == v) { @@ -294,7 +294,7 @@ static bool build_hull(SkinOutput *so, Frame **frames, int totframe) frame->detached = true; } } - + /* Remove triangles that would fill the original frames -- skip if * frame is partially detached */ BM_mesh_elem_hflag_disable_all(bm, BM_ALL_NOLOOP, BM_ELEM_TAG, false); @@ -449,7 +449,7 @@ static void node_frames_init(SkinNode *nf, int totframe) nf->totframe = totframe; memset(nf->frames, 0, sizeof(nf->frames)); - + nf->flag = 0; for (i = 0; i < 2; i++) nf->seam_edges[i] = -1; @@ -465,7 +465,7 @@ static void create_frame( mul_v3_v3fl(ry, mat[1], radius[0]); mul_v3_v3fl(rz, mat[2], radius[1]); - + add_v3_v3v3(frame->co[3], co, ry); add_v3_v3v3(frame->co[3], frame->co[3], rz); @@ -680,7 +680,7 @@ static void build_emats_stack( /* Mark edge as visited */ BLI_BITMAP_ENABLE(visited_e, e); - + /* Process edge */ parent_is_branch = ((emap[parent_v].count > 2) || @@ -937,14 +937,14 @@ static DerivedMesh *subdivide_base(DerivedMesh *orig) /* Interpolate vertex group weights */ for (k = 0; k < totvgroup; k++) { float weight; - + vg = &vgroups[k]; weight = interpf(vg->w2, vg->w1, t); if (weight > 0) defvert_add_index_notest(&outdvert[v], vg->def_nr, weight); } - + outedge->v1 = u; outedge->v2 = v; u = v; @@ -952,7 +952,7 @@ static DerivedMesh *subdivide_base(DerivedMesh *orig) if (vgroups) MEM_freeN(vgroups); - + /* Link up to final vertex */ outedge->v1 = u; outedge->v2 = e->v2; @@ -976,7 +976,7 @@ static void add_poly( { BMVert *verts[4] = {v1, v2, v3, v4}; BMFace *f; - + BLI_assert(v1 != v2 && v1 != v3 && v1 != v4); BLI_assert(v2 != v3 && v2 != v4); BLI_assert(v3 != v4); @@ -1063,7 +1063,7 @@ static void output_frames( dv = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_MDEFORMVERT); - + BLI_assert(dv->totweight == 0); defvert_copy(dv, input_dvert); } @@ -1093,14 +1093,14 @@ static int isect_ray_poly(const float ray_start[3], BMIter iter; float best_dist = FLT_MAX; bool hit = false; - + BM_ITER_ELEM (v, &iter, f, BM_VERTS_OF_FACE) { if (!v_first) v_first = v; else if (v_prev != v_first) { float dist; bool curhit; - + curhit = isect_ray_tri_v3(ray_start, ray_dir, v_first->co, v_prev->co, v->co, &dist, NULL); @@ -1161,7 +1161,7 @@ static BMFace *collapse_face_corners(BMesh *bm, BMFace *f, int n, f = NULL; BM_ITER_ELEM (vf, &iter, v_safe, BM_FACES_OF_VERT) { bool wrong_face = false; - + for (i = 0; i < orig_len; i++) { if (orig_verts[i] == v_merge) { orig_verts[i] = NULL; @@ -1259,7 +1259,7 @@ static void skin_choose_quad_bridge_order(BMVert *a[4], BMVert *b[4], shortest_len = FLT_MAX; for (i = 0; i < 8; i++) { float len = 0; - + /* Get total edge length for this configuration */ for (j = 0; j < 4; j++) len += len_squared_v3v3(a[j]->co, b[orders[i][j]]->co); @@ -1307,7 +1307,7 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f /* Need at least four ring edges, so subdivide longest edge if * face is a triangle */ longest_edge = BM_face_find_longest_loop(split_face)->e; - + BM_mesh_elem_hflag_disable_all(bm, BM_EDGE, BM_ELEM_TAG, false); BM_elem_flag_enable(longest_edge, BM_ELEM_TAG); @@ -1513,7 +1513,7 @@ static void skin_merge_close_frame_verts(SkinNode *skin_nodes, int totvert, { Frame **hull_frames; int v, tothullframe; - + for (v = 0; v < totvert; v++) { /* Only check branch nodes */ if (!skin_nodes[v].totframe) { @@ -1529,11 +1529,11 @@ static void skin_merge_close_frame_verts(SkinNode *skin_nodes, int totvert, static void skin_update_merged_vertices(SkinNode *skin_nodes, int totvert) { int v; - + for (v = 0; v < totvert; ++v) { SkinNode *sn = &skin_nodes[v]; int i, j; - + for (i = 0; i < sn->totframe; i++) { Frame *f = &sn->frames[i]; @@ -1553,19 +1553,19 @@ static void skin_fix_hull_topology(BMesh *bm, SkinNode *skin_nodes, int totvert) { int v; - + for (v = 0; v < totvert; v++) { SkinNode *sn = &skin_nodes[v]; int j; - + for (j = 0; j < sn->totframe; j++) { Frame *f = &sn->frames[j]; if (f->detached) { BMFace *target_face; - + skin_hole_detach_partially_attached_frame(bm, f); - + target_face = skin_hole_target_face(bm, f); if (target_face) skin_fix_hole_no_good_verts(bm, f, target_face); @@ -1578,14 +1578,14 @@ static void skin_output_end_nodes(SkinOutput *so, SkinNode *skin_nodes, int totvert) { int v; - + for (v = 0; v < totvert; ++v) { SkinNode *sn = &skin_nodes[v]; /* Assuming here just two frames */ if (sn->flag & SEAM_FRAME) { BMVert *v_order[4]; int i, order[4]; - + skin_choose_quad_bridge_order(sn->frames[0].verts, sn->frames[1].verts, order); @@ -1630,7 +1630,7 @@ static void skin_output_connections(SkinOutput *so, SkinNode *skin_nodes, int totedge) { int e; - + for (e = 0; e < totedge; e++) { SkinNode *a, *b; a = &skin_nodes[medge[e].v1]; @@ -1646,7 +1646,7 @@ static void skin_output_connections(SkinOutput *so, SkinNode *skin_nodes, fr[0]++; if ((b->flag & SEAM_FRAME) && (e != b->seam_edges[0])) fr[1]++; - + skin_choose_quad_bridge_order(fr[0]->verts, fr[1]->verts, order); for (i = 0; i < 4; i++) v_order[i] = fr[1]->verts[order[i]]; @@ -1729,15 +1729,15 @@ static bool skin_output_branch_hulls(SkinOutput *so, SkinNode *skin_nodes, { bool result = true; int v; - + for (v = 0; v < totvert; v++) { SkinNode *sn = &skin_nodes[v]; - + /* Branch node hulls */ if (!sn->totframe) { Frame **hull_frames; int tothullframe; - + hull_frames = collect_hull_frames(v, skin_nodes, emap, medge, &tothullframe); @@ -1765,7 +1765,7 @@ static BMesh *build_skin(SkinNode *skin_nodes, &bm_mesh_allocsize_default, &((struct BMeshCreateParams){.use_toolflags = true,})); so.mat_nr = 0; - + /* BMESH_TODO: bumping up the stack level (see MOD_array.c) */ BM_mesh_elem_toolflags_ensure(so.bm); BMO_push(so.bm, NULL); @@ -1878,7 +1878,7 @@ static DerivedMesh *base_skin(DerivedMesh *origdm, if (!bm) return NULL; - + result = CDDM_from_bmesh(bm, false); BM_mesh_free(bm); @@ -1912,7 +1912,7 @@ static DerivedMesh *final_skin(SkinModifierData *smd, static void initData(ModifierData *md) { SkinModifierData *smd = (SkinModifierData *) md; - + /* Enable in editmode by default */ md->mode |= eModifierMode_Editmode; diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c index fb0648512d9..cd2a542efa9 100644 --- a/source/blender/modifiers/intern/MOD_smoke.c +++ b/source/blender/modifiers/intern/MOD_smoke.c @@ -57,10 +57,10 @@ #include "MOD_modifiertypes.h" -static void initData(ModifierData *md) +static void initData(ModifierData *md) { SmokeModifierData *smd = (SmokeModifierData *) md; - + smd->domain = NULL; smd->flow = NULL; smd->coll = NULL; @@ -72,14 +72,14 @@ static void copyData(const ModifierData *md, ModifierData *target) { const SmokeModifierData *smd = (const SmokeModifierData *)md; SmokeModifierData *tsmd = (SmokeModifierData *)target; - + smokeModifier_copy(smd, tsmd); } static void freeData(ModifierData *md) { SmokeModifierData *smd = (SmokeModifierData *) md; - + smokeModifier_free(smd); } diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index d2a086b5ff1..5aa38e2c693 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -164,7 +164,7 @@ static void smoothModifier_do( /* fp is the sum of uctmp[i] verts, so must be averaged */ facw = 0.0f; - if (uctmp[i]) + if (uctmp[i]) facw = f / (float)uctmp[i]; if (flag & MOD_SMOOTH_X) @@ -185,7 +185,7 @@ static void smoothModifier_do( /* fp is the sum of uctmp[i] verts, so must be averaged */ facw = 0.0f; - if (uctmp[i]) + if (uctmp[i]) facw = fac / (float)uctmp[i]; if (flag & MOD_SMOOTH_X) diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index cd65112fd1a..a64e05ffe1e 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -49,10 +49,10 @@ #include "MEM_guardedalloc.h" -static void initData(ModifierData *md) +static void initData(ModifierData *md) { SurfaceModifierData *surmd = (SurfaceModifierData *) md; - + surmd->bvhtree = NULL; } @@ -72,7 +72,7 @@ static void freeData(ModifierData *md) } MEM_SAFE_FREE(surmd->x); - + MEM_SAFE_FREE(surmd->v); } } @@ -90,14 +90,14 @@ static void deformVerts( ModifierApplyFlag UNUSED(flag)) { SurfaceModifierData *surmd = (SurfaceModifierData *) md; - + if (surmd->dm) surmd->dm->release(surmd->dm); /* if possible use/create DerivedMesh */ if (derivedData) surmd->dm = CDDM_copy(derivedData); else surmd->dm = get_dm(ob, NULL, NULL, NULL, false, false); - + if (!ob->pd) { printf("SurfaceModifier deformVerts: Should not happen!\n"); return; @@ -111,7 +111,7 @@ static void deformVerts( CDDM_apply_vert_coords(surmd->dm, vertexCos); CDDM_calc_normals(surmd->dm); - + numverts = surmd->dm->getNumVerts(surmd->dm); if (numverts != surmd->numverts || @@ -145,7 +145,7 @@ static void deformVerts( v->co[0] = v->co[1] = v->co[2] = 0.0f; else sub_v3_v3v3(v->co, vec, x->co); - + copy_v3_v3(x->co, vec); } diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index a271d0baa91..3694428d62d 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -186,7 +186,7 @@ DerivedMesh *get_dm( CDDM_apply_vert_coords(dm, vertexCos); dm->dirty |= DM_DIRTY_NORMALS; } - + if (use_orco) { DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, BKE_mesh_orco_verts_get(ob)); } diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index aa03be527be..1089eb1bea4 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -177,7 +177,7 @@ static DerivedMesh *uvprojectModifier_do( projectors[i].uci = NULL; if (projectors[i].ob->type == OB_CAMERA) { - + cam = (Camera *)projectors[i].ob->data; if (cam->type == CAM_PANO) { projectors[i].uci = BLI_uvproject_camera_info(projectors[i].ob, NULL, aspx, aspy); @@ -241,7 +241,7 @@ static DerivedMesh *uvprojectModifier_do( /* convert coords to world space */ for (i = 0, co = coords; i < numVerts; ++i, ++co) mul_m4_v3(ob->obmat, *co); - + /* if only one projector, project coords to UVs */ if (num_projectors == 1 && projectors[0].uci == NULL) for (i = 0, co = coords; i < numVerts; ++i, ++co) @@ -322,7 +322,7 @@ static DerivedMesh *uvprojectModifier_do( } MEM_freeN(coords); - + if (free_uci) { int j; for (j = 0; j < num_projectors; ++j) { diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 584c68756c1..47db0a3371f 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -227,7 +227,7 @@ static void get_vert2ob_distance( */ static float get_ob2ob_distance(const Object *ob, const Object *obr) { - return len_v3v3(ob->obmat[3], obr->obmat[3]); + return len_v3v3(ob->obmat[3], obr->obmat[3]); } /** -- cgit v1.2.3