[Bf-blender-cvs] [f16d7f4] fracture_modifier: fix for external FM mode, take object locations into account as centroids for physics shapes, too

Martin Felke noreply at git.blender.org
Thu Dec 22 03:05:52 CET 2016


Commit: f16d7f481f887ee0957d73c0d27ba339e5d30009
Author: Martin Felke
Date:   Thu Dec 22 03:05:34 2016 +0100
Branches: fracture_modifier
https://developer.blender.org/rBf16d7f481f887ee0957d73c0d27ba339e5d30009

fix for external FM mode, take object locations into account as centroids for physics shapes, too

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

M	source/blender/blenkernel/intern/fracture.c

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

diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index b39a883..0147f5b 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -2837,7 +2837,12 @@ MeshIsland* BKE_fracture_mesh_island_add(FractureModifierData *fmd, Object* own,
 	if (target->type != OB_MESH || !target->data)
 		return NULL;
 
+	//lets see whether we need to add loc here too XXX TODO
+	mat4_to_loc_quat(loc, quat, target->obmat);
+
 	s = fracture_object_to_shard(own, target);
+	copy_v3_v3(s->centroid, loc);
+
 	fracture_update_shards(fmd, s);
 
 	vertstart = fmd->frac_mesh->progress_counter;
@@ -2846,9 +2851,6 @@ MeshIsland* BKE_fracture_mesh_island_add(FractureModifierData *fmd, Object* own,
 	//hrm need to rebuild ALL islands since vertex refs are bonkers now after mesh has changed
 	mi = fracture_shard_to_island(fmd, s, vertstart);
 
-	//lets see whether we need to add loc here too XXX TODO
-	mat4_to_loc_quat(loc, quat, target->obmat);
-
 	copy_qt_qt(mi->rot, quat);
 	copy_v3_v3(mi->centroid, loc);




More information about the Bf-blender-cvs mailing list