diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2018-12-18 15:48:25 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2018-12-18 16:39:45 +0300 |
commit | 8e08e323a7cf302b59e90077594caef7db725c57 (patch) | |
tree | 855611b843e39473fd87370fc70b793a47936dff /source/blender/draw/intern/draw_cache_impl_particles.c | |
parent | 8839152abf58205c9e2889721dcf14ba380b94c6 (diff) |
Fix T59484: Particles Lattice deform fails
this was working for object/collection display/render but lattice was
not taken into account for non object/collection display/render types
(halo, axis, cross, circle, ...)
Reviewers: sergey, brecht
Maniphest Tasks: T59484
Differential Revision: https://developer.blender.org/D4096
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_particles.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index d83f8fb660b..b383fcf4b92 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -44,6 +44,7 @@ #include "DNA_particle_types.h" #include "DNA_customdata_types.h" +#include "BKE_lattice.h" #include "BKE_mesh.h" #include "BKE_modifier.h" #include "BKE_particle.h" @@ -1303,6 +1304,7 @@ static void particle_batch_cache_ensure_pos( sim.ob = object; sim.psys = psys; sim.psmd = psys_get_modifier(object, psys); + sim.psys->lattice_deform_data = psys_create_lattice_deform_data(&sim); if (psys->part->phystype == PART_PHYS_KEYED) { if (psys->flag & PSYS_KEYED) { @@ -1332,17 +1334,17 @@ static void particle_batch_cache_ensure_pos( float val; - GPU_vertbuf_attr_set(point_cache->pos, pos_id, curr_point, pa->state.co); - GPU_vertbuf_attr_set(point_cache->pos, rot_id, curr_point, pa->state.rot); + GPU_vertbuf_attr_set(point_cache->pos, pos_id, curr_point, state.co); + GPU_vertbuf_attr_set(point_cache->pos, rot_id, curr_point, state.rot); switch (psys->part->draw_col) { case PART_DRAW_COL_VEL: - val = len_v3(pa->state.vel) / psys->part->color_vec_max; + val = len_v3(state.vel) / psys->part->color_vec_max; break; case PART_DRAW_COL_ACC: val = len_v3v3( - pa->state.vel, - pa->prev_state.vel) / ((pa->state.time - pa->prev_state.time) * psys->part->color_vec_max); + state.vel, + pa->prev_state.vel) / ((state.time - pa->prev_state.time) * psys->part->color_vec_max); break; default: val = -1.0f; |