Fix incorrect object in editmode tests in depsgraph eval.

These cases should not depend on the view layer.
This commit is contained in:
Brecht Van Lommel 2018-04-13 12:51:49 +02:00
parent 1c85fb95b1
commit f0a4c631bb
3 changed files with 8 additions and 8 deletions

View File

@ -222,7 +222,7 @@ void BKE_object_handle_data_update(
}
/* particles */
if ((ob != OBEDIT_FROM_VIEW_LAYER(eval_ctx->view_layer)) && ob->particlesystem.first) {
if (!(ob->mode & OB_MODE_EDIT) && ob->particlesystem.first) {
ParticleSystem *tpsys, *psys;
DerivedMesh *dm;
ob->transflag &= ~OB_DUPLIPARTS;

View File

@ -298,7 +298,7 @@ static void meshdeformModifier_do(
*
* We'll support this case once granular dependency graph is landed.
*/
if (mmd->object == OBEDIT_FROM_VIEW_LAYER(eval_ctx->view_layer)) {
if (mmd->object->mode & OB_MODE_EDIT) {
BMEditMesh *em = BKE_editmesh_from_object(mmd->object);
tmpdm = editbmesh_get_derived_cage_and_final(eval_ctx, md->scene, mmd->object, em, 0, &cagedm);
if (tmpdm)

View File

@ -1096,7 +1096,7 @@ static void deformVert(
}
static void surfacedeformModifier_do(
ModifierData *md, const EvaluationContext *eval_ctx,
ModifierData *md,
float (*vertexCos)[3], unsigned int numverts, Object *ob)
{
SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md;
@ -1110,7 +1110,7 @@ static void surfacedeformModifier_do(
}
/* Handle target mesh both in and out of edit mode */
if (smd->target == OBEDIT_FROM_VIEW_LAYER(eval_ctx->view_layer)) {
if (smd->target->mode & OB_MODE_EDIT) {
BMEditMesh *em = BKE_editmesh_from_object(smd->target);
tdm = em->derivedFinal;
}
@ -1181,21 +1181,21 @@ static void surfacedeformModifier_do(
}
static void deformVerts(
ModifierData *md, const struct EvaluationContext *eval_ctx,
ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
Object *ob, DerivedMesh *UNUSED(derivedData),
float (*vertexCos)[3], int numVerts,
ModifierApplyFlag UNUSED(flag))
{
surfacedeformModifier_do(md, eval_ctx, vertexCos, numVerts, ob);
surfacedeformModifier_do(md, vertexCos, numVerts, ob);
}
static void deformVertsEM(
ModifierData *md, const struct EvaluationContext *eval_ctx,
ModifierData *md, const struct EvaluationContext *UNUSED(eval_ctx),
Object *ob, struct BMEditMesh *UNUSED(editData),
DerivedMesh *UNUSED(derivedData),
float (*vertexCos)[3], int numVerts)
{
surfacedeformModifier_do(md, eval_ctx, vertexCos, numVerts, ob);
surfacedeformModifier_do(md, vertexCos, numVerts, ob);
}
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))