From 8e08e323a7cf302b59e90077594caef7db725c57 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 18 Dec 2018 13:48:25 +0100 Subject: 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 --- source/blender/draw/intern/draw_cache_impl_particles.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c') 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; -- cgit v1.2.3