Cleanup: use braces w/ particle loop macros

This commit is contained in:
Campbell Barton 2018-08-14 10:14:05 +10:00
parent 98f4a8eedf
commit c29c426925
2 changed files with 24 additions and 14 deletions

View File

@ -169,8 +169,9 @@ void psys_reset(ParticleSystem *psys, int mode)
}
else if (mode == PSYS_RESET_CACHE_MISS) {
/* set all particles to be skipped */
LOOP_PARTICLES
LOOP_PARTICLES {
pa->flag |= PARS_NO_DISP;
}
}
/* reset children */
@ -273,8 +274,9 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
psys->totpart=totpart;
if (newboids) {
LOOP_PARTICLES
LOOP_PARTICLES {
pa->boid = newboids++;
}
}
}
@ -4129,14 +4131,16 @@ void psys_check_boid_data(ParticleSystem *psys)
if (!pa->boid) {
bpa = MEM_callocN(psys->totpart * sizeof(BoidParticle), "Boid Data");
LOOP_PARTICLES
LOOP_PARTICLES {
pa->boid = bpa++;
}
}
}
else if (pa->boid) {
MEM_freeN(pa->boid);
LOOP_PARTICLES
LOOP_PARTICLES {
pa->boid = NULL;
}
}
}

View File

@ -1141,25 +1141,29 @@ static void PE_update_selection(Main *bmain, Scene *scene, Object *ob, int usefl
/* flag all particles to be updated if not using flag */
if (!useflag)
LOOP_POINTS
point->flag |= PEP_EDIT_RECALC;
LOOP_POINTS {
point->flag |= PEP_EDIT_RECALC;
}
/* flush edit key flag to hair key flag to preserve selection
* on save */
if (edit->psys) LOOP_POINTS {
if (edit->psys) {
LOOP_POINTS {
hkey = edit->psys->particles[p].hair;
LOOP_KEYS {
hkey->editflag = key->flag;
hkey++;
}
}
}
psys_cache_edit_paths(scene, ob, edit, CFRA, G.is_rendering);
psys_cache_edit_paths(scene, ob, edit, CFRA, G.is_rendering);
/* disable update flag */
LOOP_POINTS
point->flag &= ~PEP_EDIT_RECALC;
LOOP_POINTS {
point->flag &= ~PEP_EDIT_RECALC;
}
}
void update_world_cos(Object *ob, PTCacheEdit *edit)
@ -1894,8 +1898,9 @@ static int hide_exec(bContext *C, wmOperator *op)
point->flag |= PEP_HIDE;
point->flag |= PEP_EDIT_RECALC;
LOOP_KEYS
key->flag &= ~PEK_SELECT;
LOOP_KEYS {
key->flag &= ~PEK_SELECT;
}
}
}
else {
@ -1903,8 +1908,9 @@ static int hide_exec(bContext *C, wmOperator *op)
point->flag |= PEP_HIDE;
point->flag |= PEP_EDIT_RECALC;
LOOP_KEYS
key->flag &= ~PEK_SELECT;
LOOP_KEYS {
key->flag &= ~PEK_SELECT;
}
}
}