diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-08 18:10:42 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-09 11:34:45 +0300 |
commit | afdc5c148bc16191be612a0a7770ee167196c039 (patch) | |
tree | 01cb0d709d5526d689e5ff16d7fc898c2d76439f /source/blender/editors/physics | |
parent | 43c6ba9eeddc7fbe3875b73e4ae74920f4afd10b (diff) |
Draw manager: Use utility function to get particle edit mode
Makes it more local where we have to do all the tricky checks.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index d343264c2c9..78ee8939de5 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -189,6 +189,23 @@ static float pe_brush_size_get(const Scene *UNUSED(scene), ParticleBrushData *br return brush->size * U.pixelsize; } +PTCacheEdit *PE_get_current_from_psys(ParticleSystem *psys) +{ + if (psys->part && psys->part->type == PART_HAIR) { + if ((psys->flag & PSYS_HAIR_DYNAMICS) != 0 && + (psys->pointcache->flag & PTCACHE_BAKED) != 0) + { + return psys->pointcache->edit; + } + else { + return psys->edit; + } + } + else if (psys->pointcache->flag & PTCACHE_BAKED) { + return psys->pointcache->edit; + } + return NULL; +} /* always gets at least the first particlesystem even if PSYS_CURRENT flag is not set * |