diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-14 19:33:36 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-14 19:33:54 +0300 |
commit | d3e0d7f0825fbdf503ef82e3f85b11d0faf841e8 (patch) | |
tree | 0b5f9cf3db805d5565397feecd305e8adfa8a0bf | |
parent | c7cc97c7b909358eac9b0768d1af132f9f6a706c (diff) |
Fix broken particle distribution after recent fix
-rw-r--r-- | source/blender/blenkernel/BKE_library.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_distribute.c | 3 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_util.c | 3 |
5 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index a4eb40cbb38..946cd23843d 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -81,6 +81,7 @@ enum { LIB_ID_COPY_CACHES = 1 << 18, /* Copy runtime data caches. */ LIB_ID_COPY_NO_ANIMDATA = 1 << 19, /* Don't copy id->adt, used by ID datablock localization routines. */ LIB_ID_COPY_CD_REFERENCE = 1 << 20, /* Mesh: Reference CD data layers instead of doing real copy. */ + LIB_ID_COPY_RUNTIME = 1 << 21, /* Copy ID's runtime field (for example. object->runtime). */ /* XXX Hackish/not-so-nice specific behaviors needed for some corner cases. * Ideally we should not have those, but we need them for now... */ diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 23d431b9325..84585d3bd64 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -518,13 +518,14 @@ static int id_copy_libmanagement_cb(void *user_data, ID *UNUSED(id_self), ID **i return IDWALK_RET_NOP; } -static void id_copy_clear_runtime_if_needed(ID *id, int UNUSED(flag)) +static void id_copy_clear_runtime_if_needed(ID *id, int flag) { if (id == NULL) { return; } - /* TODO(sergey): Think of having a flag which will allow to share runtime - * fields of the ID.*/ + if (flag & LIB_ID_COPY_RUNTIME) { + return; + } switch ((ID_Type)GS(id->name)) { case ID_OB: { diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 635032d15a4..2f198c5b565 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -701,7 +701,8 @@ Mesh *BKE_mesh_copy_for_eval(struct Mesh *source, bool reference) int flags = (LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG | - LIB_ID_COPY_NO_PREVIEW); + LIB_ID_COPY_NO_PREVIEW | + LIB_ID_COPY_RUNTIME); if (reference) { flags |= LIB_ID_COPY_CD_REFERENCE; diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c index bbb8a96dd4d..90d3caa2639 100644 --- a/source/blender/blenkernel/intern/particle_distribute.c +++ b/source/blender/blenkernel/intern/particle_distribute.c @@ -925,7 +925,8 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG | - LIB_ID_COPY_NO_PREVIEW, + LIB_ID_COPY_NO_PREVIEW | + LIB_ID_COPY_RUNTIME, false); BKE_mesh_tessface_ensure(mesh); diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index dca2d536a5d..63dfacf391f 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -198,7 +198,8 @@ Mesh *MOD_deform_mesh_eval_get( LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_COPY_NO_PREVIEW | - LIB_ID_COPY_CD_REFERENCE), + LIB_ID_COPY_CD_REFERENCE | + LIB_ID_COPY_RUNTIME), false); mesh->runtime.deformed_only = 1; } |