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:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-05-18 18:31:59 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-05-22 18:08:57 +0300
commite89fa4c85b8e249465158215ade49e3726a0e7a0 (patch)
tree93d3ff0c2dc7e967e113fa6729d9295b90a00e9f /source/blender/blenkernel/intern/effect.c
parent6953c57d2c9317f46387b3a80c1b68108c2c0dfa (diff)
Cloth Modifier: get time from depsgraph instead of scene
Diffstat (limited to 'source/blender/blenkernel/intern/effect.c')
-rw-r--r--source/blender/blenkernel/intern/effect.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 00c1c82bae8..bdf6e84a3b1 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -261,7 +261,8 @@ void pdEndEffectors(ListBase **effectors)
static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *eff)
{
- unsigned int cfra = (unsigned int)(eff->scene->r.cfra >= 0 ? eff->scene->r.cfra : -eff->scene->r.cfra);
+ float ctime = DEG_get_ctime(depsgraph);
+ unsigned int cfra = (unsigned int)(ctime >= 0 ? ctime : -ctime);
if (!eff->pd->rng)
eff->pd->rng = BLI_rng_new(eff->pd->seed + cfra);
else
@@ -286,7 +287,7 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef
eff->flag |= PE_USE_NORMAL_DATA;
}
else if (eff->psys)
- psys_update_particle_tree(eff->psys, eff->scene->r.cfra);
+ psys_update_particle_tree(eff->psys, ctime);
/* Store object velocity */
if (eff->ob) {
@@ -556,7 +557,7 @@ int closest_point_on_surface(SurfaceModifierData *surmd, const float co[3], floa
}
int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, int real_velocity)
{
- float cfra = eff->scene->r.cfra;
+ float cfra = DEG_get_ctime(eff->depsgraph);
int ret = 0;
/* In case surface object is in Edit mode when loading the .blend, surface modifier is never executed