diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-16 18:00:24 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-17 11:55:51 +0300 |
commit | a9b82d5d7934b554f46668260fd9bd647e6aeb0b (patch) | |
tree | bbe1c034398d6ff90b1eb7a5c7364efb6f0e7b8d /source | |
parent | 77e1942e0e1e7ef5bf36e217f5602fefe11447e1 (diff) |
Multires: Fix wrong creation of multires mesh
Should use evaluated object to query deformed mesh from.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 28ce2a1e1c0..995c8a12ebe 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -64,6 +64,8 @@ #include "CCGSubSurf.h" +#include "DEG_depsgraph_query.h" + #include <math.h> #include <string.h> @@ -300,10 +302,11 @@ Mesh *get_multires_mesh( MultiresModifierData *mmd, Object *ob) { - Mesh *deformed_mesh = mesh_get_eval_deform(depsgraph, scene, ob, CD_MASK_BAREMESH); + Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); + Mesh *deformed_mesh = mesh_get_eval_deform(depsgraph, scene, ob_eval, CD_MASK_BAREMESH); ModifierEvalContext modifier_ctx = { .depsgraph = depsgraph, - .object = ob, + .object = ob_eval, .flag = MOD_APPLY_USECACHE | MOD_APPLY_IGNORE_SIMPLIFY}; Mesh *result = modifier_applyModifier(&mmd->modifier, &modifier_ctx, deformed_mesh); if (result == deformed_mesh) { |