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
This commit is contained in:
Janusch Patas 2020-10-15 09:32:13 +02:00 committed by Bastien Montagne
parent 7b951ba5c3
commit 1cc3abca70
Notes: blender-bot 2023-02-14 01:52:41 +01:00
Referenced by issue #80768, Subdivision Surface modifier uses viewport subdivision settings when rendering in edit mode
1 changed files with 3 additions and 1 deletions

View File

@ -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