Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r--source/blender/modifiers/intern/MOD_armature.c25
-rw-r--r--source/blender/modifiers/intern/MOD_array.c55
-rw-r--r--source/blender/modifiers/intern/MOD_bevel.c5
-rw-r--r--source/blender/modifiers/intern/MOD_boolean.c17
-rw-r--r--source/blender/modifiers/intern/MOD_build.c5
-rw-r--r--source/blender/modifiers/intern/MOD_cast.c23
-rw-r--r--source/blender/modifiers/intern/MOD_cloth.c25
-rw-r--r--source/blender/modifiers/intern/MOD_collision.c5
-rw-r--r--source/blender/modifiers/intern/MOD_correctivesmooth.c5
-rw-r--r--source/blender/modifiers/intern/MOD_curve.c27
-rw-r--r--source/blender/modifiers/intern/MOD_datatransfer.c20
-rw-r--r--source/blender/modifiers/intern/MOD_decimate.c5
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c29
-rw-r--r--source/blender/modifiers/intern/MOD_dynamicpaint.c38
-rw-r--r--source/blender/modifiers/intern/MOD_edgesplit.c4
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c17
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim.c37
-rw-r--r--source/blender/modifiers/intern/MOD_hook.c21
-rw-r--r--source/blender/modifiers/intern/MOD_laplaciandeform.c5
-rw-r--r--source/blender/modifiers/intern/MOD_laplaciansmooth.c5
-rw-r--r--source/blender/modifiers/intern/MOD_lattice.c23
-rw-r--r--source/blender/modifiers/intern/MOD_mask.c20
-rw-r--r--source/blender/modifiers/intern/MOD_meshcache.c7
-rw-r--r--source/blender/modifiers/intern/MOD_meshdeform.c32
-rw-r--r--source/blender/modifiers/intern/MOD_meshsequencecache.c18
-rw-r--r--source/blender/modifiers/intern/MOD_mirror.c17
-rw-r--r--source/blender/modifiers/intern/MOD_multires.c9
-rw-r--r--source/blender/modifiers/intern/MOD_none.c1
-rw-r--r--source/blender/modifiers/intern/MOD_normal_edit.c17
-rw-r--r--source/blender/modifiers/intern/MOD_ocean.c6
-rw-r--r--source/blender/modifiers/intern/MOD_particleinstance.c21
-rw-r--r--source/blender/modifiers/intern/MOD_particlesystem.c7
-rw-r--r--source/blender/modifiers/intern/MOD_remesh.c6
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c20
-rw-r--r--source/blender/modifiers/intern/MOD_shapekey.c17
-rw-r--r--source/blender/modifiers/intern/MOD_shrinkwrap.c27
-rw-r--r--source/blender/modifiers/intern/MOD_simpledeform.c20
-rw-r--r--source/blender/modifiers/intern/MOD_skin.c2
-rw-r--r--source/blender/modifiers/intern/MOD_smoke.c30
-rw-r--r--source/blender/modifiers/intern/MOD_smooth.c5
-rw-r--r--source/blender/modifiers/intern/MOD_softbody.c24
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c5
-rw-r--r--source/blender/modifiers/intern/MOD_subsurf.c33
-rw-r--r--source/blender/modifiers/intern/MOD_surface.c5
-rw-r--r--source/blender/modifiers/intern/MOD_surfacedeform.c42
-rw-r--r--source/blender/modifiers/intern/MOD_triangulate.c2
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c49
-rw-r--r--source/blender/modifiers/intern/MOD_uvwarp.c28
-rw-r--r--source/blender/modifiers/intern/MOD_warp.c27
-rw-r--r--source/blender/modifiers/intern/MOD_wave.c42
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c24
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgmix.c23
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c29
-rw-r--r--source/blender/modifiers/intern/MOD_wireframe.c4
54 files changed, 234 insertions, 781 deletions
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index 22ec13cd0a0..f6640704a83 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -50,8 +50,6 @@
#include "MEM_guardedalloc.h"
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
@@ -99,18 +97,6 @@ static void foreachObjectLink(
walk(userData, ob, &amd->object, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- ArmatureModifierData *amd = (ArmatureModifierData *) md;
-
- if (amd->object) {
- DagNode *curNode = dag_get_node(ctx->forest, amd->object);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Armature Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
ArmatureModifierData *amd = (ArmatureModifierData *)md;
@@ -120,8 +106,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
}
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -141,7 +127,7 @@ static void deformVerts(ModifierData *md, Object *ob,
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *em,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *em,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
ArmatureModifierData *amd = (ArmatureModifierData *) md;
@@ -164,7 +150,7 @@ static void deformVertsEM(
}
static void deformMatricesEM(
- ModifierData *md, Object *ob, struct BMEditMesh *em,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *em,
DerivedMesh *derivedData, float (*vertexCos)[3],
float (*defMats)[3][3], int numVerts)
{
@@ -179,7 +165,7 @@ static void deformMatricesEM(
if (!derivedData) dm->release(dm);
}
-static void deformMatrices(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static void deformMatrices(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
{
ArmatureModifierData *amd = (ArmatureModifierData *) md;
@@ -213,7 +199,6 @@ ModifierTypeInfo modifierType_Armature = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index b781c47ac56..f598667f96d 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -55,13 +55,7 @@
#include "MOD_util.h"
-#include "depsgraph_private.h"
-
-/* Due to cyclic dependencies it's possible that curve used for
- * deformation here is not evaluated at the time of evaluating
- * this modifier.
- */
-#define CYCLIC_DEPENDENCY_WORKAROUND
+#include "DEG_depsgraph.h"
static void initData(ModifierData *md)
{
@@ -103,37 +97,6 @@ static void foreachObjectLink(
walk(userData, ob, &amd->offset_ob, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- ArrayModifierData *amd = (ArrayModifierData *) md;
-
- if (amd->start_cap) {
- DagNode *curNode = dag_get_node(ctx->forest, amd->start_cap);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier");
- }
- if (amd->end_cap) {
- DagNode *curNode = dag_get_node(ctx->forest, amd->end_cap);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier");
- }
- if (amd->curve_ob) {
- DagNode *curNode = dag_get_node(ctx->forest, amd->curve_ob);
- curNode->eval_flags |= DAG_EVAL_NEED_CURVE_PATH;
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier");
- }
- if (amd->offset_ob) {
- DagNode *curNode = dag_get_node(ctx->forest, amd->offset_ob);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
ArrayModifierData *amd = (ArrayModifierData *)md;
@@ -391,8 +354,7 @@ static void dm_merge_transform(
}
static DerivedMesh *arrayModifier_doArray(
- ArrayModifierData *amd,
- Scene *scene, Object *ob, DerivedMesh *dm,
+ ArrayModifierData *amd, Object *ob, DerivedMesh *dm,
ModifierApplyFlag flag)
{
const float eps = 1e-6f;
@@ -504,12 +466,6 @@ static DerivedMesh *arrayModifier_doArray(
if (amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) {
Curve *cu = amd->curve_ob->data;
if (cu) {
-#ifdef CYCLIC_DEPENDENCY_WORKAROUND
- if (amd->curve_ob->curve_cache == NULL) {
- BKE_displist_make_curveTypes(scene, amd->curve_ob, false);
- }
-#endif
-
if (amd->curve_ob->curve_cache && amd->curve_ob->curve_cache->path) {
float scale_fac = mat4_to_scale(amd->curve_ob->obmat);
length = scale_fac * amd->curve_ob->curve_cache->path->totdist;
@@ -798,12 +754,12 @@ static DerivedMesh *arrayModifier_doArray(
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *dm,
ModifierApplyFlag flag)
{
ArrayModifierData *amd = (ArrayModifierData *) md;
- return arrayModifier_doArray(amd, md->scene, ob, dm, flag);
+ return arrayModifier_doArray(amd, ob, dm, flag);
}
@@ -829,7 +785,6 @@ ModifierTypeInfo modifierType_Array = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c
index 93dc0203f83..35b8a3fd9cb 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -86,8 +86,8 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
/*
* This calls the new bevel code (added since 2.64)
*/
-static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
- DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ struct Object *ob, DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *result;
@@ -205,7 +205,6 @@ ModifierTypeInfo modifierType_Bevel = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ dependsOnNormals,
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index 93c4d83870a..c9d762a7fbe 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -45,8 +45,6 @@
#include "BKE_library_query.h"
#include "BKE_modifier.h"
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
@@ -97,18 +95,6 @@ static void foreachObjectLink(
walk(userData, ob, &bmd->object, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- BooleanModifierData *bmd = (BooleanModifierData *) md;
-
- if (bmd->object) {
- DagNode *curNode = dag_get_node(ctx->forest, bmd->object);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Boolean Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
BooleanModifierData *bmd = (BooleanModifierData *)md;
@@ -180,7 +166,7 @@ static int bm_face_isect_pair(BMFace *f, void *UNUSED(user_data))
}
static DerivedMesh *applyModifier(
- ModifierData *md, Object *ob,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob,
DerivedMesh *dm,
ModifierApplyFlag flag)
{
@@ -377,7 +363,6 @@ ModifierTypeInfo modifierType_Boolean = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c
index f71d14efb2b..2e0b13b0603 100644
--- a/source/blender/modifiers/intern/MOD_build.c
+++ b/source/blender/modifiers/intern/MOD_build.c
@@ -75,8 +75,8 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
return true;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *UNUSED(ob), DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm = derivedData;
@@ -324,7 +324,6 @@ ModifierTypeInfo modifierType_Build = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c
index 60465df0492..bf86377960a 100644
--- a/source/blender/modifiers/intern/MOD_cast.c
+++ b/source/blender/modifiers/intern/MOD_cast.c
@@ -45,9 +45,6 @@
#include "BKE_library_query.h"
#include "BKE_modifier.h"
-
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
static void initData(ModifierData *md)
@@ -105,18 +102,6 @@ static void foreachObjectLink(
walk(userData, ob, &cmd->object, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- CastModifierData *cmd = (CastModifierData *) md;
-
- if (cmd->object) {
- DagNode *curNode = dag_get_node(ctx->forest, cmd->object);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA,
- "Cast Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
CastModifierData *cmd = (CastModifierData *)md;
@@ -444,8 +429,8 @@ static void cuboid_do(
}
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -467,7 +452,8 @@ static void deformVerts(ModifierData *md, Object *ob,
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *editData,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = get_dm(ob, editData, derivedData, NULL, false, false);
@@ -505,7 +491,6 @@ ModifierTypeInfo modifierType_Cast = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index 2b181c0fb18..0c55d8f8beb 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -43,7 +43,6 @@
#include "BLI_utildefines.h"
-
#include "BKE_cloth.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_effect.h"
@@ -53,8 +52,6 @@
#include "BKE_modifier.h"
#include "BKE_pointcache.h"
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
static void initData(ModifierData *md)
@@ -72,7 +69,7 @@ static void initData(ModifierData *md)
cloth_init(clmd);
}
-static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3],
+static void deformVerts(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3],
int numVerts, ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm;
@@ -112,32 +109,17 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
CDDM_apply_vert_coords(dm, vertexCos);
- clothModifier_do(clmd, md->scene, ob, dm, vertexCos);
+ clothModifier_do(clmd, eval_ctx, md->scene, ob, dm, vertexCos);
dm->release(dm);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- ClothModifierData *clmd = (ClothModifierData *) md;
-
- if (clmd) {
- /* Actual code uses get_collisionobjects */
-#ifdef WITH_LEGACY_DEPSGRAPH
- dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, clmd->coll_parms->group, ctx->object->lay|ctx->scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
- dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
-#else
- (void)ctx;
-#endif
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
ClothModifierData *clmd = (ClothModifierData *)md;
if (clmd != NULL) {
/* Actual code uses get_collisionobjects */
- DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, clmd->coll_parms->group, ctx->object->lay|ctx->scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
+ DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, clmd->coll_parms->group, eModifierType_Collision, NULL, true, "Cloth Collision");
DEG_add_forcefield_relations(ctx->node, ctx->scene, ctx->object, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
}
@@ -253,7 +235,6 @@ ModifierTypeInfo modifierType_Cloth = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c
index 0a15799f61a..d2ecbaeaafe 100644
--- a/source/blender/modifiers/intern/MOD_collision.c
+++ b/source/blender/modifiers/intern/MOD_collision.c
@@ -98,8 +98,8 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
return true;
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int UNUSED(numVerts),
ModifierApplyFlag UNUSED(flag))
@@ -264,7 +264,6 @@ ModifierTypeInfo modifierType_Collision = {
/* requiredDataMask */ NULL,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c
index 08f4588df87..d95f0ae9286 100644
--- a/source/blender/modifiers/intern/MOD_correctivesmooth.c
+++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c
@@ -713,7 +713,7 @@ error:
static void deformVerts(
- ModifierData *md, Object *ob, DerivedMesh *derivedData,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, false, false);
@@ -727,7 +727,7 @@ static void deformVerts(
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *editData,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = get_dm(ob, editData, derivedData, NULL, false, false);
@@ -759,7 +759,6 @@ ModifierTypeInfo modifierType_CorrectiveSmooth = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c
index 7e16bf450fc..acb69de1e85 100644
--- a/source/blender/modifiers/intern/MOD_curve.c
+++ b/source/blender/modifiers/intern/MOD_curve.c
@@ -39,12 +39,13 @@
#include "BLI_utildefines.h"
+
#include "BKE_cdderivedmesh.h"
#include "BKE_lattice.h"
#include "BKE_library_query.h"
#include "BKE_modifier.h"
-#include "depsgraph_private.h"
+#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
@@ -92,19 +93,6 @@ static void foreachObjectLink(
walk(userData, ob, &cmd->object, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- CurveModifierData *cmd = (CurveModifierData *) md;
-
- if (cmd->object) {
- DagNode *curNode = dag_get_node(ctx->forest, cmd->object);
- curNode->eval_flags |= DAG_EVAL_NEED_CURVE_PATH;
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Curve Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
CurveModifierData *cmd = (CurveModifierData *)md;
@@ -123,8 +111,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Curve Modifier");
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -133,19 +121,19 @@ static void deformVerts(ModifierData *md, Object *ob,
/* silly that defaxis and curve_deform_verts are off by 1
* but leave for now to save having to call do_versions */
- curve_deform_verts(md->scene, cmd->object, ob, derivedData, vertexCos, numVerts,
+ curve_deform_verts(cmd->object, ob, derivedData, vertexCos, numVerts,
cmd->name, cmd->defaxis - 1);
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *em,
+ ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, struct BMEditMesh *em,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
- deformVerts(md, ob, dm, vertexCos, numVerts, 0);
+ deformVerts(md, eval_ctx, ob, dm, vertexCos, numVerts, 0);
if (!derivedData) dm->release(dm);
}
@@ -171,7 +159,6 @@ ModifierTypeInfo modifierType_Curve = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c
index d810978fb0b..a804a35954c 100644
--- a/source/blender/modifiers/intern/MOD_datatransfer.c
+++ b/source/blender/modifiers/intern/MOD_datatransfer.c
@@ -50,8 +50,6 @@
#include "MEM_guardedalloc.h"
#include "MOD_util.h"
-#include "depsgraph_private.h"
-
/**************************************
* Modifiers functions. *
**************************************/
@@ -127,19 +125,6 @@ static void foreachObjectLink(
walk(userData, ob, &dtmd->ob_source, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- DataTransferModifierData *dtmd = (DataTransferModifierData *) md;
- DagNode *curNode;
-
- if (dtmd->ob_source) {
- curNode = dag_get_node(ctx->forest, dtmd->ob_source);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "DataTransfer Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
DataTransferModifierData *dtmd = (DataTransferModifierData *) md;
@@ -163,7 +148,7 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
DT_TYPE_SHARP_FACE \
)
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
DataTransferModifierData *dtmd = (DataTransferModifierData *) md;
@@ -195,7 +180,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
BKE_reports_init(&reports, RPT_STORE);
/* Note: no islands precision for now here. */
- BKE_object_data_transfer_dm(md->scene, dtmd->ob_source, ob, dm, dtmd->data_types, false,
+ BKE_object_data_transfer_dm(eval_ctx, md->scene, dtmd->ob_source, ob, dm, dtmd->data_types, false,
dtmd->vmap_mode, dtmd->emap_mode, dtmd->lmap_mode, dtmd->pmap_mode,
space_transform, false, max_dist, dtmd->map_ray_radius, 0.0f,
dtmd->layers_select_src, dtmd->layers_select_dst,
@@ -247,7 +232,6 @@ ModifierTypeInfo modifierType_DataTransfer = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ dependsOnNormals,
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c
index 8b5b0542442..83dcd7b9b89 100644
--- a/source/blender/modifiers/intern/MOD_decimate.c
+++ b/source/blender/modifiers/intern/MOD_decimate.c
@@ -86,8 +86,8 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
return dataMask;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
DecimateModifierData *dmd = (DecimateModifierData *) md;
@@ -227,7 +227,6 @@ ModifierTypeInfo modifierType_Decimate = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index d2d82ca23d2..f90e6cc1d36 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -50,7 +50,6 @@
#include "BKE_deform.h"
#include "BKE_object.h"
-#include "depsgraph_private.h"
#include "MEM_guardedalloc.h"
#include "MOD_util.h"
@@ -155,27 +154,6 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
return ((!dmd->texture && dmd->direction == MOD_DISP_DIR_RGB_XYZ) || dmd->strength == 0.0f);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- DisplaceModifierData *dmd = (DisplaceModifierData *) md;
-
- if (dmd->map_object && dmd->texmapping == MOD_DISP_MAP_OBJECT) {
- DagNode *curNode = dag_get_node(ctx->forest, dmd->map_object);
-
- 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) &&
- dmd->space == MOD_DISP_SPACE_GLOBAL))
- {
- dag_add_relation(ctx->forest, ctx->obNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Displace Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
@@ -398,8 +376,8 @@ static void displaceModifier_do(
}
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -414,7 +392,7 @@ static void deformVerts(ModifierData *md, Object *ob,
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *editData,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = get_cddm(ob, editData, derivedData, vertexCos, dependsOnNormals(md));
@@ -446,7 +424,6 @@ ModifierTypeInfo modifierType_Displace = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ dependsOnNormals,
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index faf06f2d128..914b4101760 100644
--- a/source/blender/modifiers/intern/MOD_dynamicpaint.c
+++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c
@@ -36,11 +36,13 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_dynamicpaint.h"
+#include "BKE_layer.h"
#include "BKE_library.h"
#include "BKE_library_query.h"
#include "BKE_modifier.h"
-#include "depsgraph_private.h"
+#include "DEG_depsgraph.h"
+
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
@@ -89,7 +91,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ ||
surface->init_color_type == MOD_DPAINT_INITIAL_TEXTURE)
{
- dataMask |= CD_MASK_MLOOPUV | CD_MASK_MTEXPOLY;
+ dataMask |= CD_MASK_MLOOPUV;
}
/* mcol */
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT ||
@@ -106,21 +108,21 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
if (pmd->brush) {
if (pmd->brush->flags & MOD_DPAINT_USE_MATERIAL) {
- dataMask |= CD_MASK_MLOOPUV | CD_MASK_MTEXPOLY;
+ dataMask |= CD_MASK_MLOOPUV;
}
}
return dataMask;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *dm,
ModifierApplyFlag flag)
{
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;
/* dont apply dynamic paint on orco dm stack */
if (!(flag & MOD_APPLY_ORCO)) {
- return dynamicPaint_Modifier_do(pmd, md->scene, ob, dm);
+ return dynamicPaint_Modifier_do(pmd, eval_ctx, md->scene, ob, dm);
}
return dm;
}
@@ -130,27 +132,6 @@ static bool is_brush_cb(Object *UNUSED(ob), ModifierData *pmd)
return ((DynamicPaintModifierData *)pmd)->brush != NULL;
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;
-
- /* add relation from canvases to all brush objects */
- if (pmd && pmd->canvas) {
-#ifdef WITH_LEGACY_DEPSGRAPH
- for (DynamicPaintSurface *surface = pmd->canvas->surfaces.first; surface; surface = surface->next) {
- if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP) {
- dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, surface->effector_weights, true, 0, "Dynamic Paint Field");
- }
-
- /* Actual code uses custom loop over group/scene without layer checks in dynamicPaint_doStep */
- dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, surface->brush_group, -1, eModifierType_DynamicPaint, is_brush_cb, false, "Dynamic Paint Brush");
- }
-#else
- (void)ctx;
-#endif
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
@@ -162,7 +143,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
}
/* Actual code uses custom loop over group/scene without layer checks in dynamicPaint_doStep */
- DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, surface->brush_group, -1, eModifierType_DynamicPaint, is_brush_cb, false, "Dynamic Paint Brush");
+ DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, surface->brush_group, eModifierType_DynamicPaint, is_brush_cb, false, "Dynamic Paint Brush");
}
}
}
@@ -221,7 +202,6 @@ ModifierTypeInfo modifierType_DynamicPaint = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c
index a17870f2bf4..0e344a851f2 100644
--- a/source/blender/modifiers/intern/MOD_edgesplit.c
+++ b/source/blender/modifiers/intern/MOD_edgesplit.c
@@ -121,7 +121,8 @@ static void copyData(ModifierData *md, ModifierData *target)
modifier_copyData_generic(md, target);
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *UNUSED(ob), DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *result;
@@ -158,7 +159,6 @@ ModifierTypeInfo modifierType_EdgeSplit = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index c22901f1947..8483da60576 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -785,9 +785,10 @@ static DerivedMesh *cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
return splitdm;
}
-static DerivedMesh *explodeMesh(ExplodeModifierData *emd,
- ParticleSystemModifierData *psmd, Scene *scene, Object *ob,
- DerivedMesh *to_explode)
+static DerivedMesh *explodeMesh(
+ ExplodeModifierData *emd,
+ ParticleSystemModifierData *psmd, const struct EvaluationContext *eval_ctx, Scene *scene,
+ Object *ob, DerivedMesh *to_explode)
{
DerivedMesh *explode, *dm = to_explode;
MFace *mf = NULL, *mface;
@@ -812,6 +813,7 @@ static DerivedMesh *explodeMesh(ExplodeModifierData *emd,
mface = dm->getTessFaceArray(dm);
totpart = psmd->psys->totpart;
+ sim.eval_ctx = eval_ctx;
sim.scene = scene;
sim.ob = ob;
sim.psys = psmd->psys;
@@ -993,8 +995,8 @@ static ParticleSystemModifierData *findPrecedingParticlesystem(Object *ob, Modif
}
return psmd;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm = derivedData;
@@ -1028,7 +1030,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (emd->flag & eExplodeFlag_EdgeCut) {
int *facepa = emd->facepa;
DerivedMesh *splitdm = cutEdges(emd, dm);
- DerivedMesh *explode = explodeMesh(emd, psmd, md->scene, ob, splitdm);
+ DerivedMesh *explode = explodeMesh(emd, psmd, eval_ctx, md->scene, ob, splitdm);
MEM_freeN(emd->facepa);
emd->facepa = facepa;
@@ -1036,7 +1038,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
return explode;
}
else
- return explodeMesh(emd, psmd, md->scene, ob, derivedData);
+ return explodeMesh(emd, psmd, eval_ctx, md->scene, ob, derivedData);
}
return derivedData;
}
@@ -1059,7 +1061,6 @@ ModifierTypeInfo modifierType_Explode = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c
index 37eabdf2425..403a8706295 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim.c
@@ -41,9 +41,9 @@
#include "BKE_cdderivedmesh.h"
+#include "BKE_layer.h"
#include "BKE_modifier.h"
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MOD_fluidsim_util.h"
@@ -82,8 +82,8 @@ static void copyData(ModifierData *md, ModifierData *target)
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *dm,
ModifierApplyFlag flag)
{
FluidsimModifierData *fluidmd = (FluidsimModifierData *) md;
@@ -103,38 +103,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
return result ? result : dm;
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- FluidsimModifierData *fluidmd = (FluidsimModifierData *) md;
- Base *base;
-
- if (fluidmd && fluidmd->fss) {
- if (fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) {
- for (base = ctx->scene->base.first; base; base = base->next) {
- Object *ob1 = base->object;
- 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);
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Fluidsim Object");
- }
- }
- }
- }
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
FluidsimModifierData *fluidmd = (FluidsimModifierData *) md;
if (fluidmd && fluidmd->fss) {
if (fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) {
- Base *base;
- for (base = ctx->scene->base.first; base; base = base->next) {
- Object *ob1 = base->object;
+ FOREACH_SCENE_OBJECT_BEGIN(ctx->scene, ob1)
+ {
if (ob1 != ctx->object) {
FluidsimModifierData *fluidmdtmp =
(FluidsimModifierData *)modifiers_findByType(ob1, eModifierType_Fluidsim);
@@ -145,6 +120,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
}
}
}
+ FOREACH_SCENE_OBJECT_END;
}
}
}
@@ -176,7 +152,6 @@ ModifierTypeInfo modifierType_Fluidsim = {
/* requiredDataMask */ NULL,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c
index 80c029157f7..00abcc1c65c 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -46,8 +46,6 @@
#include "BKE_deform.h"
#include "BKE_colortools.h"
-
-#include "depsgraph_private.h"
#include "MEM_guardedalloc.h"
#include "MOD_util.h"
@@ -118,20 +116,6 @@ static void foreachObjectLink(
walk(userData, ob, &hmd->object, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- HookModifierData *hmd = (HookModifierData *) md;
-
- 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
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA, "Hook Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
HookModifierData *hmd = (HookModifierData *)md;
@@ -368,7 +352,7 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
}
}
-static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts,
ModifierApplyFlag UNUSED(flag))
{
@@ -384,7 +368,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
dm->release(dm);
}
-static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editData,
+static void deformVertsEM(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
HookModifierData *hmd = (HookModifierData *) md;
@@ -419,7 +403,6 @@ ModifierTypeInfo modifierType_Hook = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c
index 91d41a6badd..72db3f1c132 100644
--- a/source/blender/modifiers/intern/MOD_laplaciandeform.c
+++ b/source/blender/modifiers/intern/MOD_laplaciandeform.c
@@ -724,7 +724,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
return dataMask;
}
-static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, false, false);
@@ -736,7 +736,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *editData,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = get_dm(ob, editData, derivedData, NULL, false, false);
@@ -775,7 +775,6 @@ ModifierTypeInfo modifierType_LaplacianDeform = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c
index b3a542f68b7..977b8b41cc3 100644
--- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c
+++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c
@@ -506,7 +506,7 @@ static CustomDataMask required_data_mask(Object *UNUSED(ob), ModifierData *md)
return dataMask;
}
-static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm;
@@ -524,7 +524,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *editData,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm;
@@ -561,7 +561,6 @@ ModifierTypeInfo modifierType_LaplacianSmooth = {
/* requiredDataMask */ required_data_mask,
/* freeData */ NULL,
/* isDisabled */ is_disabled,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c
index 0df6329cf04..4bf52f552ce 100644
--- a/source/blender/modifiers/intern/MOD_lattice.c
+++ b/source/blender/modifiers/intern/MOD_lattice.c
@@ -44,8 +44,6 @@
#include "BKE_library_query.h"
#include "BKE_modifier.h"
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
static void initData(ModifierData *md)
@@ -91,18 +89,6 @@ static void foreachObjectLink(
walk(userData, ob, &lmd->object, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- LatticeModifierData *lmd = (LatticeModifierData *) md;
-
- if (lmd->object) {
- DagNode *latNode = dag_get_node(ctx->forest, lmd->object);
-
- dag_add_relation(ctx->forest, latNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Lattice Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
LatticeModifierData *lmd = (LatticeModifierData *)md;
@@ -113,8 +99,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Lattice Modifier");
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -129,14 +115,14 @@ static void deformVerts(ModifierData *md, Object *ob,
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *em,
+ ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, struct BMEditMesh *em,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
- deformVerts(md, ob, dm, vertexCos, numVerts, 0);
+ deformVerts(md, eval_ctx, ob, dm, vertexCos, numVerts, 0);
if (!derivedData) dm->release(dm);
}
@@ -161,7 +147,6 @@ ModifierTypeInfo modifierType_Lattice = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c
index 351e7116d49..080dc371508 100644
--- a/source/blender/modifiers/intern/MOD_mask.c
+++ b/source/blender/modifiers/intern/MOD_mask.c
@@ -50,7 +50,6 @@
#include "BKE_modifier.h"
#include "BKE_deform.h"
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
@@ -79,20 +78,6 @@ static void foreachObjectLink(
walk(userData, ob, &mmd->ob_arm, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- MaskModifierData *mmd = (MaskModifierData *)md;
-
- 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;
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
MaskModifierData *mmd = (MaskModifierData *)md;
@@ -105,8 +90,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
}
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
{
MaskModifierData *mmd = (MaskModifierData *)md;
@@ -395,7 +380,6 @@ ModifierTypeInfo modifierType_Mask = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c
index e026d4da29a..5dfa1d874b2 100644
--- a/source/blender/modifiers/intern/MOD_meshcache.c
+++ b/source/blender/modifiers/intern/MOD_meshcache.c
@@ -272,8 +272,8 @@ static void meshcache_do(
}
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -284,7 +284,7 @@ static void deformVerts(ModifierData *md, Object *ob,
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData),
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
@@ -313,7 +313,6 @@ ModifierTypeInfo modifierType_MeshCache = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c
index c125495a234..a2ca9bde124 100644
--- a/source/blender/modifiers/intern/MOD_meshdeform.c
+++ b/source/blender/modifiers/intern/MOD_meshdeform.c
@@ -47,10 +47,10 @@
#include "BKE_deform.h"
#include "BKE_editmesh.h"
-#include "depsgraph_private.h"
-
#include "MEM_guardedalloc.h"
+#include "DEG_depsgraph.h"
+
#include "MOD_util.h"
#ifdef __SSE2__
@@ -122,19 +122,6 @@ static void foreachObjectLink(
walk(userData, ob, &mmd->object, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- MeshDeformModifierData *mmd = (MeshDeformModifierData *) md;
-
- if (mmd->object) {
- DagNode *curNode = dag_get_node(ctx->forest, mmd->object);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA | DAG_RL_DATA_OB | DAG_RL_OB_OB,
- "Mesh Deform Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
MeshDeformModifierData *mmd = (MeshDeformModifierData *)md;
@@ -286,7 +273,7 @@ static void meshdeform_vert_task(
}
static void meshdeformModifier_do(
- ModifierData *md, Object *ob, DerivedMesh *dm,
+ ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, DerivedMesh *dm,
float (*vertexCos)[3], int numVerts)
{
MeshDeformModifierData *mmd = (MeshDeformModifierData *) md;
@@ -311,9 +298,9 @@ static void meshdeformModifier_do(
*
* We'll support this case once granular dependency graph is landed.
*/
- if (mmd->object == md->scene->obedit) {
+ if (mmd->object == OBEDIT_FROM_EVAL_CTX(eval_ctx)) {
BMEditMesh *em = BKE_editmesh_from_object(mmd->object);
- tmpdm = editbmesh_get_derived_cage_and_final(md->scene, mmd->object, em, 0, &cagedm);
+ tmpdm = editbmesh_get_derived_cage_and_final(eval_ctx, md->scene, mmd->object, em, 0, &cagedm);
if (tmpdm)
tmpdm->release(tmpdm);
}
@@ -422,7 +409,7 @@ static void meshdeformModifier_do(
cagedm->release(cagedm);
}
-static void deformVerts(ModifierData *md, Object *ob,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob,
DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
@@ -432,13 +419,13 @@ static void deformVerts(ModifierData *md, Object *ob,
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
- meshdeformModifier_do(md, ob, dm, vertexCos, numVerts);
+ meshdeformModifier_do(md, eval_ctx, ob, dm, vertexCos, numVerts);
if (dm && dm != derivedData)
dm->release(dm);
}
-static void deformVertsEM(ModifierData *md, Object *ob,
+static void deformVertsEM(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob,
struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData,
float (*vertexCos)[3],
@@ -446,7 +433,7 @@ static void deformVertsEM(ModifierData *md, Object *ob,
{
DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, false, false);
- meshdeformModifier_do(md, ob, dm, vertexCos, numVerts);
+ meshdeformModifier_do(md, eval_ctx, ob, dm, vertexCos, numVerts);
if (dm && dm != derivedData)
dm->release(dm);
@@ -535,7 +522,6 @@ ModifierTypeInfo modifierType_MeshDeform = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c
index 1116760449d..6af0e5b73ea 100644
--- a/source/blender/modifiers/intern/MOD_meshsequencecache.c
+++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c
@@ -37,7 +37,6 @@
#include "BKE_library_query.h"
#include "BKE_scene.h"
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
@@ -94,8 +93,8 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
return (mcmd->cache_file == NULL) || (mcmd->object_path[0] == '\0');
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
{
#ifdef WITH_ALEMBIC
@@ -173,18 +172,6 @@ static void foreachIDLink(ModifierData *md, Object *ob,
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
-
- if (mcmd->cache_file != NULL) {
- DagNode *curNode = dag_get_node(ctx->forest, mcmd->cache_file);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Cache File Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
@@ -212,7 +199,6 @@ ModifierTypeInfo modifierType_MeshSequenceCache = {
/* requiredDataMask */ NULL,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c
index 1524dbac480..62de2711b3d 100644
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@ -45,7 +45,6 @@
#include "MEM_guardedalloc.h"
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
@@ -77,17 +76,6 @@ static void foreachObjectLink(
walk(userData, ob, &mmd->mirror_ob, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- MirrorModifierData *mmd = (MirrorModifierData *) md;
-
- if (mmd->mirror_ob) {
- DagNode *latNode = dag_get_node(ctx->forest, mmd->mirror_ob);
-
- dag_add_relation(ctx->forest, latNode, ctx->obNode, DAG_RL_OB_DATA, "Mirror Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
MirrorModifierData *mmd = (MirrorModifierData *)md;
@@ -331,8 +319,8 @@ static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd,
return result;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *result;
@@ -371,7 +359,6 @@ ModifierTypeInfo modifierType_Mirror = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index f9f17b88fa4..6704526ea03 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -48,6 +48,8 @@
#include "MOD_modifiertypes.h"
+#include "DEG_depsgraph.h"
+
static void initData(ModifierData *md)
{
MultiresModifierData *mmd = (MultiresModifierData *)md;
@@ -67,8 +69,8 @@ static void copyData(ModifierData *md, ModifierData *target)
modifier_copyData_generic(md, target);
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
- ModifierApplyFlag flag)
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob,
+ DerivedMesh *dm, ModifierApplyFlag flag)
{
MultiresModifierData *mmd = (MultiresModifierData *)md;
DerivedMesh *result;
@@ -94,7 +96,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
if (ignore_simplify)
flags |= MULTIRES_IGNORE_SIMPLIFY;
- result = multires_make_derived_from_derived(dm, mmd, ob, flags);
+ result = multires_make_derived_from_derived(dm, mmd, ob, flags, eval_ctx->object_mode);
if (result == dm)
return dm;
@@ -163,7 +165,6 @@ ModifierTypeInfo modifierType_Multires = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_none.c b/source/blender/modifiers/intern/MOD_none.c
index d9d9ba2966d..3fb780f566d 100644
--- a/source/blender/modifiers/intern/MOD_none.c
+++ b/source/blender/modifiers/intern/MOD_none.c
@@ -67,7 +67,6 @@ ModifierTypeInfo modifierType_None = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c
index 0b703fffda3..4fc49234468 100644
--- a/source/blender/modifiers/intern/MOD_normal_edit.c
+++ b/source/blender/modifiers/intern/MOD_normal_edit.c
@@ -42,8 +42,6 @@
#include "BKE_mesh.h"
#include "BKE_deform.h"
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
@@ -511,17 +509,6 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
return !is_valid_target(enmd);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- NormalEditModifierData *enmd = (NormalEditModifierData *) md;
-
- if (enmd->target) {
- DagNode *Node = dag_get_node(ctx->forest, enmd->target);
-
- dag_add_relation(ctx->forest, Node, ctx->obNode, DAG_RL_OB_DATA, "NormalEdit Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
NormalEditModifierData *enmd = (NormalEditModifierData *) md;
@@ -530,7 +517,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
}
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, ModifierApplyFlag UNUSED(flag))
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob,
+ DerivedMesh *dm, ModifierApplyFlag UNUSED(flag))
{
return normalEditModifier_do((NormalEditModifierData *)md, ob, dm);
}
@@ -555,7 +543,6 @@ ModifierTypeInfo modifierType_NormalEdit = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ dependsOnNormals,
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index a9c4afcc0af..b3a7ecaa138 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -391,7 +391,6 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd)
/* add uvs */
if (CustomData_number_of_layers(&result->loopData, CD_MLOOPUV) < MAX_MTFACE) {
gogd.mloopuvs = CustomData_add_layer(&result->loopData, CD_MLOOPUV, CD_CALLOC, NULL, num_polys * 4);
- CustomData_add_layer(&result->polyData, CD_MTEXPOLY, CD_CALLOC, NULL, num_polys);
if (gogd.mloopuvs) { /* unlikely to fail */
gogd.ix = 1.0 / gogd.rx;
@@ -556,8 +555,8 @@ static DerivedMesh *doOcean(ModifierData *md, Object *UNUSED(ob),
}
#endif /* WITH_OCEANSIM */
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *result;
@@ -591,7 +590,6 @@ ModifierTypeInfo modifierType_Ocean = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ dependsOnNormals,
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c
index 82c6b82d492..7979751395a 100644
--- a/source/blender/modifiers/intern/MOD_particleinstance.c
+++ b/source/blender/modifiers/intern/MOD_particleinstance.c
@@ -50,7 +50,6 @@
#include "BKE_particle.h"
#include "BKE_pointcache.h"
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
@@ -111,20 +110,6 @@ static bool isDisabled(ModifierData *md, int useRenderParams)
return false;
}
-
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
-
- if (pimd->ob) {
- DagNode *curNode = dag_get_node(ctx->forest, pimd->ob);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "Particle Instance Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
@@ -176,8 +161,8 @@ static int particle_skip(ParticleInstanceModifierData *pimd, ParticleSystem *psy
return 0;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm = derivedData, *result;
@@ -222,6 +207,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (totpart == 0)
return derivedData;
+ sim.eval_ctx = eval_ctx;
sim.scene = md->scene;
sim.ob = pimd->ob;
sim.psys = psys;
@@ -453,7 +439,6 @@ ModifierTypeInfo modifierType_ParticleInstance = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index d8cccca415c..9cc6e5f56b5 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -97,8 +97,8 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
}
/* saves the current emitter state for a particle system and calculates particles */
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int UNUSED(numVerts),
ModifierApplyFlag flag)
@@ -186,7 +186,7 @@ static void deformVerts(ModifierData *md, Object *ob,
if (!(ob->transflag & OB_NO_PSYS_UPDATE)) {
psmd->flag &= ~eParticleSystemFlag_psys_updated;
- particle_system_update(md->scene, ob, psys, (flag & MOD_APPLY_RENDER) != 0);
+ particle_system_update(eval_ctx, md->scene, ob, psys, (flag & MOD_APPLY_RENDER) != 0);
psmd->flag |= eParticleSystemFlag_psys_updated;
}
}
@@ -231,7 +231,6 @@ ModifierTypeInfo modifierType_ParticleSystem = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c
index b85898c07e9..c9070cced7e 100644
--- a/source/blender/modifiers/intern/MOD_remesh.c
+++ b/source/blender/modifiers/intern/MOD_remesh.c
@@ -143,6 +143,7 @@ static void dualcon_add_quad(void *output_v, const int vert_indices[4])
}
static DerivedMesh *applyModifier(ModifierData *md,
+ const struct EvaluationContext *UNUSED(eval_ctx),
Object *UNUSED(ob),
DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
@@ -203,7 +204,9 @@ static DerivedMesh *applyModifier(ModifierData *md,
#else /* !WITH_MOD_REMESH */
-static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob),
+static DerivedMesh *applyModifier(ModifierData *UNUSED(md),
+ const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *UNUSED(ob),
DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
@@ -231,7 +234,6 @@ ModifierTypeInfo modifierType_Remesh = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index 047b1d5c47d..5f30b762275 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -46,7 +46,6 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_library_query.h"
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
@@ -185,8 +184,8 @@ static void copyData(ModifierData *md, ModifierData *target)
modifier_copyData_generic(md, target);
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag flag)
{
DerivedMesh *dm = derivedData;
@@ -1118,20 +1117,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
return result;
}
-
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- ScrewModifierData *ltmd = (ScrewModifierData *) md;
-
- if (ltmd->ob_axis) {
- DagNode *curNode = dag_get_node(ctx->forest, ltmd->ob_axis);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "Screw Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
ScrewModifierData *ltmd = (ScrewModifierData *)md;
@@ -1171,7 +1156,6 @@ ModifierTypeInfo modifierType_Screw = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c
index 97aae733532..822decea423 100644
--- a/source/blender/modifiers/intern/MOD_shapekey.c
+++ b/source/blender/modifiers/intern/MOD_shapekey.c
@@ -44,8 +44,8 @@
#include "MOD_modifiertypes.h"
-static void deformVerts(ModifierData *UNUSED(md), Object *ob,
- DerivedMesh *UNUSED(derivedData),
+static void deformVerts(ModifierData *UNUSED(md), const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *UNUSED(derivedData),
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -61,7 +61,7 @@ static void deformVerts(ModifierData *UNUSED(md), Object *ob,
}
}
-static void deformMatrices(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static void deformMatrices(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
{
Key *key = BKE_key_from_object(ob);
@@ -80,10 +80,10 @@ static void deformMatrices(ModifierData *md, Object *ob, DerivedMesh *derivedDat
copy_m3_m3(defMats[a], scale);
}
- deformVerts(md, ob, derivedData, vertexCos, numVerts, 0);
+ deformVerts(md, eval_ctx, ob, derivedData, vertexCos, numVerts, 0);
}
-static void deformVertsEM(ModifierData *md, Object *ob,
+static void deformVertsEM(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob,
struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData,
float (*vertexCos)[3],
@@ -92,11 +92,11 @@ static void deformVertsEM(ModifierData *md, Object *ob,
Key *key = BKE_key_from_object(ob);
if (key && key->type == KEY_RELATIVE)
- deformVerts(md, ob, derivedData, vertexCos, numVerts, 0);
+ deformVerts(md, eval_ctx, ob, derivedData, vertexCos, numVerts, 0);
}
-static void deformMatricesEM(ModifierData *UNUSED(md), Object *ob,
- struct BMEditMesh *UNUSED(editData),
+static void deformMatricesEM(ModifierData *UNUSED(md), const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, struct BMEditMesh *UNUSED(editData),
DerivedMesh *UNUSED(derivedData),
float (*vertexCos)[3],
float (*defMats)[3][3],
@@ -138,7 +138,6 @@ ModifierTypeInfo modifierType_ShapeKey = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c
index e0f48ae5a2f..e1df65dd748 100644
--- a/source/blender/modifiers/intern/MOD_shrinkwrap.c
+++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c
@@ -45,8 +45,6 @@
#include "BKE_modifier.h"
#include "BKE_shrinkwrap.h"
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
static bool dependsOnNormals(ModifierData *md);
@@ -105,8 +103,8 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
walk(userData, ob, &smd->auxTarget, IDWALK_CB_NOP);
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag flag)
@@ -120,13 +118,14 @@ static void deformVerts(ModifierData *md, Object *ob,
dm = get_cddm(ob, NULL, dm, vertexCos, dependsOnNormals(md));
}
- shrinkwrapModifier_deform((ShrinkwrapModifierData *)md, ob, dm, vertexCos, numVerts, forRender);
+ shrinkwrapModifier_deform(eval_ctx, (ShrinkwrapModifierData *)md, ob, dm, vertexCos, numVerts, forRender);
if (dm != derivedData)
dm->release(dm);
}
-static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editData, DerivedMesh *derivedData,
+static void deformVertsEM(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob,
+ struct BMEditMesh *editData, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
@@ -137,25 +136,12 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editD
dm = get_cddm(ob, editData, dm, vertexCos, dependsOnNormals(md));
}
- shrinkwrapModifier_deform((ShrinkwrapModifierData *)md, ob, dm, vertexCos, numVerts, false);
+ shrinkwrapModifier_deform(eval_ctx, (ShrinkwrapModifierData *)md, ob, dm, vertexCos, numVerts, false);
if (dm != derivedData)
dm->release(dm);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *) md;
-
- if (smd->target)
- dag_add_relation(ctx->forest, dag_get_node(ctx->forest, smd->target), ctx->obNode,
- DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier");
-
- if (smd->auxTarget)
- dag_add_relation(ctx->forest, dag_get_node(ctx->forest, smd->auxTarget), ctx->obNode,
- DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier");
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md;
@@ -201,7 +187,6 @@ ModifierTypeInfo modifierType_Shrinkwrap = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ dependsOnNormals,
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c
index 71109922f11..8590deb508a 100644
--- a/source/blender/modifiers/intern/MOD_simpledeform.c
+++ b/source/blender/modifiers/intern/MOD_simpledeform.c
@@ -43,9 +43,6 @@
#include "BKE_modifier.h"
#include "BKE_deform.h"
-
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
#define BEND_EPS 0.000001f
@@ -378,14 +375,6 @@ static void foreachObjectLink(
walk(userData, ob, &smd->origin, IDWALK_CB_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md;
-
- if (smd->origin)
- dag_add_relation(ctx->forest, dag_get_node(ctx->forest, smd->origin), ctx->obNode, DAG_RL_OB_DATA, "SimpleDeform Modifier");
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md;
@@ -394,8 +383,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
}
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -414,8 +403,8 @@ static void deformVerts(ModifierData *md, Object *ob,
dm->release(dm);
}
-static void deformVertsEM(ModifierData *md, Object *ob,
- struct BMEditMesh *editData,
+static void deformVertsEM(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts)
@@ -458,7 +447,6 @@ ModifierTypeInfo modifierType_SimpleDeform = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c
index dda0c413f57..4afe6ca33e2 100644
--- a/source/blender/modifiers/intern/MOD_skin.c
+++ b/source/blender/modifiers/intern/MOD_skin.c
@@ -1917,6 +1917,7 @@ static void copyData(ModifierData *md, ModifierData *target)
}
static DerivedMesh *applyModifier(ModifierData *md,
+ const struct EvaluationContext *UNUSED(eval_ctx),
Object *UNUSED(ob),
DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
@@ -1952,7 +1953,6 @@ ModifierTypeInfo modifierType_Skin = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c
index 2073e23b7b2..e610ef5f78d 100644
--- a/source/blender/modifiers/intern/MOD_smoke.c
+++ b/source/blender/modifiers/intern/MOD_smoke.c
@@ -46,13 +46,14 @@
#include "BLI_utildefines.h"
#include "BKE_cdderivedmesh.h"
+#include "BKE_layer.h"
#include "BKE_library.h"
#include "BKE_library_query.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_smoke.h"
-#include "depsgraph_private.h"
+#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
@@ -101,8 +102,8 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
return dataMask;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *dm,
ModifierApplyFlag flag)
{
SmokeModifierData *smd = (SmokeModifierData *) md;
@@ -110,7 +111,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (flag & MOD_APPLY_ORCO)
return dm;
- return smokeModifier_do(smd, md->scene, ob, dm);
+ return smokeModifier_do(smd, eval_ctx, md->scene, ob, dm);
}
static bool dependsOnTime(ModifierData *UNUSED(md))
@@ -130,30 +131,14 @@ static bool is_coll_cb(Object *UNUSED(ob), ModifierData *md)
return (smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll;
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- SmokeModifierData *smd = (SmokeModifierData *) md;
-
- if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
- /* Actual code uses get_collisionobjects */
-#ifdef WITH_LEGACY_DEPSGRAPH
- dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, smd->domain->fluid_group, ctx->object->lay|ctx->scene->lay, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
- dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, smd->domain->coll_group, ctx->object->lay|ctx->scene->lay, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
- dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, smd->domain->effector_weights, true, PFIELD_SMOKEFLOW, "Smoke Force Field");
-#else
- (void)ctx;
-#endif
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
SmokeModifierData *smd = (SmokeModifierData *)md;
if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
/* Actual code uses get_collisionobjects */
- DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, smd->domain->fluid_group, ctx->object->lay|ctx->scene->lay, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
- DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, smd->domain->coll_group, ctx->object->lay|ctx->scene->lay, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
+ DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, smd->domain->fluid_group, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
+ DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, smd->domain->coll_group, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
DEG_add_forcefield_relations(ctx->node, ctx->scene, ctx->object, smd->domain->effector_weights, true, PFIELD_SMOKEFLOW, "Smoke Force Field");
}
@@ -199,7 +184,6 @@ ModifierTypeInfo modifierType_Smoke = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c
index 92025512f02..91c724cd1c9 100644
--- a/source/blender/modifiers/intern/MOD_smooth.c
+++ b/source/blender/modifiers/intern/MOD_smooth.c
@@ -215,7 +215,7 @@ static void smoothModifier_do(
MEM_freeN(uctmp);
}
-static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, false, false);
@@ -228,7 +228,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *editData,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = get_dm(ob, editData, derivedData, NULL, false, false);
@@ -261,7 +261,6 @@ ModifierTypeInfo modifierType_Smooth = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c
index e760ff5ca01..8d5217391af 100644
--- a/source/blender/modifiers/intern/MOD_softbody.c
+++ b/source/blender/modifiers/intern/MOD_softbody.c
@@ -40,21 +40,22 @@
#include "BLI_utildefines.h"
#include "BKE_cdderivedmesh.h"
+#include "BKE_layer.h"
#include "BKE_particle.h"
#include "BKE_softbody.h"
-#include "depsgraph_private.h"
+#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
-static void deformVerts(ModifierData *md, Object *ob,
+static void deformVerts(ModifierData *md, const EvaluationContext *eval_ctx, Object *ob,
DerivedMesh *UNUSED(derivedData),
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
{
- sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts);
+ sbObjectStep(eval_ctx, md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts);
}
static bool dependsOnTime(ModifierData *UNUSED(md))
@@ -62,25 +63,11 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
return true;
}
-static void updateDepgraph(ModifierData *UNUSED(md), const ModifierUpdateDepsgraphContext *ctx)
-{
- if (ctx->object->soft) {
-#ifdef WITH_LEGACY_DEPSGRAPH
- /* Actual code uses ccd_build_deflector_hash */
- dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, ctx->object->soft->collision_group, ctx->object->lay, eModifierType_Collision, NULL, false, "Softbody Collision");
-
- dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, ctx->object->soft->effector_weights, true, 0, "Softbody Field");
-#else
- (void)ctx;
-#endif
- }
-}
-
static void updateDepsgraph(ModifierData *UNUSED(md), const ModifierUpdateDepsgraphContext *ctx)
{
if (ctx->object->soft) {
/* Actual code uses ccd_build_deflector_hash */
- DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, ctx->object->soft->collision_group, ctx->object->lay, eModifierType_Collision, NULL, false, "Softbody Collision");
+ DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, ctx->object->soft->collision_group, eModifierType_Collision, NULL, false, "Softbody Collision");
DEG_add_forcefield_relations(ctx->node, ctx->scene, ctx->object, ctx->object->soft->effector_weights, true, 0, "Softbody Field");
}
@@ -107,7 +94,6 @@ ModifierTypeInfo modifierType_Softbody = {
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index aa5b0caea2a..5635d37f100 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -205,8 +205,8 @@ BLI_INLINE void madd_v3v3short_fl(float r[3], const short a[3], const float f)
}
static DerivedMesh *applyModifier(
- ModifierData *md, Object *ob,
- DerivedMesh *dm,
+ ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *result;
@@ -973,7 +973,6 @@ ModifierTypeInfo modifierType_Solidify = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ dependsOnNormals,
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index 8711384e1ee..8fd510a6662 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -46,10 +46,12 @@
#include "BKE_cdderivedmesh.h"
-#include "BKE_depsgraph.h"
#include "BKE_scene.h"
#include "BKE_subsurf.h"
+#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
+
#include "MOD_modifiertypes.h"
#include "intern/CCGSubSurf.h"
@@ -96,8 +98,8 @@ static bool isDisabled(ModifierData *md, int useRenderParams)
return get_render_subsurf_level(&md->scene->r, levels, useRenderParams != 0) == 0;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag flag)
{
SubsurfModifierData *smd = (SubsurfModifierData *) md;
@@ -115,7 +117,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
subsurf_flags |= SUBSURF_USE_RENDER_PARAMS;
if (isFinalCalc)
subsurf_flags |= SUBSURF_IS_FINAL_CALC;
- if (ob->mode & OB_MODE_EDIT)
+ if (eval_ctx->object_mode & OB_MODE_EDIT)
subsurf_flags |= SUBSURF_IN_EDIT_MODE;
#ifdef WITH_OPENSUBDIV
@@ -130,10 +132,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (U.opensubdiv_compute_type == USER_OPENSUBDIV_COMPUTE_NONE) {
modifier_setError(md, "OpenSubdiv is disabled in User Preferences");
}
- else if ((ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)) != 0) {
+ else if ((eval_ctx->object_mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)) != 0) {
modifier_setError(md, "OpenSubdiv is not supported in paint modes");
}
- else if ((DAG_get_eval_flags_for_object(md->scene, ob) & DAG_EVAL_NEED_CPU) == 0) {
+ else if ((DEG_get_eval_flags_for_id(eval_ctx->depsgraph, &ob->id) & DAG_EVAL_NEED_CPU) == 0) {
subsurf_flags |= SUBSURF_USE_GPU_BACKEND;
do_cddm_convert = false;
}
@@ -141,24 +143,32 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
modifier_setError(md, "OpenSubdiv is disabled due to dependencies");
}
}
+#else
+ UNUSED_VARS(ob);
#endif
result = subsurf_make_derived_from_derived(derivedData, smd, NULL, subsurf_flags);
result->cd_flag = derivedData->cd_flag;
- if (do_cddm_convert) {
+ {
DerivedMesh *cddm = CDDM_copy(result);
result->release(result);
result = cddm;
}
+#ifndef WITH_OPESUBDIV
+ (void) do_cddm_convert;
+ UNUSED_VARS(eval_ctx);
+#endif
+
return result;
}
-static DerivedMesh *applyModifierEM(ModifierData *md, Object *UNUSED(ob),
- struct BMEditMesh *UNUSED(editData),
- DerivedMesh *derivedData,
- ModifierApplyFlag flag)
+static DerivedMesh *applyModifierEM(
+ ModifierData *md, const EvaluationContext *UNUSED(eval_ctx),
+ Object *UNUSED(ob), struct BMEditMesh *UNUSED(editData),
+ DerivedMesh *derivedData,
+ ModifierApplyFlag flag)
{
SubsurfModifierData *smd = (SubsurfModifierData *) md;
DerivedMesh *result;
@@ -211,7 +221,6 @@ ModifierTypeInfo modifierType_Subsurf = {
/* requiredDataMask */ NULL,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ dependsOnNormals,
diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c
index 7bb4c0b2fd1..bef35ccf1fe 100644
--- a/source/blender/modifiers/intern/MOD_surface.c
+++ b/source/blender/modifiers/intern/MOD_surface.c
@@ -85,8 +85,8 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
return true;
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int UNUSED(numVerts),
ModifierApplyFlag UNUSED(flag))
@@ -186,7 +186,6 @@ ModifierTypeInfo modifierType_Surface = {
/* requiredDataMask */ NULL,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c
index fc605dd48e1..e7f283c4a31 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,17 +170,6 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
walk(userData, ob, &smd->target, IDWALK_NOP);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md;
-
- if (smd->target) {
- DagNode *curNode = dag_get_node(ctx->forest, smd->target);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA, "Surface Deform Modifier");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md;
@@ -1106,7 +1095,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;
@@ -1119,7 +1110,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;
}
@@ -1189,20 +1180,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))
@@ -1231,7 +1224,6 @@ ModifierTypeInfo modifierType_SurfaceDeform = {
/* requiredDataMask */ NULL,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_triangulate.c b/source/blender/modifiers/intern/MOD_triangulate.c
index b057d6d5a86..5dd7e3dfda4 100644
--- a/source/blender/modifiers/intern/MOD_triangulate.c
+++ b/source/blender/modifiers/intern/MOD_triangulate.c
@@ -85,6 +85,7 @@ static void copyData(ModifierData *md, ModifierData *target)
}
static DerivedMesh *applyModifier(ModifierData *md,
+ const struct EvaluationContext *UNUSED(eval_ctx),
Object *UNUSED(ob),
DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
@@ -120,7 +121,6 @@ ModifierTypeInfo modifierType_Triangulate = {
/* requiredDataMask */ NULL, //requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 1cefb07b50a..02f799fecb9 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -47,6 +47,7 @@
#include "BKE_camera.h"
#include "BKE_library.h"
#include "BKE_library_query.h"
+#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_DerivedMesh.h"
@@ -54,14 +55,13 @@
#include "MEM_guardedalloc.h"
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
static void initData(ModifierData *md)
{
UVProjectModifierData *umd = (UVProjectModifierData *) md;
- umd->flags = 0;
+
umd->num_projectors = 1;
umd->aspectx = umd->aspecty = 1.0f;
umd->scalex = umd->scaley = 1.0f;
@@ -84,7 +84,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(
CustomDataMask dataMask = 0;
/* ask for UV coordinates */
- dataMask |= CD_MLOOPUV | CD_MTEXPOLY;
+ dataMask |= CD_MLOOPUV;
return dataMask;
}
@@ -109,21 +109,6 @@ static void foreachIDLink(ModifierData *md, Object *ob,
foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- UVProjectModifierData *umd = (UVProjectModifierData *) md;
- int i;
-
- for (i = 0; i < umd->num_projectors; ++i) {
- if (umd->projectors[i]) {
- DagNode *curNode = dag_get_node(ctx->forest, umd->projectors[i]);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "UV Project Modifier");
- }
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
UVProjectModifierData *umd = (UVProjectModifierData *)md;
@@ -147,12 +132,10 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
{
float (*coords)[3], (*co)[3];
MLoopUV *mloop_uv;
- MTexPoly *mtexpoly, *mt = NULL;
int i, numVerts, numPolys, numLoops;
Image *image = umd->image;
MPoly *mpoly, *mp;
MLoop *mloop;
- const bool override_image = (umd->flags & MOD_UVPROJECT_OVERRIDEIMAGE) != 0;
Projector projectors[MOD_UVPROJECT_MAXPROJECTORS];
int num_projectors = 0;
char uvname[MAX_CUSTOMDATA_LAYER_NAME];
@@ -237,10 +220,6 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
mloop_uv = CustomData_duplicate_referenced_layer_named(&dm->loopData,
CD_MLOOPUV, uvname, numLoops);
- /* can be NULL */
- mt = mtexpoly = CustomData_duplicate_referenced_layer_named(&dm->polyData,
- CD_MTEXPOLY, uvname, numPolys);
-
numVerts = dm->getNumVerts(dm);
coords = MEM_malloc_arrayN(numVerts, sizeof(*coords),
@@ -259,9 +238,14 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
mpoly = dm->getPolyArray(dm);
mloop = dm->getLoopArray(dm);
+ Image **ob_image_array = NULL;
+ if (image) {
+ ob_image_array = BKE_object_material_edit_image_get_array(ob);
+ }
+
/* apply coords as UVs, and apply image if tfaces are new */
- for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp, ++mt) {
- if (override_image || !image || (mtexpoly == NULL || mt->tpage == image)) {
+ for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp) {
+ if (!image || (mp->mat_nr < ob->totcol ? ob_image_array[mp->mat_nr] : NULL) == image) {
if (num_projectors == 1) {
if (projectors[0].uci) {
unsigned int fidx = mp->totloop - 1;
@@ -324,13 +308,13 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
}
}
}
-
- if (override_image && mtexpoly) {
- mt->tpage = image;
- }
}
MEM_freeN(coords);
+
+ if (ob_image_array) {
+ MEM_freeN(ob_image_array);
+ }
if (free_uci) {
int j;
@@ -347,8 +331,8 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
return dm;
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *result;
@@ -381,7 +365,6 @@ ModifierTypeInfo modifierType_UVProject = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c b/source/blender/modifiers/intern/MOD_uvwarp.c
index 384efc74666..8af9fd6cde4 100644
--- a/source/blender/modifiers/intern/MOD_uvwarp.c
+++ b/source/blender/modifiers/intern/MOD_uvwarp.c
@@ -40,8 +40,6 @@
#include "BKE_library_query.h"
#include "BKE_modifier.h"
-#include "depsgraph_private.h"
-
#include "MOD_util.h"
@@ -148,8 +146,8 @@ static void uv_warp_compute(
}
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
- DerivedMesh *dm,
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob, DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
{
UVWarpModifierData *umd = (UVWarpModifierData *) md;
@@ -234,27 +232,6 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
walk(userData, ob, &umd->object_src, IDWALK_CB_NOP);
}
-static void uv_warp_deps_object_bone(DagForest *forest, DagNode *obNode,
- Object *obj, const char *bonename)
-{
- if (obj) {
- DagNode *curNode = dag_get_node(forest, obj);
-
- if (bonename[0])
- dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "UVWarp Modifier");
- else
- dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA, "UVWarp Modifier");
- }
-}
-
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- UVWarpModifierData *umd = (UVWarpModifierData *) md;
-
- uv_warp_deps_object_bone(ctx->forest, ctx->obNode, umd->object_src, umd->bone_src);
- uv_warp_deps_object_bone(ctx->forest, ctx->obNode, umd->object_dst, umd->bone_dst);
-}
-
static void uv_warp_deps_object_bone_new(struct DepsNodeHandle *node,
Object *object,
const char *bonename)
@@ -294,7 +271,6 @@ ModifierTypeInfo modifierType_UVWarp = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c
index 00d7906a442..204e344b8e1 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -42,8 +42,6 @@
#include "BKE_texture.h"
#include "BKE_colortools.h"
-#include "depsgraph_private.h"
-
#include "RE_shader_ext.h"
#include "MOD_util.h"
@@ -139,24 +137,6 @@ static void foreachTexLink(ModifierData *md, Object *ob, TexWalkFunc walk, void
walk(userData, ob, md, "texture");
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- WarpModifierData *wmd = (WarpModifierData *) md;
-
- if (wmd->object_from && wmd->object_to) {
- DagNode *fromNode = dag_get_node(ctx->forest, wmd->object_from);
- DagNode *toNode = dag_get_node(ctx->forest, wmd->object_to);
-
- dag_add_relation(ctx->forest, fromNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Warp Modifier1");
- dag_add_relation(ctx->forest, toNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Warp Modifier2");
- }
-
- if ((wmd->texmapping == MOD_DISP_MAP_OBJECT) && wmd->map_object) {
- DagNode *curNode = dag_get_node(ctx->forest, wmd->map_object);
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Warp Modifier3");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
WarpModifierData *wmd = (WarpModifierData *) md;
@@ -329,7 +309,7 @@ static int warp_needs_dm(WarpModifierData *wmd)
return wmd->texture || wmd->defgrp_name[0];
}
-static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, ModifierApplyFlag UNUSED(flag))
{
DerivedMesh *dm = NULL;
@@ -346,7 +326,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
}
}
-static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *em,
+static void deformVertsEM(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, struct BMEditMesh *em,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
@@ -357,7 +337,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *em,
dm = CDDM_from_editbmesh(em, false, false);
}
- deformVerts(md, ob, dm, vertexCos, numVerts, 0);
+ deformVerts(md, eval_ctx, ob, dm, vertexCos, numVerts, 0);
if (use_dm) {
if (!derivedData) dm->release(dm);
@@ -384,7 +364,6 @@ ModifierTypeInfo modifierType_Warp = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c
index 0c3781acb19..33b2d904c23 100644
--- a/source/blender/modifiers/intern/MOD_wave.c
+++ b/source/blender/modifiers/intern/MOD_wave.c
@@ -49,14 +49,14 @@
#include "BKE_scene.h"
#include "BKE_texture.h"
-#include "depsgraph_private.h"
-
#include "MEM_guardedalloc.h"
#include "RE_shader_ext.h"
#include "MOD_modifiertypes.h"
#include "MOD_util.h"
+#include "DEG_depsgraph.h"
+
static void initData(ModifierData *md)
{
WaveModifierData *wmd = (WaveModifierData *) md; // whadya know, moved here from Iraq
@@ -127,25 +127,6 @@ static void foreachTexLink(ModifierData *md, Object *ob,
walk(userData, ob, md, "texture");
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- WaveModifierData *wmd = (WaveModifierData *) md;
-
- if (wmd->objectcenter) {
- DagNode *curNode = dag_get_node(ctx->forest, wmd->objectcenter);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA,
- "Wave Modifier");
- }
-
- if (wmd->map_object) {
- DagNode *curNode = dag_get_node(ctx->forest, wmd->map_object);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA,
- "Wave Modifer");
- }
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
WaveModifierData *wmd = (WaveModifierData *)md;
@@ -174,15 +155,16 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
return dataMask;
}
-static void waveModifier_do(WaveModifierData *md,
- Scene *scene, Object *ob, DerivedMesh *dm,
+static void waveModifier_do(WaveModifierData *md,
+ const EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *dm,
float (*vertexCos)[3], int numVerts)
{
WaveModifierData *wmd = (WaveModifierData *) md;
MVert *mvert = NULL;
MDeformVert *dvert;
int defgrp_index;
- float ctime = BKE_scene_frame_get(scene);
+ float ctime = eval_ctx->ctime;
float minfac = (float)(1.0 / exp(wmd->width * wmd->narrow * wmd->width * wmd->narrow));
float lifefac = wmd->height;
float (*tex_co)[3] = NULL;
@@ -327,8 +309,8 @@ static void waveModifier_do(WaveModifierData *md,
if (wmd->texture) MEM_freeN(tex_co);
}
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *md, const struct EvaluationContext *eval_ctx,
+ Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3],
int numVerts,
ModifierApplyFlag UNUSED(flag))
@@ -341,14 +323,15 @@ static void deformVerts(ModifierData *md, Object *ob,
else if (wmd->texture || wmd->defgrp_name[0])
dm = get_dm(ob, NULL, dm, NULL, false, false);
- waveModifier_do(wmd, md->scene, ob, dm, vertexCos, numVerts);
+ waveModifier_do(wmd, eval_ctx, ob, dm, vertexCos, numVerts);
if (dm != derivedData)
dm->release(dm);
}
static void deformVertsEM(
- ModifierData *md, Object *ob, struct BMEditMesh *editData,
+ ModifierData *md, const struct EvaluationContext *eval_ctx,
+ Object *ob, struct BMEditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
@@ -359,7 +342,7 @@ static void deformVertsEM(
else if (wmd->texture || wmd->defgrp_name[0])
dm = get_dm(ob, editData, dm, NULL, false, false);
- waveModifier_do(wmd, md->scene, ob, dm, vertexCos, numVerts);
+ waveModifier_do(wmd, eval_ctx, ob, dm, vertexCos, numVerts);
if (dm != derivedData)
dm->release(dm);
@@ -385,7 +368,6 @@ ModifierTypeInfo modifierType_Wave = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ NULL,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index aeb3df42622..23f36d3bc4c 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -46,7 +46,6 @@
#include "BKE_modifier.h"
#include "BKE_texture.h" /* Texture masking. */
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MEM_guardedalloc.h"
@@ -141,23 +140,6 @@ static void foreachTexLink(ModifierData *md, Object *ob, TexWalkFunc walk, void
walk(userData, ob, md, "mask_texture");
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
- DagNode *curNode;
-
- if (wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
- curNode = dag_get_node(ctx->forest, wmd->mask_tex_map_obj);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "WeightVGEdit Modifier");
- }
-
- if (wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
- dag_add_relation(ctx->forest, ctx->obNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "WeightVGEdit Modifier");
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md;
@@ -176,7 +158,10 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
return (wmd->defgrp_name[0] == '\0');
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
+static DerivedMesh *applyModifier(ModifierData *md,
+ const struct EvaluationContext *UNUSED(eval_ctx),
+ Object *ob,
+ DerivedMesh *derivedData,
ModifierApplyFlag UNUSED(flag))
{
WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
@@ -297,7 +282,6 @@ ModifierTypeInfo modifierType_WeightVGEdit = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c
index 032e154e096..1947e7e1f0f 100644
--- a/source/blender/modifiers/intern/MOD_weightvgmix.c
+++ b/source/blender/modifiers/intern/MOD_weightvgmix.c
@@ -43,7 +43,6 @@
#include "BKE_modifier.h"
#include "BKE_texture.h" /* Texture masking. */
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MEM_guardedalloc.h"
@@ -190,23 +189,6 @@ static void foreachTexLink(ModifierData *md, Object *ob, TexWalkFunc walk, void
walk(userData, ob, md, "mask_texture");
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
- DagNode *curNode;
-
- if (wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
- curNode = dag_get_node(ctx->forest, wmd->mask_tex_map_obj);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "WeightVGMix Modifier");
- }
-
- if (wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
- dag_add_relation(ctx->forest, ctx->obNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "WeightVGMix Modifier");
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
@@ -227,8 +209,8 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
return (wmd->defgrp_name_a[0] == '\0');
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
- ModifierApplyFlag UNUSED(flag))
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob,
+ DerivedMesh *derivedData, ModifierApplyFlag UNUSED(flag))
{
WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
DerivedMesh *dm = derivedData;
@@ -429,7 +411,6 @@ ModifierTypeInfo modifierType_WeightVGMix = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index cbc62cdace5..87c6a03a536 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -47,7 +47,6 @@
#include "BKE_modifier.h"
#include "BKE_texture.h" /* Texture masking. */
-#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MEM_guardedalloc.h"
@@ -351,29 +350,6 @@ static void foreachTexLink(ModifierData *md, Object *ob, TexWalkFunc walk, void
walk(userData, ob, md, "mask_texture");
}
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
- WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
- DagNode *curNode;
-
- if (wmd->proximity_ob_target) {
- curNode = dag_get_node(ctx->forest, wmd->proximity_ob_target);
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "WeightVGProximity Modifier");
- }
-
- if (wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
- curNode = dag_get_node(ctx->forest, wmd->mask_tex_map_obj);
-
- dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "WeightVGProximity Modifier");
- }
-
- if (wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
- dag_add_relation(ctx->forest, ctx->obNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
- "WeightVGProximity Modifier");
-}
-
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *)md;
@@ -400,8 +376,8 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
return (wmd->proximity_ob_target == NULL);
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
- ModifierApplyFlag UNUSED(flag))
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob,
+ DerivedMesh *derivedData, ModifierApplyFlag UNUSED(flag))
{
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
DerivedMesh *dm = derivedData;
@@ -618,7 +594,6 @@ ModifierTypeInfo modifierType_WeightVGProximity = {
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
- /* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_wireframe.c b/source/blender/modifiers/intern/MOD_wireframe.c
index 15f8b185a3d..3cb35286114 100644
--- a/source/blender/modifiers/intern/MOD_wireframe.c
+++ b/source/blender/modifiers/intern/MOD_wireframe.c
@@ -102,7 +102,8 @@ static DerivedMesh *WireframeModifier_do(WireframeModifierData *wmd, Object *ob,
}
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, ModifierApplyFlag UNUSED(flag))
+static DerivedMesh *applyModifier(ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx), Object *ob,
+ DerivedMesh *dm, ModifierApplyFlag UNUSED(flag))
{
return WireframeModifier_do((WireframeModifierData *)md, ob, dm);
}
@@ -128,7 +129,6 @@ ModifierTypeInfo modifierType_Wireframe = {
/* freeData */ NULL,
/* isDisabled */ NULL,
/* updateDepgraph */ NULL,
- /* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ dependsOnNormals,
/* foreachObjectLink */ NULL,