Fix for bug #11758: crash cancelling hair softbody bake.

Fix for bug #11966: crash in hair softbody with hair amount 0.
This commit is contained in:
2008-05-22 13:58:16 +00:00
parent 5cf41da316
commit be1cb6e5e2
2 changed files with 7 additions and 3 deletions

View File

@@ -2401,8 +2401,11 @@ void psys_cache_paths(Object *ob, ParticleSystem *psys, float cfra, int editupda
psys->pathcache= cache;
}
if(edit==NULL && psys->soft && psys->softflag & OB_SB_ENABLE)
if(edit==NULL && psys->soft && psys->softflag & OB_SB_ENABLE) {
soft = psys->soft;
if(!soft->bpoint)
soft= NULL;
}
psys->lattice = psys_get_lattice(ob, psys);
ma= give_current_material(ob, psys->part->omat);

View File

@@ -3390,8 +3390,9 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
int a;
/* update the vertex locations */
if(sb->particles) {
if(sb->particles && sb->particles->totpart>0) {
psmd= psys_get_modifier(ob,sb->particles);
pa= sb->particles->particles;
key= pa->hair;
@@ -3434,7 +3435,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
float hairmat[4][4];
int a;
if(sb->particles) {
if(sb->particles && sb->particles->totpart>0) {
psmd= psys_get_modifier(ob, sb->particles);
pa= sb->particles->particles;
key= pa->hair;