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.
This commit is contained in:
Sergey Sharybin 2014-08-15 12:50:21 +06:00
parent 2b796ed03d
commit ddb843a1ac
Notes: blender-bot 2023-02-14 10:13:00 +01:00
Referenced by issue #41443, Seperate bug with Curves & Hooks
1 changed files with 9 additions and 0 deletions

View File

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