[Bf-blender-cvs] [05e4103ba44] fracture_modifier: fix for material assignment when converting back to objects

Martin Felke noreply at git.blender.org
Wed Jun 7 16:09:16 CEST 2017


Commit: 05e4103ba44c11334cb102d42d244471a6a65465
Author: Martin Felke
Date:   Wed Jun 7 16:08:55 2017 +0200
Branches: fracture_modifier
https://developer.blender.org/rB05e4103ba44c11334cb102d42d244471a6a65465

fix for material assignment when converting back to objects

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

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

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

diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index 84df17c7843..642aeae925b 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -2845,7 +2845,7 @@ int BKE_fracture_update_visual_mesh(FractureModifierData *fmd, Object *ob, bool
 		defstart += mi->totdef;
 
 		totpoly = mi->physics_mesh->getNumPolys(mi->physics_mesh);
-		ppoly = s->mpoly;
+		ppoly = mi->physics_mesh->getPolyArray(mi->physics_mesh);
 		for (j = 0, mp = mpoly + polystart, pp = ppoly; j < totpoly; j++, mp++, pp++)
 		{
 			/* material index lookup and correction, avoid having the same material in different slots */
@@ -2931,9 +2931,10 @@ MeshIsland* BKE_fracture_mesh_island_add(FractureModifierData *fmd, Object* own,
 {
 	MeshIsland *mi;
 	Shard *s;
-	int vertstart = 0;
+	int vertstart = 0, totpoly = 0, i = 0;
 	short totcol = 0, totdef = 0;
 	float loc[3], quat[4];
+	MPoly *mpoly, *mp;
 
 	if (fmd->fracture_mode != MOD_FRACTURE_EXTERNAL || own->type != OB_MESH || !own->data)
 		return NULL;




More information about the Bf-blender-cvs mailing list