Particle edit: Make visibility check to be per-particle system
This way we can see other particle systems while combing another one.
This commit is contained in:
@@ -140,30 +140,27 @@ static void basic_cache_populate(void *vedata, Object *ob)
|
||||
{
|
||||
BASIC_StorageList *stl = ((BASIC_Data *)vedata)->stl;
|
||||
|
||||
if (!DRW_object_is_renderable(ob))
|
||||
return;
|
||||
|
||||
if (!DRW_check_particles_visible_within_active_context(ob)) {
|
||||
if (!DRW_object_is_renderable(ob)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
if (ob == draw_ctx->object_edit) {
|
||||
return;
|
||||
}
|
||||
|
||||
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 (draw_as == PART_DRAW_PATH && !psys->pathcache && !psys->childcache) {
|
||||
draw_as = PART_DRAW_DOT;
|
||||
}
|
||||
|
||||
if (draw_as == PART_DRAW_PATH) {
|
||||
struct Gwn_Batch *hairs = DRW_cache_particles_get_hair(psys, NULL);
|
||||
DRW_shgroup_call_add(stl->g_data->depth_shgrp, hairs, NULL);
|
||||
}
|
||||
}
|
||||
for (ParticleSystem *psys = ob->particlesystem.first; psys; psys = psys->next) {
|
||||
if (!psys_check_enabled(ob, psys, false)) {
|
||||
continue;
|
||||
}
|
||||
if (!DRW_check_psys_visible_within_active_context(ob, psys)) {
|
||||
return;
|
||||
}
|
||||
ParticleSettings *part = psys->part;
|
||||
const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
|
||||
if (draw_as == PART_DRAW_PATH) {
|
||||
struct Gwn_Batch *hairs = DRW_cache_particles_get_hair(psys, NULL);
|
||||
DRW_shgroup_call_add(stl->g_data->depth_shgrp, hairs, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user