diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-22 16:45:46 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-22 16:45:46 +0300 |
commit | c850fcc2c02bb8b15a4849284d24ab906a138cb5 (patch) | |
tree | e21438fe16127bb477a653351aa3bdf5738bd288 /source/blender | |
parent | 97c99fb034db3b25e8a3e6fca3ab1a232d8d5b43 (diff) |
Modifiers: port shapekey modifier, some cleanup.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/modifiers/intern/MOD_shapekey.c | 30 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_simpledeform.c | 1 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_solidify.c | 1 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_uvwarp.c | 24 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgproximity.c | 2 |
5 files changed, 28 insertions, 30 deletions
diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c index 90c339361b7..a6c7419da49 100644 --- a/source/blender/modifiers/intern/MOD_shapekey.c +++ b/source/blender/modifiers/intern/MOD_shapekey.c @@ -34,11 +34,11 @@ #include "BLI_math.h" +#include "DNA_mesh_types.h" #include "DNA_key_types.h" #include "BLI_utildefines.h" -#include "BKE_cdderivedmesh.h" #include "BKE_key.h" #include "BKE_particle.h" @@ -46,7 +46,7 @@ static void deformVerts( ModifierData *UNUSED(md), const ModifierEvalContext *ctx, - DerivedMesh *UNUSED(derivedData), + Mesh *UNUSED(mesh), float (*vertexCos)[3], int numVerts) { @@ -62,7 +62,7 @@ static void deformVerts( } static void deformMatrices( - ModifierData *md, const ModifierEvalContext *ctx, DerivedMesh *derivedData, + ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, float (*vertexCos)[3], float (*defMats)[3][3], int numVerts) { Key *key = BKE_key_from_object(ctx->object); @@ -81,26 +81,26 @@ static void deformMatrices( copy_m3_m3(defMats[a], scale); } - deformVerts(md, ctx, derivedData, vertexCos, numVerts); + deformVerts(md, ctx, mesh, vertexCos, numVerts); } static void deformVertsEM( ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *UNUSED(editData), - DerivedMesh *derivedData, + Mesh *mesh, float (*vertexCos)[3], int numVerts) { Key *key = BKE_key_from_object(ctx->object); if (key && key->type == KEY_RELATIVE) - deformVerts(md, ctx, derivedData, vertexCos, numVerts); + deformVerts(md, ctx, mesh, vertexCos, numVerts); } static void deformMatricesEM( ModifierData *UNUSED(md), const ModifierEvalContext *ctx, struct BMEditMesh *UNUSED(editData), - DerivedMesh *UNUSED(derivedData), + Mesh *UNUSED(mesh), float (*vertexCos)[3], float (*defMats)[3][3], int numVerts) @@ -132,17 +132,17 @@ ModifierTypeInfo modifierType_ShapeKey = { /* copyData */ NULL, - /* deformVerts_DM */ deformVerts, - /* deformMatrices_DM */ deformMatrices, - /* deformVertsEM_DM */ deformVertsEM, - /* deformMatricesEM_DM*/deformMatricesEM, + /* deformVerts_DM */ NULL, + /* deformMatrices_DM */ NULL, + /* deformVertsEM_DM */ NULL, + /* deformMatricesEM_DM*/NULL, /* applyModifier_DM */ NULL, /* applyModifierEM_DM */NULL, - /* deformVerts */ NULL, - /* deformMatrices */ NULL, - /* deformVertsEM */ NULL, - /* deformMatricesEM */ NULL, + /* deformVerts */ deformVerts, + /* deformMatrices */ deformMatrices, + /* deformVertsEM */ deformVertsEM, + /* deformMatricesEM */ deformMatricesEM, /* applyModifier */ NULL, /* applyModifierEM */ NULL, diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 3f62351bceb..22fe0bacf87 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -39,7 +39,6 @@ #include "BLI_math.h" #include "BLI_utildefines.h" -#include "BKE_cdderivedmesh.h" #include "BKE_editmesh.h" #include "BKE_mesh.h" #include "BKE_library.h" diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index b99b35bbb8e..180c25dcd84 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -40,7 +40,6 @@ #include "BLI_bitmap.h" #include "BLI_math.h" -#include "BKE_cdderivedmesh.h" #include "BKE_mesh.h" #include "BKE_particle.h" #include "BKE_deform.h" diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c b/source/blender/modifiers/intern/MOD_uvwarp.c index 8e79a035734..2b2d1709b15 100644 --- a/source/blender/modifiers/intern/MOD_uvwarp.c +++ b/source/blender/modifiers/intern/MOD_uvwarp.c @@ -140,7 +140,7 @@ static void uv_warp_compute( static Mesh *applyModifier( ModifierData *md, const ModifierEvalContext *ctx, - Mesh *me_eval) + Mesh *mesh) { UVWarpModifierData *umd = (UVWarpModifierData *) md; int numPolys, numLoops; @@ -158,12 +158,12 @@ static Mesh *applyModifier( const int axis_v = umd->axis_v; /* make sure there are UV Maps available */ - if (!CustomData_has_layer(&me_eval->ldata, CD_MLOOPUV)) { - return me_eval; + if (!CustomData_has_layer(&mesh->ldata, CD_MLOOPUV)) { + return mesh; } else if (ELEM(NULL, umd->object_src, umd->object_dst)) { modifier_setError(md, "From/To objects must be set"); - return me_eval; + return mesh; } /* make sure anything moving UVs is available */ @@ -189,16 +189,16 @@ static Mesh *applyModifier( } /* make sure we're using an existing layer */ - CustomData_validate_layer_name(&me_eval->ldata, CD_MLOOPUV, umd->uvlayer_name, uvname); + CustomData_validate_layer_name(&mesh->ldata, CD_MLOOPUV, umd->uvlayer_name, uvname); - numPolys = me_eval->totpoly; - numLoops = me_eval->totloop; + numPolys = mesh->totpoly; + numLoops = mesh->totloop; - mpoly = me_eval->mpoly; - mloop = me_eval->mloop; + mpoly = mesh->mpoly; + mloop = mesh->mloop; /* make sure we are not modifying the original UV map */ - mloopuv = CustomData_duplicate_referenced_layer_named(&me_eval->ldata, CD_MLOOPUV, uvname, numLoops); - modifier_get_vgroup_mesh(ctx->object, me_eval, umd->vgroup_name, &dvert, &defgrp_index); + mloopuv = CustomData_duplicate_referenced_layer_named(&mesh->ldata, CD_MLOOPUV, uvname, numLoops); + modifier_get_vgroup_mesh(ctx->object, mesh, umd->vgroup_name, &dvert, &defgrp_index); UVWarpData data = {.mpoly = mpoly, .mloop = mloop, .mloopuv = mloopuv, .dvert = dvert, .defgrp_index = defgrp_index, @@ -214,7 +214,7 @@ static Mesh *applyModifier( /* XXX TODO is this still needed? */ // me_eval->dirty |= DM_DIRTY_TESS_CDLAYERS; - return me_eval; + return mesh; } static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData) diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index c8cd4ab911b..88e33f28eaf 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -40,7 +40,7 @@ #include "DNA_modifier_types.h" #include "DNA_object_types.h" -#include "BKE_cdderivedmesh.h" +#include "BKE_bvhutils.h" #include "BKE_curve.h" #include "BKE_customdata.h" #include "BKE_deform.h" |