[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50272] trunk/blender/source/blender/ editors/space_view3d/drawarmature.c: Bugfix [#32440] Segmentation fault when moving bone in pose mode when Ghost

Joshua Leung aligorith at gmail.com
Thu Aug 30 14:59:47 CEST 2012


Revision: 50272
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50272
Author:   aligorith
Date:     2012-08-30 12:59:46 +0000 (Thu, 30 Aug 2012)
Log Message:
-----------
Bugfix [#32440] Segmentation fault when moving bone in pose mode when Ghost
Around Frame is enabled

It turns out that the final "rebuild pose" at the end of each ghost drawing step
was at fault here, as it resulted in bones referring to a different set of
constraints after each ghost drawing step. However, most of the time, these new
references pointed to non-existent locations, causing the segfaults.

To fix this, I've removed this last rebuild step, which seems to work fine (no
major problems seem to arise from this). Also, to ensure that the other object
parameters have not changed (as a result of the reevaluation that needs to go
on), we now evaluate the object once more after all the ghost drawing (but
before final restore) so that object parameters (and potentially sub-data) are
all restored to their original values.

An upside of removing the final rebuild step is that "In Range" and "On
Keyframe" ghosting options now work with proxies again. Previously, trying to
move bones (but without autokey enabled) would mean that bones would snap back
to their unkeyed positions.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawarmature.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawarmature.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawarmature.c	2012-08-30 06:31:02 UTC (rev 50271)
+++ trunk/blender/source/blender/editors/space_view3d/drawarmature.c	2012-08-30 12:59:46 UTC (rev 50272)
@@ -2378,7 +2378,11 @@
 	}
 	glDisable(GL_BLEND);
 	if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
-
+	
+	/* before disposing of temp pose, use it to restore object to a sane state */
+	BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)cfrao, ADT_RECALC_ALL);
+	
+	/* clean up temporary pose */
 	ghost_poses_tag_unselected(ob, 1);      /* unhide unselected bones if need be */
 	BKE_pose_free(posen);
 	
@@ -2386,7 +2390,6 @@
 	CFRA = cfrao;
 	ob->pose = poseo;
 	arm->flag = flago;
-	BKE_pose_rebuild(ob, ob->data);
 	ob->mode |= OB_MODE_POSE;
 	ob->ipoflag = ipoflago;
 }
@@ -2457,7 +2460,11 @@
 	}
 	glDisable(GL_BLEND);
 	if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
-
+	
+	/* before disposing of temp pose, use it to restore object to a sane state */
+	BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)cfrao, ADT_RECALC_ALL);
+	
+	/* clean up temporary pose */
 	ghost_poses_tag_unselected(ob, 1);  /* unhide unselected bones if need be */
 	BLI_dlrbTree_free(&keys);
 	BKE_pose_free(posen);
@@ -2466,7 +2473,6 @@
 	CFRA = cfrao;
 	ob->pose = poseo;
 	arm->flag = flago;
-	BKE_pose_rebuild(ob, ob->data);
 	ob->mode |= OB_MODE_POSE;
 }
 
@@ -2544,7 +2550,11 @@
 	}
 	glDisable(GL_BLEND);
 	if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
-
+	
+	/* before disposing of temp pose, use it to restore object to a sane state */
+	BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)cfrao, ADT_RECALC_ALL);
+	
+	/* clean up temporary pose */
 	ghost_poses_tag_unselected(ob, 1);      /* unhide unselected bones if need be */
 	BKE_pose_free(posen);
 	
@@ -2552,7 +2562,6 @@
 	CFRA = cfrao;
 	ob->pose = poseo;
 	arm->flag = flago;
-	BKE_pose_rebuild(ob, ob->data);
 	ob->mode |= OB_MODE_POSE;
 }
 




More information about the Bf-blender-cvs mailing list