Added back a feature from the old particle system: negative start frame.
At the moment this does mean it will compute all the frames before the point caching start frame on the first frame, which might be slow.
This commit is contained in:
@@ -4814,9 +4814,20 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
|
||||
pa->flag &= ~PARS_NO_DISP;
|
||||
}
|
||||
|
||||
/* ok now we're all set so let's go */
|
||||
if(psys->totpart)
|
||||
dynamics_step(ob,psys,psmd,cfra,vg_vel,vg_tan,vg_rot,vg_size);
|
||||
if(psys->totpart) {
|
||||
int dframe, totframesback = 0;
|
||||
|
||||
/* handle negative frame start at the first frame by doing
|
||||
* all the steps before the first frame */
|
||||
if(framenr == startframe && part->sta < startframe)
|
||||
totframesback = (startframe - (int)part->sta);
|
||||
|
||||
for(dframe=-totframesback; dframe<=0; dframe++) {
|
||||
/* ok now we're all set so let's go */
|
||||
dynamics_step(ob,psys,psmd,cfra+dframe,vg_vel,vg_tan,vg_rot,vg_size);
|
||||
psys->cfra = cfra+dframe;
|
||||
}
|
||||
}
|
||||
|
||||
cache->simframe= framenr;
|
||||
cache->flag |= PTCACHE_SIMULATION_VALID;
|
||||
|
||||
@@ -4832,7 +4832,7 @@ static void object_panel_particle_system(Object *ob)
|
||||
uiDefButS(block, NUM, B_PART_RECALC, "Segments:", butx,(buty-=buth),butw,buth, &part->hair_step, 2.0, 50.0, 0, 0, "Amount of hair segments");
|
||||
}
|
||||
else {
|
||||
uiDefButF(block, NUM, B_PART_INIT, "Sta:", butx,(buty-=buth),butw,buth, &part->sta, 1.0, part->end, 100, 1, "Frame # to start emitting particles");
|
||||
uiDefButF(block, NUM, B_PART_INIT, "Sta:", butx,(buty-=buth),butw,buth, &part->sta, -MAXFRAMEF, part->end, 100, 1, "Frame # to start emitting particles");
|
||||
uiDefButF(block, NUM, B_PART_INIT, "End:", butx,(buty-=buth),butw,buth, &part->end, part->sta, MAXFRAMEF, 100, 1, "Frame # to stop emitting particles");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user