diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-09-30 13:15:18 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-09-30 13:15:18 +0300 |
commit | 70a40ff65a6dd017b609f57bdc5e0e8022964e77 (patch) | |
tree | 99ffe8428f9ff3d49dafedc4307454e227dd63f7 /source | |
parent | 6a4ca1e5c0a08806a4b5bbe4a68dfafff0104ae7 (diff) |
Cleanup: Naming in EditNormals modifier
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/modifiers/intern/MOD_normal_edit.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c index ffe5e6aa7c7..454c97451a8 100644 --- a/source/blender/modifiers/intern/MOD_normal_edit.c +++ b/source/blender/modifiers/intern/MOD_normal_edit.c @@ -188,7 +188,7 @@ static bool polygons_check_flip( } static void normalEditModifier_do_radial( - NormalEditModifierData *smd, Object *ob, DerivedMesh *dm, + NormalEditModifierData *enmd, Object *ob, DerivedMesh *dm, short (*clnors)[2], float (*loopnors)[3], float (*polynors)[3], const short mix_mode, const float mix_factor, const float mix_limit, MDeformVert *dvert, const int defgrp_index, const bool use_invert_vgroup, @@ -203,7 +203,7 @@ static void normalEditModifier_do_radial( BLI_bitmap *done_verts = BLI_BITMAP_NEW((size_t)num_verts, __func__); - generate_vert_coordinates(dm, ob, smd->target, smd->offset, num_verts, cos, size); + generate_vert_coordinates(dm, ob, enmd->target, enmd->offset, num_verts, cos, size); /** * size gives us our spheroid coefficients ``(A, B, C)``. @@ -287,14 +287,14 @@ static void normalEditModifier_do_radial( } static void normalEditModifier_do_directional( - NormalEditModifierData *smd, Object *ob, DerivedMesh *dm, + NormalEditModifierData *enmd, Object *ob, DerivedMesh *dm, short (*clnors)[2], float (*loopnors)[3], float (*polynors)[3], const short mix_mode, const float mix_factor, const float mix_limit, MDeformVert *dvert, const int defgrp_index, const bool use_invert_vgroup, MVert *mvert, const int num_verts, MEdge *medge, const int num_edges, MLoop *mloop, const int num_loops, MPoly *mpoly, const int num_polys) { - const bool use_parallel_normals = (smd->flag & MOD_NORMALEDIT_USE_DIRECTION_PARALLEL) != 0; + const bool use_parallel_normals = (enmd->flag & MOD_NORMALEDIT_USE_DIRECTION_PARALLEL) != 0; float (*cos)[3] = MEM_mallocN(sizeof(*cos) * num_verts, __func__); float (*nos)[3] = MEM_mallocN(sizeof(*nos) * num_loops, __func__); @@ -309,14 +309,14 @@ static void normalEditModifier_do_directional( float mat[4][4]; invert_m4_m4(mat, ob->obmat); - mul_m4_m4m4(mat, mat, smd->target->obmat); + mul_m4_m4m4(mat, mat, enmd->target->obmat); copy_v3_v3(target_co, mat[3]); } if (use_parallel_normals) { float no[3]; - sub_v3_v3v3(no, target_co, smd->offset); + sub_v3_v3v3(no, target_co, enmd->offset); normalize_v3(no); for (i = num_loops; i--; ) { @@ -362,19 +362,19 @@ static void normalEditModifier_do_directional( MEM_freeN(nos); } -static bool is_valid_target(NormalEditModifierData *smd) +static bool is_valid_target(NormalEditModifierData *enmd) { - if (smd->mode == MOD_NORMALEDIT_MODE_RADIAL) { + if (enmd->mode == MOD_NORMALEDIT_MODE_RADIAL) { return true; } - else if ((smd->mode == MOD_NORMALEDIT_MODE_DIRECTIONAL) && smd->target) { + else if ((enmd->mode == MOD_NORMALEDIT_MODE_DIRECTIONAL) && enmd->target) { return true; } - modifier_setError((ModifierData *)smd, "Invalid target settings"); + modifier_setError((ModifierData *)enmd, "Invalid target settings"); return false; } -static DerivedMesh *normalEditModifier_do(NormalEditModifierData *smd, Object *ob, DerivedMesh *dm) +static DerivedMesh *normalEditModifier_do(NormalEditModifierData *enmd, Object *ob, DerivedMesh *dm) { Mesh *me = ob->data; @@ -387,11 +387,11 @@ static DerivedMesh *normalEditModifier_do(NormalEditModifierData *smd, Object *o MLoop *mloop; MPoly *mpoly; - const bool use_invert_vgroup = ((smd->flag & MOD_NORMALEDIT_INVERT_VGROUP) != 0); - const bool use_current_clnors = !((smd->mix_mode == MOD_NORMALEDIT_MIX_COPY) && - (smd->mix_factor == 1.0f) && - (smd->defgrp_name[0] == '\0') && - (smd->mix_limit == (float)M_PI)); + const bool use_invert_vgroup = ((enmd->flag & MOD_NORMALEDIT_INVERT_VGROUP) != 0); + const bool use_current_clnors = !((enmd->mix_mode == MOD_NORMALEDIT_MIX_COPY) && + (enmd->mix_factor == 1.0f) && + (enmd->defgrp_name[0] == '\0') && + (enmd->mix_limit == (float)M_PI)); int defgrp_index; MDeformVert *dvert; @@ -403,12 +403,12 @@ static DerivedMesh *normalEditModifier_do(NormalEditModifierData *smd, Object *o bool free_polynors = false; /* Do not run that modifier at all if autosmooth is disabled! */ - if (!is_valid_target(smd) || !num_loops) { + if (!is_valid_target(enmd) || !num_loops) { return dm; } if (!(me->flag & ME_AUTOSMOOTH)) { - modifier_setError((ModifierData *)smd, "Enable 'Auto Smooth' option in mesh settings"); + modifier_setError((ModifierData *)enmd, "Enable 'Auto Smooth' option in mesh settings"); return dm; } @@ -441,18 +441,18 @@ static DerivedMesh *normalEditModifier_do(NormalEditModifierData *smd, Object *o free_polynors = true; } - modifier_get_vgroup(ob, dm, smd->defgrp_name, &dvert, &defgrp_index); + modifier_get_vgroup(ob, dm, enmd->defgrp_name, &dvert, &defgrp_index); - if (smd->mode == MOD_NORMALEDIT_MODE_RADIAL) { + if (enmd->mode == MOD_NORMALEDIT_MODE_RADIAL) { normalEditModifier_do_radial( - smd, ob, dm, clnors, loopnors, polynors, - smd->mix_mode, smd->mix_factor, smd->mix_limit, dvert, defgrp_index, use_invert_vgroup, + enmd, ob, dm, clnors, loopnors, polynors, + enmd->mix_mode, enmd->mix_factor, enmd->mix_limit, dvert, defgrp_index, use_invert_vgroup, mvert, num_verts, medge, num_edges, mloop, num_loops, mpoly, num_polys); } - else if (smd->mode == MOD_NORMALEDIT_MODE_DIRECTIONAL) { + else if (enmd->mode == MOD_NORMALEDIT_MODE_DIRECTIONAL) { normalEditModifier_do_directional( - smd, ob, dm, clnors, loopnors, polynors, - smd->mix_mode, smd->mix_factor, smd->mix_limit, dvert, defgrp_index, use_invert_vgroup, + enmd, ob, dm, clnors, loopnors, polynors, + enmd->mix_mode, enmd->mix_factor, enmd->mix_limit, dvert, defgrp_index, use_invert_vgroup, mvert, num_verts, medge, num_edges, mloop, num_loops, mpoly, num_polys); } @@ -465,13 +465,13 @@ static DerivedMesh *normalEditModifier_do(NormalEditModifierData *smd, Object *o static void initData(ModifierData *md) { - NormalEditModifierData *smd = (NormalEditModifierData *)md; + NormalEditModifierData *enmd = (NormalEditModifierData *)md; - smd->mode = MOD_NORMALEDIT_MODE_RADIAL; + enmd->mode = MOD_NORMALEDIT_MODE_RADIAL; - smd->mix_mode = MOD_NORMALEDIT_MIX_COPY; - smd->mix_factor = 1.0f; - smd->mix_limit = M_PI; + enmd->mix_mode = MOD_NORMALEDIT_MIX_COPY; + enmd->mix_factor = 1.0f; + enmd->mix_limit = M_PI; } static void copyData(ModifierData *md, ModifierData *target) @@ -481,11 +481,11 @@ static void copyData(ModifierData *md, ModifierData *target) static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { - NormalEditModifierData *smd = (NormalEditModifierData *)md; + NormalEditModifierData *enmd = (NormalEditModifierData *)md; CustomDataMask dataMask = CD_CUSTOMLOOPNORMAL; /* Ask for vertexgroups if we need them. */ - if (smd->defgrp_name[0]) { + if (enmd->defgrp_name[0]) { dataMask |= (CD_MASK_MDEFORMVERT); } @@ -499,16 +499,16 @@ static bool dependsOnNormals(ModifierData *UNUSED(md)) static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData) { - NormalEditModifierData *smd = (NormalEditModifierData *) md; + NormalEditModifierData *enmd = (NormalEditModifierData *) md; - walk(userData, ob, &smd->target, IDWALK_NOP); + walk(userData, ob, &enmd->target, IDWALK_NOP); } static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { - NormalEditModifierData *smd = (NormalEditModifierData *)md; + NormalEditModifierData *enmd = (NormalEditModifierData *)md; - return !is_valid_target(smd); + return !is_valid_target(enmd); } static void updateDepgraph(ModifierData *md, DagForest *forest, @@ -516,10 +516,10 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UNUSED(scene), Object *UNUSED(ob), DagNode *obNode) { - NormalEditModifierData *smd = (NormalEditModifierData *) md; + NormalEditModifierData *enmd = (NormalEditModifierData *) md; - if (smd->target) { - DagNode *Node = dag_get_node(forest, smd->target); + if (enmd->target) { + DagNode *Node = dag_get_node(forest, enmd->target); dag_add_relation(forest, Node, obNode, DAG_RL_OB_DATA, "NormalEdit Modifier"); } @@ -531,9 +531,9 @@ static void updateDepsgraph(ModifierData *md, Object *UNUSED(ob), struct DepsNodeHandle *node) { - NormalEditModifierData *smd = (NormalEditModifierData *) md; - if (smd->target) { - DEG_add_object_relation(node, smd->target, DEG_OB_COMP_TRANSFORM, "NormalEdit Modifier"); + NormalEditModifierData *enmd = (NormalEditModifierData *) md; + if (enmd->target) { + DEG_add_object_relation(node, enmd->target, DEG_OB_COMP_TRANSFORM, "NormalEdit Modifier"); } } |