diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-03-28 12:27:19 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-03-28 12:27:19 +0400 |
commit | e5bf21898ea7fdc9d13b4f046fcbcf16064c6df4 (patch) | |
tree | 92d9393c8eae3823005c5d44cccd33d48a7af961 /source | |
parent | 72b4bf2fda227ede4f6308f7171c4a74c22f02b8 (diff) |
Fix for [#26617] convert hair particles to mesh crash rev:35787
* Hair to mesh conversion wasn't making sure the hairs had valid keys
* Patch by Sergey Sharybin
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index b57935bc392..ff1b693d0e1 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -309,15 +309,21 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * cache= psys->pathcache; for(a=0; a<totpart; a++) { key= cache[a]; - totvert+= key->steps+1; - totedge+= key->steps; + + if(key->steps > 0) { + totvert+= key->steps+1; + totedge+= key->steps; + } } cache= psys->childcache; for(a=0; a<totchild; a++) { key= cache[a]; - totvert+= key->steps+1; - totedge+= key->steps; + + if(key->steps > 0) { + totvert+= key->steps+1; + totedge+= key->steps; + } } if(totvert==0) return 0; |