diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_surfacedeform.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_surfacedeform.c | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c index 14128b258b9..85347288872 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.c +++ b/source/blender/modifiers/intern/MOD_surfacedeform.c @@ -11,7 +11,7 @@ #include "BKE_library_query.h" #include "BKE_modifier.h" -#include "depsgraph_private.h" +#include "DEG_depsgraph.h" #include "MEM_guardedalloc.h" @@ -170,21 +170,6 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, walk(userData, ob, &smd->target, IDWALK_NOP); } -static void updateDepgraph(ModifierData *md, DagForest *forest, - struct Main *UNUSED(bmain), - struct Scene *UNUSED(scene), - Object *UNUSED(ob), - DagNode *obNode) -{ - SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md; - - if (smd->target) { - DagNode *curNode = dag_get_node(forest, smd->target); - - dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA, "Surface Deform Modifier"); - } -} - static void updateDepsgraph(ModifierData *md, struct Main *UNUSED(bmain), struct Scene *UNUSED(scene), @@ -1114,7 +1099,9 @@ static void deformVert( } } -static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], unsigned int numverts, Object *ob) +static void surfacedeformModifier_do( + ModifierData *md, const EvaluationContext *eval_ctx, + float (*vertexCos)[3], unsigned int numverts, Object *ob) { SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md; DerivedMesh *tdm; @@ -1127,7 +1114,7 @@ static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], un } /* Handle target mesh both in and out of edit mode */ - if (smd->target == md->scene->obedit) { + if (smd->target == OBEDIT_FROM_EVAL_CTX(eval_ctx)) { BMEditMesh *em = BKE_editmesh_from_object(smd->target); tdm = em->derivedFinal; } @@ -1197,20 +1184,22 @@ static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], un } } -static void deformVerts(ModifierData *md, Object *ob, - DerivedMesh *UNUSED(derivedData), - float (*vertexCos)[3], int numVerts, - ModifierApplyFlag UNUSED(flag)) +static void deformVerts( + ModifierData *md, const struct EvaluationContext *eval_ctx, + Object *ob, DerivedMesh *UNUSED(derivedData), + float (*vertexCos)[3], int numVerts, + ModifierApplyFlag UNUSED(flag)) { - surfacedeformModifier_do(md, vertexCos, numVerts, ob); + surfacedeformModifier_do(md, eval_ctx, vertexCos, numVerts, ob); } -static void deformVertsEM(ModifierData *md, Object *ob, - struct BMEditMesh *UNUSED(editData), - DerivedMesh *UNUSED(derivedData), - float (*vertexCos)[3], int numVerts) +static void deformVertsEM( + ModifierData *md, const struct EvaluationContext *eval_ctx, + Object *ob, struct BMEditMesh *UNUSED(editData), + DerivedMesh *UNUSED(derivedData), + float (*vertexCos)[3], int numVerts) { - surfacedeformModifier_do(md, vertexCos, numVerts, ob); + surfacedeformModifier_do(md, eval_ctx, vertexCos, numVerts, ob); } static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams)) @@ -1239,7 +1228,6 @@ ModifierTypeInfo modifierType_SurfaceDeform = { /* requiredDataMask */ NULL, /* freeData */ freeData, /* isDisabled */ isDisabled, - /* updateDepgraph */ updateDepgraph, /* updateDepsgraph */ updateDepsgraph, /* dependsOnTime */ NULL, /* dependsOnNormals */ NULL, |