diff options
author | Janusch Patas <patjan> | 2020-10-15 10:32:13 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-15 10:46:22 +0300 |
commit | 1cc3abca701775e0ddb0756a262df99b8e7a0276 (patch) | |
tree | 9ce2f515c216a06464d2af9d6a35077f0c99d71d | |
parent | 7b951ba5c32a5b78a958e22aa310e7489b39ae00 (diff) |
Fix T80768: Subdivision Surface modifier uses viewport subdivision settings when rendering in edit mode
Being in render 'context'was not taken into account in code evaluating
modifiers for meshes in Edit mode.
Reviewed By: #modeling, mont29
Differential Revision: https://developer.blender.org/D9217
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 88d8073b989..d551eaf04e4 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1488,8 +1488,10 @@ static void editbmesh_calc_modifiers(struct Depsgraph *depsgraph, /* Modifier evaluation modes. */ const int required_mode = eModifierMode_Realtime | eModifierMode_Editmode; + const bool use_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER); /* Modifier evaluation contexts for different types of modifiers. */ - const ModifierEvalContext mectx = {depsgraph, ob, MOD_APPLY_USECACHE}; + ModifierApplyFlag apply_render = use_render ? MOD_APPLY_RENDER : 0; + const ModifierEvalContext mectx = {depsgraph, ob, MOD_APPLY_USECACHE | apply_render}; const ModifierEvalContext mectx_orco = {depsgraph, ob, MOD_APPLY_ORCO}; /* Get effective list of modifiers to execute. Some effects like shape keys |