Fix RigidBodyWorld copy using `NO_MAIN` instead of `COW` flag for cache handling.
We only want to share caches in case of CoW copying for the depsgraph, not for regular `NO_MAIN` data.
This commit is contained in:
parent
1a72744ddc
commit
d754d85845
|
@ -1211,8 +1211,8 @@ RigidBodyWorld *BKE_rigidbody_world_copy(RigidBodyWorld *rbw, const int flag)
|
|||
id_us_plus((ID *)rbw_copy->constraints);
|
||||
}
|
||||
|
||||
if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) {
|
||||
/* This is a regular copy, and not a CoW copy for depsgraph evaluation */
|
||||
if ((flag & LIB_ID_COPY_SET_COPIED_ON_WRITE) == 0) {
|
||||
/* This is a regular copy, and not a CoW copy for depsgraph evaluation. */
|
||||
rbw_copy->shared = MEM_callocN(sizeof(*rbw_copy->shared), "RigidBodyWorld_Shared");
|
||||
BKE_ptcache_copy_list(&rbw_copy->shared->ptcaches, &rbw->shared->ptcaches, LIB_ID_COPY_CACHES);
|
||||
rbw_copy->shared->pointcache = rbw_copy->shared->ptcaches.first;
|
||||
|
|
Loading…
Reference in New Issue