diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-07-22 15:27:54 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-07-22 15:27:54 +0400 |
commit | 33cb2f93ff2e02ac45c20e6b4251a48600a83cb0 (patch) | |
tree | 998ac717cc43380c6ae2c0c9e19f1d1a2d167c58 /source/blender/modifiers/intern/MOD_multires.c | |
parent | aa2f0b1e429c8de23e8de1423d875ac1b462e516 (diff) |
Fix #22661: Multires/Sculpt Segfult
- Show error message in multires modifier if there is no MDISPS layer
- Sculpt on basis mesh if there is no the same layer
Diffstat (limited to 'source/blender/modifiers/intern/MOD_multires.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_multires.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index 71e31656799..766a3756d4a 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -38,6 +38,8 @@ #include "BKE_paint.h" #include "BKE_particle.h" +#include "DNA_mesh_types.h" + static void initData(ModifierData *md) { MultiresModifierData *mmd = (MultiresModifierData*)md; @@ -66,6 +68,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, int sculpting= (ob->mode & OB_MODE_SCULPT) && ss; MultiresModifierData *mmd = (MultiresModifierData*)md; DerivedMesh *result; + Mesh *me= (Mesh*)ob->data; + + if(mmd->totlvl) { + if(!CustomData_get_layer(&me->fdata, CD_MDISPS)) { + /* multires can't work without displacement layer */ + modifier_setError(md, "Modifier needs mesh with displacement data."); + return dm; + } + } result = multires_dm_create_from_derived(mmd, 0, dm, ob, useRenderParams, isFinalCalc); |