[Bf-blender-cvs] [f085584] fracture_modifier: fix: do not write shards with only 1 vertex, this causes problems when loading the file afterwards, omitting those shards and islands seems not having a negative effect up to now

Martin Felke noreply at git.blender.org
Mon Feb 9 14:24:39 CET 2015


Commit: f085584c717a8992db203bd0fb7b5242e6e1cfce
Author: Martin Felke
Date:   Mon Feb 9 14:11:48 2015 +0100
Branches: fracture_modifier
https://developer.blender.org/rBf085584c717a8992db203bd0fb7b5242e6e1cfce

fix: do not write shards with only 1 vertex, this causes problems when loading the file afterwards, omitting those shards and islands seems not having a negative effect up to now

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

M	source/blender/blenloader/intern/writefile.c

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

diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index cf20220..a781b44 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1650,15 +1650,18 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
 					writestruct(wd, DATA, "FracMesh", 1, fm);
 
 					for (s = fm->shard_map.first; s; s = s->next) {
-						write_shard(wd, s);
+						if (s->totvert > 1)
+							write_shard(wd, s);
 					}
 
 					for (s = fmd->islandShards.first; s; s = s->next) {
-						write_shard(wd, s);
+						if (s->totvert > 1)
+							write_shard(wd, s);
 					}
 
 					for (mi = fmd->meshIslands.first; mi; mi = mi->next) {
-						write_meshIsland(wd, mi);
+						if (mi->vertex_count > 1)
+							write_meshIsland(wd, mi);
 					}
 				}
 			}




More information about the Bf-blender-cvs mailing list