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:
authorAlexander Gordeev <agordeevw>2019-06-20 15:11:20 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-06-20 15:38:44 +0300
commit7d83e7a9dffe8bb24217d749c33cdb24f3b7dc49 (patch)
tree64bebedfbb1dd583f3b47b4cc7194259b64dce78 /source/blender/modifiers/intern/MOD_multires.c
parente43e278b38c87945322195757947ce22b3cc4c64 (diff)
Fix T65877: crash when baking in sculpt mode
Also fixes bug where mesh with multires modifier is invisible in render while in sculpt mode. Differential Revision: https://developer.blender.org/D5099
Diffstat (limited to 'source/blender/modifiers/intern/MOD_multires.c')
-rw-r--r--source/blender/modifiers/intern/MOD_multires.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index c61ebe0448c..c64d9be1158 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -185,7 +185,10 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
* accessible via MVert. For this reason we do not evaluate multires to
* grids when orco is requested. */
const bool for_orco = (ctx->flag & MOD_APPLY_ORCO) != 0;
- if ((ctx->object->mode & OB_MODE_SCULPT) && !for_orco) {
+ /* Needed when rendering or baking will in sculpt mode. */
+ const bool for_render = (ctx->flag & MOD_APPLY_RENDER) != 0;
+
+ if ((ctx->object->mode & OB_MODE_SCULPT) && !for_orco && !for_render) {
/* NOTE: CCG takes ownership over Subdiv. */
result = multires_as_ccg(mmd, ctx, mesh, subdiv);
result->runtime.subdiv_ccg_tot_level = mmd->totlvl;