Fix broken particle distribution after recent fix

This commit is contained in:
2018-12-14 17:33:36 +01:00
parent c7cc97c7b9
commit d3e0d7f082
5 changed files with 11 additions and 6 deletions

View File

@@ -81,6 +81,7 @@ enum {
LIB_ID_COPY_CACHES = 1 << 18, /* Copy runtime data caches. */ 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_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_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. /* XXX Hackish/not-so-nice specific behaviors needed for some corner cases.
* Ideally we should not have those, but we need them for now... */ * Ideally we should not have those, but we need them for now... */

View File

@@ -518,13 +518,14 @@ static int id_copy_libmanagement_cb(void *user_data, ID *UNUSED(id_self), ID **i
return IDWALK_RET_NOP; 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) { if (id == NULL) {
return; return;
} }
/* TODO(sergey): Think of having a flag which will allow to share runtime if (flag & LIB_ID_COPY_RUNTIME) {
* fields of the ID.*/ return;
}
switch ((ID_Type)GS(id->name)) { switch ((ID_Type)GS(id->name)) {
case ID_OB: case ID_OB:
{ {

View File

@@ -701,7 +701,8 @@ Mesh *BKE_mesh_copy_for_eval(struct Mesh *source, bool reference)
int flags = (LIB_ID_CREATE_NO_MAIN | int flags = (LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_CREATE_NO_DEG_TAG |
LIB_ID_COPY_NO_PREVIEW); LIB_ID_COPY_NO_PREVIEW |
LIB_ID_COPY_RUNTIME);
if (reference) { if (reference) {
flags |= LIB_ID_COPY_CD_REFERENCE; flags |= LIB_ID_COPY_CD_REFERENCE;

View File

@@ -925,7 +925,8 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_CREATE_NO_DEG_TAG |
LIB_ID_COPY_NO_PREVIEW, LIB_ID_COPY_NO_PREVIEW |
LIB_ID_COPY_RUNTIME,
false); false);
BKE_mesh_tessface_ensure(mesh); BKE_mesh_tessface_ensure(mesh);

View File

@@ -198,7 +198,8 @@ Mesh *MOD_deform_mesh_eval_get(
LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_CREATE_NO_DEG_TAG |
LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_PREVIEW |
LIB_ID_COPY_CD_REFERENCE), LIB_ID_COPY_CD_REFERENCE |
LIB_ID_COPY_RUNTIME),
false); false);
mesh->runtime.deformed_only = 1; mesh->runtime.deformed_only = 1;
} }