[Bf-blender-cvs] [9481e660a5c] particle-solver-dev: Fixed crash when creating a new particle system with any colliders
Sebastian Parborg
noreply at git.blender.org
Thu Jun 25 15:56:04 CEST 2020
Commit: 9481e660a5cf2689c477622d2b3fdfebd269fbdc
Author: Sebastian Parborg
Date: Thu Jun 25 15:55:44 2020 +0200
Branches: particle-solver-dev
https://developer.blender.org/rB9481e660a5cf2689c477622d2b3fdfebd269fbdc
Fixed crash when creating a new particle system with any colliders
===================================================================
M source/blender/simulations/bparticles/simulate.cpp
===================================================================
diff --git a/source/blender/simulations/bparticles/simulate.cpp b/source/blender/simulations/bparticles/simulate.cpp
index a7d6ce4a289..ec29e1ab480 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -640,7 +640,10 @@ BLI_NOINLINE static void simulate_particles_for_time_span(SimulationState &simul
ListBase *coll_list = BKE_collider_cache_create(simulation_state.m_depsgraph, NULL, NULL);
// Convert list to vector for speed, easier debugging, and type safety
- Vector<ColliderCache *> colliders(*coll_list, true);
+ Vector<ColliderCache *> colliders;
+ if (coll_list != NULL) {
+ colliders = Vector<ColliderCache *>(*coll_list, true);
+ }
BLI::blocked_parallel_for(IndexRange(particle_attributes.size()), 1000, [&](IndexRange range) {
Array<float> remaining_durations(range.size(), time_span.size());
@@ -669,7 +672,10 @@ BLI_NOINLINE static void simulate_particles_from_birth_to_end_of_step(
ListBase *coll_list = BKE_collider_cache_create(simulation_state.m_depsgraph, NULL, NULL);
// Convert list to vector for speed, easier debugging, and type safety
- Vector<ColliderCache *> colliders(*coll_list, true);
+ Vector<ColliderCache *> colliders;
+ if (coll_list != NULL) {
+ colliders = Vector<ColliderCache *>(*coll_list, true);
+ }
BLI::blocked_parallel_for(IndexRange(particle_attributes.size()), 1000, [&](IndexRange range) {
ArrayRef<float> birth_times = all_birth_times.slice(range);
More information about the Bf-blender-cvs
mailing list