diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-07-16 21:55:46 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-07-16 21:55:46 +0400 |
commit | d54a014963dd3a90972e0bf9d83df76aef08bb25 (patch) | |
tree | cddac311c3ab742ea9a2c8507d655efb644df591 /source/blender/editors/object/object_bake.c | |
parent | 2d8c1e60e695df3f001f0181bea845a356e14b47 (diff) |
Fixed crash of multires baker when baking from sculpt mode.
Incorrect low level was used for this case -- it should be
sculpt level, not preview level.
Thanks to Morten Mikkelsen to point on this bug :)
Diffstat (limited to 'source/blender/editors/object/object_bake.c')
-rw-r--r-- | source/blender/editors/object/object_bake.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 57f6c9de88e..bdd911d68ee 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -966,9 +966,10 @@ static DerivedMesh *multiresbake_create_loresdm(Scene *scene, Object *ob, int *l MultiresModifierData *mmd= get_multires_modifier(scene, ob, 0); Mesh *me= (Mesh*)ob->data; - *lvl= mmd->lvl; + if(ob->mode==OB_MODE_SCULPT) *lvl= mmd->sculptlvl; + else *lvl= mmd->lvl; - if(mmd->lvl==0) { + if(*lvl==0) { DerivedMesh *tmp_dm= CDDM_from_mesh(me, ob); dm= CDDM_copy(tmp_dm); tmp_dm->release(tmp_dm); @@ -976,7 +977,7 @@ static DerivedMesh *multiresbake_create_loresdm(Scene *scene, Object *ob, int *l MultiresModifierData tmp_mmd= *mmd; DerivedMesh *cddm= CDDM_from_mesh(me, ob); - tmp_mmd.lvl= mmd->lvl; + tmp_mmd.lvl= *lvl; dm= multires_dm_create_from_derived(&tmp_mmd, 1, cddm, ob, 0, 0); cddm->release(cddm); } |