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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user