diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-07-08 19:41:27 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-07-08 19:41:27 +0300 |
commit | be5911571e81cd05548082078321660b64249c61 (patch) | |
tree | ecee63fce61c5ee7a3becd74b4799d14df5964c8 /source | |
parent | 45761e4c7cbbed2141afc97fb20b2bf26ce19ac2 (diff) |
Revert "Revert "Fix T63447 Particle system: No particles after switching from hair to ...""
This reverts commit 45761e4c7cbbed2141afc97fb20b2bf26ce19ac2.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 3fec9d59df4..9fc11e4f36f 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -3277,7 +3277,12 @@ static void OBJECT_cache_populate_particles(OBJECT_Shaders *sh_data, 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) { + if (part->type == PART_HAIR) { + /* Hairs should have been rendered by the render engine.*/ + continue; + } + + if (!ELEM(draw_as, PART_DRAW_NOT, PART_DRAW_OB, PART_DRAW_GR)) { struct GPUBatch *geom = DRW_cache_particles_get_dots(ob, psys); DRWShadingGroup *shgrp = NULL; struct GPUBatch *shape = NULL; @@ -3287,6 +3292,7 @@ static void OBJECT_cache_populate_particles(OBJECT_Shaders *sh_data, Material *ma = give_current_material(ob, part->omat); switch (draw_as) { + default: case PART_DRAW_DOT: shgrp = DRW_shgroup_create(sh_data->part_dot, psl->particle); DRW_shgroup_uniform_vec3(shgrp, "color", ma ? &ma->r : def_prim_col, 1); @@ -3321,8 +3327,6 @@ static void OBJECT_cache_populate_particles(OBJECT_Shaders *sh_data, DRW_shgroup_uniform_bool_copy(shgrp, "screen_space", false); DRW_shgroup_call_instances_with_attribs(shgrp, NULL, shape, geom); break; - default: - break; } } } |