Fix T61770 Multiple Hair Systems Not visible while in particle edit mode
authorClément Foucault <foucault.clem@gmail.com>
Wed, 10 Jul 2019 12:43:58 +0000 (14:43 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 10 Jul 2019 12:44:09 +0000 (14:44 +0200)
The check was for the whole object instead of individual particle system.

source/blender/draw/intern/draw_cache_impl_particles.c

index 9e25c5168cc91a103c01d13528447f10402eac14..6cd03d14bfdbe429d1e20439cd6fb6a4c0f0b236 100644 (file)
@@ -1445,11 +1445,12 @@ static void drw_particle_get_hair_source(Object *object,
                                          PTCacheEdit *edit,
                                          ParticleDrawSource *r_draw_source)
 {
+  const DRWContextState *draw_ctx = DRW_context_state_get();
   r_draw_source->object = object;
   r_draw_source->psys = psys;
   r_draw_source->md = md;
   r_draw_source->edit = edit;
-  if ((object->mode & OB_MODE_PARTICLE_EDIT) != 0) {
+  if (psys_in_edit_mode(draw_ctx->depsgraph, psys)) {
     r_draw_source->object = DEG_get_original_object(object);
     r_draw_source->psys = psys_orig_get(psys);
   }