From de491abf996281785391b18b3547d1bff305355f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 7 Dec 2018 15:45:53 +0100 Subject: Fix modifiers evaluation outside of depsgraph/CoW context. Fix T58237: Exporters: Curve Modifier not applied when "apply modifiers" are selected. Fix T58856: Python: "to_mesh" broken in 2.8. ...And many other cases... ;) Thing is, we need target IDs to always be evaluated ones (at least I cannot see any case where having orig ones is desired effect here). Depsgraph/Cow system ensures us that when modifiers are evaluated by it, but they can also be called outside of this context, e.g. when doing binding, or object conversion... So we need to ensure in modifiers code that we actually are always working with eval data for those targets. Note that I did not touch to physics modifiers, those are a bit touchy and rather not 'fix' something there until proven broken! --- source/blender/modifiers/intern/MOD_curve.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_curve.c') diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c index e9a3dd3810b..42dd8ebb32b 100644 --- a/source/blender/modifiers/intern/MOD_curve.c +++ b/source/blender/modifiers/intern/MOD_curve.c @@ -49,6 +49,7 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" +#include "DEG_depsgraph_query.h" #include "MOD_modifiertypes.h" #include "MOD_util.h" @@ -125,7 +126,8 @@ static void deformVerts( /* silly that defaxis and curve_deform_verts are off by 1 * but leave for now to save having to call do_versions */ - curve_deform_verts(cmd->object, ctx->object, vertexCos, numVerts, dvert, defgrp_index, cmd->defaxis - 1); + curve_deform_verts(DEG_get_evaluated_object(ctx->depsgraph, cmd->object), ctx->object, + vertexCos, numVerts, dvert, defgrp_index, cmd->defaxis - 1); if (!ELEM(mesh_src, NULL, mesh)) { BKE_id_free(NULL, mesh_src); -- cgit v1.2.3