diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2017-03-10 19:51:04 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2017-03-10 19:51:04 +0300 |
commit | a81ea408367abe2f33b351ff6dcc6b09170fd088 (patch) | |
tree | fcd53ee6ab26785f6a8bb61dda2cb7c23ebe5ce6 /source | |
parent | 103ae04fbc90830f643581514c1fe21e271f7424 (diff) |
fix T50899: Even though the Shrinkwrap options hide the possibility of using a non-mesh target, you can still circumvent this... Causing Crash
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/shrinkwrap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 7094d5a3547..afb3aa7e15e 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -588,8 +588,13 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM DerivedMesh *ss_mesh = NULL; ShrinkwrapCalcData calc = NULL_ShrinkwrapCalcData; - /* remove loop dependencies on derived meshes (TODO should this be done elsewhere?) */ - if (smd->target == ob) smd->target = NULL; + /* remove loop dependencies on derived meshes (TODO should this be done elsewhere?) + * This also ensure the object is of type OBJ_MESH avoiding crash in `object_get_derived_final` (see T50899). */ + if (smd->target) { + if (smd->target->type != OB_MESH || smd->target == ob) { + smd->target = NULL; + } + } if (smd->auxTarget == ob) smd->auxTarget = NULL; |