diff options
author | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-12 17:47:00 +0300 |
---|---|---|
committer | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-12 17:51:08 +0300 |
commit | 72d10c1edc735dc446e7cfd23ee7e4d670b4705c (patch) | |
tree | c7ccc71dff3e11849622082e8f8e569f43607846 /source/blender/modifiers | |
parent | bd0a9f194301392f02eb553133f0167d6b6caac2 (diff) |
adaptive_cloth: Store previous frame mesh information for remeshing
The modifier stack doesn't give the previously evaluated `Mesh`, this
means it needs to be stored within the `ClothModifierData`.
Some parts of the cloth modifier copy information from the given
`Mesh` to the `clothObject` every frame, this should not happen when
remeshing is on.
In `BKE_cloth_remesh()`, must use the previous frame mesh if available
for remeshing.
TODO: In case the user goes back a frame, must make the
`clmd->prev_frame_mesh` invalid otherwise the simulation will not know
that the simulation must be restart.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_cloth.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 2c6a4e85b93..d0036c96f71 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -87,6 +87,8 @@ static void initData(ModifierData *md) if (clmd->point_cache) { clmd->point_cache->step = 1; } + + clmd->prev_frame_mesh = NULL; } static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh) |