Clay: Cleanup, reduce indentation level

This commit is contained in:
Sergey Sharybin 2018-05-09 16:45:04 +02:00
parent 2d5fe40601
commit 37cec42e3d
1 changed files with 16 additions and 16 deletions

View File

@ -829,25 +829,25 @@ static void clay_cache_populate_particles(void *vedata, Object *ob)
CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl;
const DRWContextState *draw_ctx = DRW_context_state_get();
if (ob != draw_ctx->object_edit) {
for (ParticleSystem *psys = ob->particlesystem.first; psys; psys = psys->next) {
if (psys_check_enabled(ob, psys, false)) {
ParticleSettings *part = psys->part;
int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
if (ob == draw_ctx->object_edit) {
return;
}
if (draw_as == PART_DRAW_PATH && !psys->pathcache && !psys->childcache) {
draw_as = PART_DRAW_DOT;
}
for (ParticleSystem *psys = ob->particlesystem.first; psys; psys = psys->next) {
if (!psys_check_enabled(ob, psys, false)) {
continue;
}
ParticleSettings *part = psys->part;
int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
static float mat[4][4];
unit_m4(mat);
if (draw_as == PART_DRAW_PATH && !psys->pathcache && !psys->childcache) {
draw_as = PART_DRAW_DOT;
}
if (draw_as == PART_DRAW_PATH) {
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(psys, NULL);
DRWShadingGroup *hair_shgrp = CLAY_hair_shgrp_get(vedata, ob, stl, psl);
DRW_shgroup_call_add(hair_shgrp, geom, mat);
}
}
if (draw_as == PART_DRAW_PATH) {
struct Gwn_Batch *geom = DRW_cache_particles_get_hair(psys, NULL);
DRWShadingGroup *hair_shgrp = CLAY_hair_shgrp_get(vedata, ob, stl, psl);
DRW_shgroup_call_add(hair_shgrp, geom, NULL);
}
}
}