diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-07-08 19:00:57 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-07-08 19:09:52 +0300 |
commit | 8d6a5fb5d3c45cdfb0d06dd7f1f18aa8c870f8c1 (patch) | |
tree | 2c8d0521e8be5d60ac361f09b64edb23c8c2dfb4 /source/blender/draw/modes | |
parent | 3f6e17ddaf87ba81c73c107e5dc5504646adde96 (diff) |
Fix T63447 Particle system: No particles after switching from hair to ...
... emitter type
Diffstat (limited to 'source/blender/draw/modes')
-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; } } } |