[Bf-blender-cvs] [32a4b43] fracture_modifier: bugfix, convert to keyframed objects didnt work when escape was used to stop the simulation before

Martin Felke noreply at git.blender.org
Sat Nov 1 17:10:26 CET 2014


Commit: 32a4b43dbcb552c91bf90372f4acf37f77cf5aaf
Author: Martin Felke
Date:   Sat Nov 1 17:10:18 2014 +0100
Branches: fracture_modifier
https://developer.blender.org/rB32a4b43dbcb552c91bf90372f4acf37f77cf5aaf

bugfix, convert to keyframed objects didnt work when escape was used to stop the simulation before

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

M	source/blender/editors/object/object_modifier.c

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

diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 6701b5d..8144b95 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -2720,8 +2720,11 @@ static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr,
 		float origmat[4][4];
 		float origloc[3];
 
-		if (G.is_break)
+		if (fmd->frac_mesh->cancel == 1)
+		{
+			fmd->frac_mesh->cancel = 0;
 			return true;
+		}
 
 		ob_new = BKE_object_add(G.main, scene, OB_MESH);
 		ob_new->parent = parent;
@@ -2822,7 +2825,12 @@ static void convert_free(void *customdata)
 static void convert_update(void *customdata)
 {
 	FractureJob *fj = customdata;
+	FractureModifierData *fmd = fj->fmd;
 	float progress;
+
+	if ((G.is_break) && (fmd->frac_mesh))
+		fmd->frac_mesh->cancel = 1;
+
 	progress = (float)(BLI_countlist(&fj->gr->gobject)) / (float)(fj->total_progress);
 	(*fj->progress) = progress;
 }
@@ -2847,6 +2855,9 @@ static void convert_startjob(void *customdata, short *stop, short *do_update, fl
 	*do_update = true;
 	*stop = 0;
 
+	if (fmd->frac_mesh)
+		fmd->frac_mesh->cancel = 0;
+
 	convert_modifier_to_keyframes(fmd, gr, ob, scene, start, end);
 }




More information about the Bf-blender-cvs mailing list