[Bf-blender-cvs] [ddb843a] master: Fix T41443: Separate bug with Curves & Hooks

Sergey Sharybin noreply at git.blender.org
Fri Aug 15 08:51:32 CEST 2014


Commit: ddb843a1acc3b6f255906d4b69fb5f3194c586b0
Author: Sergey Sharybin
Date:   Fri Aug 15 12:50:21 2014 +0600
Branches: master
https://developer.blender.org/rBddb843a1acc3b6f255906d4b69fb5f3194c586b0

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.

===================================================================

M	source/blender/editors/curve/editcurve.c

===================================================================

diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index b0371b8..f3a6dfb 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;




More information about the Bf-blender-cvs mailing list