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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-06-22 16:03:42 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-06-22 16:12:03 +0300
commita7ca8fe1dd111f0b99c1b17cdd6b0f7e1c6f987b (patch)
tree98d27b8d18a21c6389f3090b0f8d92c6b5f595e0 /source/blender/modifiers
parent7a4b784909b3d31f318f92ddcfd534223f3e8412 (diff)
Modifiers: Remove lots of usages of md->scene
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_cloth.c5
-rw-r--r--source/blender/modifiers/intern/MOD_datatransfer.c5
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c5
-rw-r--r--source/blender/modifiers/intern/MOD_dynamicpaint.c5
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c10
-rw-r--r--source/blender/modifiers/intern/MOD_meshcache.c11
-rw-r--r--source/blender/modifiers/intern/MOD_meshdeform.c4
-rw-r--r--source/blender/modifiers/intern/MOD_meshsequencecache.c2
-rw-r--r--source/blender/modifiers/intern/MOD_ocean.c14
-rw-r--r--source/blender/modifiers/intern/MOD_particleinstance.c4
-rw-r--r--source/blender/modifiers/intern/MOD_particlesystem.c6
-rw-r--r--source/blender/modifiers/intern/MOD_smoke.c7
-rw-r--r--source/blender/modifiers/intern/MOD_softbody.c5
-rw-r--r--source/blender/modifiers/intern/MOD_warp.c4
-rw-r--r--source/blender/modifiers/intern/MOD_wave.c3
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c4
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgmix.c5
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c4
18 files changed, 71 insertions, 32 deletions
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index 19afe30acae..05c9e44d980 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -54,6 +54,8 @@
#include "BKE_modifier.h"
#include "BKE_pointcache.h"
+#include "DEG_depsgraph_query.h"
+
#include "MOD_util.h"
static void initData(ModifierData *md)
@@ -78,6 +80,7 @@ static void deformVerts(
{
Mesh *mesh_src;
ClothModifierData *clmd = (ClothModifierData *) md;
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
/* check for alloc failing */
if (!clmd->sim_parms || !clmd->coll_parms) {
@@ -123,7 +126,7 @@ static void deformVerts(
BKE_mesh_apply_vert_coords(mesh_src, vertexCos);
- clothModifier_do(clmd, ctx->depsgraph, md->scene, ctx->object, mesh_src, vertexCos);
+ clothModifier_do(clmd, ctx->depsgraph, scene, ctx->object, mesh_src, vertexCos);
BKE_id_free(NULL, mesh_src);
}
diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c
index 8a95c8020e9..5bdb90ec42d 100644
--- a/source/blender/modifiers/intern/MOD_datatransfer.c
+++ b/source/blender/modifiers/intern/MOD_datatransfer.c
@@ -46,6 +46,8 @@
#include "BKE_modifier.h"
#include "BKE_report.h"
+#include "DEG_depsgraph_query.h"
+
#include "MEM_guardedalloc.h"
#include "MOD_util.h"
@@ -150,6 +152,7 @@ static bool isDisabled(const struct Scene *UNUSED(scene), ModifierData *md, int
static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mesh *me_mod)
{
DataTransferModifierData *dtmd = (DataTransferModifierData *) md;
+ struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
Mesh *result = me_mod;
ReportList reports;
@@ -184,7 +187,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
BKE_reports_init(&reports, RPT_STORE);
/* Note: no islands precision for now here. */
- BKE_object_data_transfer_ex(ctx->depsgraph, md->scene, dtmd->ob_source, ctx->object, result, dtmd->data_types, false,
+ BKE_object_data_transfer_ex(ctx->depsgraph, scene, dtmd->ob_source, ctx->object, result, 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,
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index 28791899e02..351a496daa1 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -53,6 +53,7 @@
#include "BKE_object.h"
#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
#include "MEM_guardedalloc.h"
@@ -159,6 +160,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
typedef struct DisplaceUserdata {
/*const*/ DisplaceModifierData *dmd;
+ struct Scene *scene;
struct ImagePool *pool;
MDeformVert *dvert;
float weight;
@@ -205,7 +207,7 @@ static void displaceModifier_do_task(
if (dmd->texture) {
texres.nor = NULL;
- BKE_texture_get_value_ex(dmd->modifier.scene, dmd->texture, tex_co[iter], &texres, data->pool, false);
+ BKE_texture_get_value_ex(data->scene, dmd->texture, tex_co[iter], &texres, data->pool, false);
delta = texres.tin - dmd->midlevel;
}
else {
@@ -330,6 +332,7 @@ static void displaceModifier_do(
}
DisplaceUserdata data = {NULL};
+ data.scene = DEG_get_evaluated_scene(ctx->depsgraph);
data.dmd = dmd;
data.dvert = dvert;
data.weight = weight;
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index 5ca367e342a..6619f0079e7 100644
--- a/source/blender/modifiers/intern/MOD_dynamicpaint.c
+++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c
@@ -42,8 +42,8 @@
#include "BKE_modifier.h"
#include "DEG_depsgraph.h"
-
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
#include "MOD_modifiertypes.h"
@@ -107,7 +107,8 @@ static DerivedMesh *applyModifier(
/* dont apply dynamic paint on orco dm stack */
if (!(ctx->flag & MOD_APPLY_ORCO)) {
- return dynamicPaint_Modifier_do(pmd, ctx->depsgraph, md->scene, ctx->object, dm);
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
+ return dynamicPaint_Modifier_do(pmd, ctx->depsgraph, scene, ctx->object, dm);
}
return dm;
}
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index cbb15665bef..948aaf0751e 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -51,6 +51,8 @@
#include "BKE_particle.h"
#include "BKE_scene.h"
+#include "DEG_depsgraph_query.h"
+
#include "MEM_guardedalloc.h"
#include "MOD_modifiertypes.h"
@@ -1028,18 +1030,20 @@ static DerivedMesh *applyModifier(
createFacepa(emd, psmd, derivedData);
}
/* 2. create new mesh */
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
if (emd->flag & eExplodeFlag_EdgeCut) {
int *facepa = emd->facepa;
DerivedMesh *splitdm = cutEdges(emd, dm);
- DerivedMesh *explode = explodeMesh(emd, psmd, ctx, md->scene, splitdm);
+ DerivedMesh *explode = explodeMesh(emd, psmd, ctx, scene, splitdm);
MEM_freeN(emd->facepa);
emd->facepa = facepa;
splitdm->release(splitdm);
return explode;
}
- else
- return explodeMesh(emd, psmd, ctx, md->scene, derivedData);
+ else {
+ return explodeMesh(emd, psmd, ctx, scene, derivedData);
+ }
}
return derivedData;
}
diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c
index 145bceb99aa..9d6dfc0e1eb 100644
--- a/source/blender/modifiers/intern/MOD_meshcache.c
+++ b/source/blender/modifiers/intern/MOD_meshcache.c
@@ -42,6 +42,8 @@
#include "BKE_mesh.h"
#include "BKE_main.h"
+#include "DEG_depsgraph_query.h"
+
#include "MEM_guardedalloc.h"
#include "MOD_meshcache_util.h" /* utility functions */
@@ -80,7 +82,7 @@ static bool isDisabled(const struct Scene *UNUSED(scene), ModifierData *md, int
static void meshcache_do(
- MeshCacheModifierData *mcmd, Object *ob, DerivedMesh *UNUSED(dm),
+ MeshCacheModifierData *mcmd, Scene *scene, Object *ob, DerivedMesh *UNUSED(dm),
float (*vertexCos_Real)[3], int numVerts)
{
const bool use_factor = mcmd->factor < 1.0f;
@@ -88,7 +90,6 @@ static void meshcache_do(
MEM_malloc_arrayN(numVerts, sizeof(*vertexCos_Store), __func__) : NULL;
float (*vertexCos)[3] = vertexCos_Store ? vertexCos_Store : vertexCos_Real;
- Scene *scene = mcmd->modifier.scene;
const float fps = FPS;
char filepath[FILE_MAX];
@@ -270,8 +271,9 @@ static void deformVerts(
int numVerts)
{
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
- meshcache_do(mcmd, ctx->object, derivedData, vertexCos, numVerts);
+ meshcache_do(mcmd, scene, ctx->object, derivedData, vertexCos, numVerts);
}
static void deformVertsEM(
@@ -279,8 +281,9 @@ static void deformVertsEM(
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
- meshcache_do(mcmd, ctx->object, derivedData, vertexCos, numVerts);
+ meshcache_do(mcmd, scene, ctx->object, derivedData, vertexCos, numVerts);
}
diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c
index 2228366b030..ea20d5f5a0f 100644
--- a/source/blender/modifiers/intern/MOD_meshdeform.c
+++ b/source/blender/modifiers/intern/MOD_meshdeform.c
@@ -52,6 +52,7 @@
#include "MEM_guardedalloc.h"
#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
#include "MOD_util.h"
@@ -324,8 +325,9 @@ static void meshdeformModifier_do(
/* progress bar redraw can make this recursive .. */
if (!recursive) {
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
recursive = 1;
- mmd->bindfunc(md->scene, mmd, cagemesh, (float *)vertexCos, numVerts, cagemat);
+ mmd->bindfunc(scene, mmd, cagemesh, (float *)vertexCos, numVerts, cagemat);
recursive = 0;
}
}
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c
index 77be2d6b17a..482a74ed248 100644
--- a/source/blender/modifiers/intern/MOD_meshsequencecache.c
+++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c
@@ -98,7 +98,7 @@ static Mesh *applyModifier(
Mesh *me = (ctx->object->type == OB_MESH) ? ctx->object->data : NULL;
Mesh *org_mesh = mesh;
- Scene *scene = md->scene; /* for FPS macro */
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
const float frame = DEG_get_ctime(ctx->depsgraph);
const float time = BKE_cachefile_time_offset(mcmd->cache_file, frame, FPS);
const char *err_str = NULL;
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index af5b537ca52..2de737129fa 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -46,6 +46,8 @@
#include "BKE_modifier.h"
#include "BKE_ocean.h"
+#include "DEG_depsgraph_query.h"
+
#include "MOD_modifiertypes.h"
#ifdef WITH_OCEANSIM
@@ -406,7 +408,7 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd)
}
static DerivedMesh *doOcean(
- ModifierData *md, Object *ob,
+ ModifierData *md, Scene *scene, Object *ob,
DerivedMesh *derivedData,
int UNUSED(useRenderParams))
{
@@ -450,7 +452,7 @@ static DerivedMesh *doOcean(
if (!omd->oceancache) {
init_cache_data(ob, omd);
}
- BKE_ocean_simulate_cache(omd->oceancache, md->scene->r.cfra);
+ BKE_ocean_simulate_cache(omd->oceancache, scene->r.cfra);
}
else {
simulate_ocean_modifier(omd);
@@ -464,7 +466,7 @@ static DerivedMesh *doOcean(
dm = CDDM_copy(derivedData);
}
- cfra = md->scene->r.cfra;
+ cfra = scene->r.cfra;
CLAMP(cfra, omd->bakestart, omd->bakeend);
cfra -= omd->bakestart; /* shift to 0 based */
@@ -547,7 +549,7 @@ static DerivedMesh *doOcean(
}
#else /* WITH_OCEANSIM */
static DerivedMesh *doOcean(
- ModifierData *md, Object *UNUSED(ob),
+ ModifierData *md, Scene *scene, Object *UNUSED(ob),
DerivedMesh *derivedData,
int UNUSED(useRenderParams))
{
@@ -562,8 +564,10 @@ static DerivedMesh *applyModifier(
DerivedMesh *derivedData)
{
DerivedMesh *result;
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
+
- result = doOcean(md, ctx->object, derivedData, 0);
+ result = doOcean(md, scene, ctx->object, derivedData, 0);
if (result != derivedData)
result->dirty |= DM_DIRTY_NORMALS;
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c
index 8f099c3187e..bb6ed8e8344 100644
--- a/source/blender/modifiers/intern/MOD_particleinstance.c
+++ b/source/blender/modifiers/intern/MOD_particleinstance.c
@@ -54,6 +54,7 @@
#include "BKE_pointcache.h"
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
static void initData(ModifierData *md)
{
@@ -202,6 +203,7 @@ static Mesh *applyModifier(
{
Mesh *result;
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
+ struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
ParticleSimulationData sim;
ParticleSystem *psys = NULL;
ParticleData *pa = NULL;
@@ -247,7 +249,7 @@ static Mesh *applyModifier(
return mesh;
sim.depsgraph = ctx->depsgraph;
- sim.scene = md->scene;
+ sim.scene = scene;
sim.ob = pimd->ob;
sim.psys = psys;
sim.psmd = psys_get_modifier(pimd->ob, psys);
diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index cbdeeebaa04..784e44f5758 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -48,8 +48,9 @@
#include "BKE_modifier.h"
#include "BKE_particle.h"
-#include "MOD_util.h"
+#include "DEG_depsgraph_query.h"
+#include "MOD_util.h"
static void initData(ModifierData *md)
{
@@ -210,8 +211,9 @@ static void deformVerts(
}
if (!(ctx->object->transflag & OB_NO_PSYS_UPDATE)) {
+ struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
psmd->flag &= ~eParticleSystemFlag_psys_updated;
- particle_system_update(ctx->depsgraph, md->scene, ctx->object, psys, (ctx->flag & MOD_APPLY_RENDER) != 0);
+ particle_system_update(ctx->depsgraph, scene, ctx->object, psys, (ctx->flag & MOD_APPLY_RENDER) != 0);
psmd->flag |= eParticleSystemFlag_psys_updated;
}
}
diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c
index 4c10df71f92..9384f850d96 100644
--- a/source/blender/modifiers/intern/MOD_smoke.c
+++ b/source/blender/modifiers/intern/MOD_smoke.c
@@ -55,6 +55,7 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
#include "MOD_modifiertypes.h"
@@ -108,10 +109,12 @@ static DerivedMesh *applyModifier(
{
SmokeModifierData *smd = (SmokeModifierData *) md;
- if (ctx->flag & MOD_APPLY_ORCO)
+ if (ctx->flag & MOD_APPLY_ORCO) {
return dm;
+ }
- return smokeModifier_do(smd, ctx->depsgraph, md->scene, ctx->object, dm);
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
+ return smokeModifier_do(smd, ctx->depsgraph, scene, ctx->object, dm);
}
static bool dependsOnTime(ModifierData *UNUSED(md))
diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c
index 30f9829ae20..126c99a2d69 100644
--- a/source/blender/modifiers/intern/MOD_softbody.c
+++ b/source/blender/modifiers/intern/MOD_softbody.c
@@ -51,12 +51,13 @@
#include "MOD_modifiertypes.h"
static void deformVerts(
- ModifierData *md, const ModifierEvalContext *ctx,
+ ModifierData *UNUSED(md), const ModifierEvalContext *ctx,
Mesh *UNUSED(derivedData),
float (*vertexCos)[3],
int numVerts)
{
- sbObjectStep(ctx->depsgraph, md->scene, ctx->object, DEG_get_ctime(ctx->depsgraph), vertexCos, numVerts);
+ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
+ sbObjectStep(ctx->depsgraph, scene, ctx->object, DEG_get_ctime(ctx->depsgraph), vertexCos, numVerts);
}
static bool dependsOnTime(ModifierData *UNUSED(md))
diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c
index 2fd0aaccdc9..a6781cccb50 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -46,6 +46,7 @@
#include "BKE_colortools.h"
#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
#include "RE_shader_ext.h"
@@ -271,9 +272,10 @@ static void warpModifier_do(
fac *= weight;
if (tex_co) {
+ struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
TexResult texres;
texres.nor = NULL;
- BKE_texture_get_value(wmd->modifier.scene, wmd->texture, tex_co[i], &texres, false);
+ BKE_texture_get_value(scene, wmd->texture, tex_co[i], &texres, false);
fac *= texres.tin;
}
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c
index 552746634c5..c1b85336774 100644
--- a/source/blender/modifiers/intern/MOD_wave.c
+++ b/source/blender/modifiers/intern/MOD_wave.c
@@ -265,9 +265,10 @@ static void waveModifier_do(
/*apply texture*/
if (wmd->texture) {
+ Scene *scene = DEG_get_evaluated_scene(depsgraph);
TexResult texres;
texres.nor = NULL;
- BKE_texture_get_value(wmd->modifier.scene, wmd->texture, tex_co[i], &texres, false);
+ BKE_texture_get_value(scene, wmd->texture, tex_co[i], &texres, false);
amplit *= texres.tin;
}
diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index b62422d9a33..a26cb73d823 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -47,6 +47,7 @@
#include "BKE_texture.h" /* Texture masking. */
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
#include "MEM_guardedalloc.h"
@@ -247,8 +248,9 @@ static Mesh *applyModifier(
}
/* Do masking. */
+ struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
weightvg_do_mask(ctx, numVerts, NULL, org_w, new_w, ctx->object, result, wmd->mask_constant,
- wmd->mask_defgrp_name, wmd->modifier.scene, wmd->mask_texture,
+ wmd->mask_defgrp_name, scene, wmd->mask_texture,
wmd->mask_tex_use_channel, wmd->mask_tex_mapping,
wmd->mask_tex_map_obj, wmd->mask_tex_uvlayer_name);
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c
index 2a6b240660a..90bd5acff62 100644
--- a/source/blender/modifiers/intern/MOD_weightvgmix.c
+++ b/source/blender/modifiers/intern/MOD_weightvgmix.c
@@ -45,13 +45,13 @@
#include "BKE_texture.h" /* Texture masking. */
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
#include "MEM_guardedalloc.h"
#include "MOD_weightvg_util.h"
#include "MOD_modifiertypes.h"
-
/**
* This mixes the old weight with the new weight factor.
*/
@@ -359,8 +359,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
}
/* Do masking. */
+ struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
weightvg_do_mask(ctx, numIdx, indices, org_w, new_w, ctx->object, result, wmd->mask_constant,
- wmd->mask_defgrp_name, wmd->modifier.scene, wmd->mask_texture,
+ wmd->mask_defgrp_name, scene, wmd->mask_texture,
wmd->mask_tex_use_channel, wmd->mask_tex_mapping,
wmd->mask_tex_map_obj, wmd->mask_tex_uvlayer_name);
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index c5a68525ed6..c8cd4ab911b 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -51,6 +51,7 @@
#include "BKE_texture.h" /* Texture masking. */
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
#include "MEM_guardedalloc.h"
@@ -542,8 +543,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
do_map(ob, new_w, numIdx, wmd->min_dist, wmd->max_dist, wmd->falloff_type);
/* Do masking. */
+ struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
weightvg_do_mask(ctx, numIdx, indices, org_w, new_w, ob, result, wmd->mask_constant,
- wmd->mask_defgrp_name, wmd->modifier.scene, wmd->mask_texture,
+ wmd->mask_defgrp_name, scene, wmd->mask_texture,
wmd->mask_tex_use_channel, wmd->mask_tex_mapping,
wmd->mask_tex_map_obj, wmd->mask_tex_uvlayer_name);