From ddb843a1acc3b6f255906d4b69fb5f3194c586b0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 15 Aug 2014 12:50:21 +0600 Subject: Fix T41443: Separate bug with Curves & Hooks This solves the crash, but indices might be wrong after the separation. There are loads of other ways to confuse hook indices in both meshes and curves, for now considering this a TODO. --- source/blender/editors/curve/editcurve.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender') diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index b0371b8dd6c..f3a6dfb2d35 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1238,9 +1238,18 @@ static void remap_hooks_and_vertex_parents(Object *obedit) { Object *object; Curve *curve = (Curve *) obedit->data; + EditNurb *editnurb = curve->editnurb; int *old_to_new_map = NULL; int old_totvert; + if (editnurb->keyindex == NULL) { + /* TODO(sergey): Happens when separating curves, this would lead to + * the wrong indices in the hook modifier, address this together with + * other indices issues. + */ + return; + } + for (object = G.main->object.first; object; object = object->id.next) { ModifierData *md; int index; -- cgit v1.2.3