diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-25 14:25:43 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-25 14:25:43 +0400 |
commit | deb3999696cbcbe19ace96f334477a985e835060 (patch) | |
tree | c27ff6398f6669c4c2e24a27f5fb7963707e94e7 /source/blender/blenkernel/intern/lattice.c | |
parent | da64e8ae0551b85760855b5b5bdfdb2673985223 (diff) |
Fix T40776: Crash when using empty curve as a deformation target
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r-- | source/blender/blenkernel/intern/lattice.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 7b91945c23c..ea55f32ea05 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -626,16 +626,19 @@ static bool calc_curve_deform(Scene *scene, Object *par, float co[3], short index; const bool is_neg_axis = (axis > 2); - /* to be sure, mostly after file load */ - if (ELEM(NULL, par->curve_cache, par->curve_cache->path)) { + /* to be sure, mostly after file load, also cyclic dependencies */ #ifdef CYCLIC_DEPENDENCY_WORKAROUND + if (par->curve_cache == NULL) { BKE_displist_make_curveTypes(scene, par, false); + } #endif - if (par->curve_cache->path == NULL) { - return 0; // happens on append and cyclic dependencies... - } + + if (par->curve_cache->path == NULL) { + return 0; /* happens on append, cyclic dependencies + * and empty curves + */ } - + /* options */ if (is_neg_axis) { index = axis - 3; |