fix T50899: Even though the Shrinkwrap options hide the possibility of using a non-mesh target, you can still circumvent this... Causing Crash

This commit is contained in:
Germano Cavalcante 2017-03-10 13:51:04 -03:00
parent 103ae04fbc
commit a81ea40836
Notes: blender-bot 2023-02-14 07:09:34 +01:00
Referenced by commit b6713dcbe5, rBa81ea408367abe2f33b351ff6dcc6b09170fd088 "object" -> "target"
Referenced by issue #50899, Blender : Mesh to Curve : Hard crash when target mesh has a object shrinkwrapped to it
1 changed files with 7 additions and 2 deletions

View File

@ -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;