Depsgraph: preserve memory caches for particles when creating Copy-on-Write

Solves issue with particle memory cache ignored.

Thanks Bastien for review!
This commit is contained in:
Sergey Sharybin 2018-05-28 18:05:28 +02:00
parent 2f56bf3535
commit d2f8b48f01
2 changed files with 6 additions and 6 deletions

View File

@ -891,8 +891,7 @@ ParticleSystem *BKE_object_copy_particlesystem(ParticleSystem *psys, const int f
BLI_listbase_clear(&psysn->pathcachebufs);
BLI_listbase_clear(&psysn->childcachebufs);
/* XXX Never copy caches here? */
psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches, flag & ~LIB_ID_COPY_CACHES);
psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches, flag);
/* XXX - from reading existing code this seems correct but intended usage of
* pointcache should /w cloth should be added in 'ParticleSystem' - campbell */

View File

@ -277,10 +277,11 @@ bool id_copy_inplace_no_main(const ID *id, ID *newid)
bool result = BKE_id_copy_ex(NULL,
(ID *)id_for_copy,
&newid,
LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_ALLOCATE |
LIB_ID_CREATE_NO_DEG_TAG,
(LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_ALLOCATE |
LIB_ID_CREATE_NO_DEG_TAG |
LIB_ID_COPY_CACHES),
false);
#ifdef NESTED_ID_NASTY_WORKAROUND