Particle edit: Allow children to be visible in edit mode
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 15 May 2018 10:46:33 +0000 (12:46 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 15 May 2018 15:20:02 +0000 (17:20 +0200)
Follows tool settings, tested without copy-on-write.

Enabling copy-on-write still needs verification and likely some fixing.

source/blender/draw/intern/draw_manager.c

index 8f7097a8bc069a279529c7a715a62c927f3781c8..8c7435bdd1fba9fc237feac2d52fd43b6a4e5078 100644 (file)
@@ -226,12 +226,23 @@ bool DRW_check_psys_visible_within_active_context(
         struct ParticleSystem *psys)
 {
        const DRWContextState *draw_ctx = DRW_context_state_get();
+       const Scene *scene = draw_ctx->scene;
        if (object == draw_ctx->object_edit) {
                return false;
        }
+       const ParticleSettings *part = psys->part;
+       const ParticleEditSettings *pset = &scene->toolsettings->particle;
        if (object->mode == OB_MODE_PARTICLE_EDIT) {
                if (psys_in_edit_mode(draw_ctx->depsgraph, psys)) {
-                       return false;
+                       if ((pset->flag & PE_DRAW_PART) == 0) {
+                               return false;
+                       }
+                       if ((part->childtype == 0) &&
+                           (psys->flag & PSYS_HAIR_DYNAMICS &&
+                            psys->pointcache->flag & PTCACHE_BAKED)==0)
+                       {
+                               return false;
+                       }
                }
        }
        return true;