diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-05-24 17:40:08 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-05-24 17:43:21 +0300 |
commit | e8c8ff4f86c276e4dca884ff1a411fcbbf003fed (patch) | |
tree | 484745e65e0eb2559c62be0a7581c3102d8cb84b /source/blender/blenkernel/intern/modifier.c | |
parent | 10e43c0aef38647d8904e758e36261c9ac0b6460 (diff) |
Fix all modifiers that depended on BKE_modifier_get_evaluated_mesh_from_object
This fix applying the following modifiers:
* Boolean (working already)
* Array
* Mesh Deform
* Surface Deform
* Vertex Weight Proximity
This function was to return evaluated mesh. So it should get the evaluated
object at all times. So in this case it makes more sense to simply pass the
depsgraph (or in this case the ModifierEvalContext that contains both the
depsgraph and the flag.
Solution discussed with Bastien Montagne.
Diffstat (limited to 'source/blender/blenkernel/intern/modifier.c')
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index c43a2e3b8ec..6201010d2aa 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -74,6 +74,7 @@ /* end */ #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "MOD_modifiertypes.h" @@ -1213,13 +1214,16 @@ struct DerivedMesh *modifier_applyModifierEM_DM_deprecated(struct ModifierData * /** Get evaluated mesh for other object, which is used as an operand for the modifier, * i.e. second operand for boolean modifier. */ -Mesh *BKE_modifier_get_evaluated_mesh_from_object(Object *ob, const ModifierApplyFlag flag) +Mesh *BKE_modifier_get_evaluated_mesh_from_object(const ModifierEvalContext *ctx, Object *ob) { + const ModifierApplyFlag flag = ctx->flag; + Object *ob_eval = DEG_get_evaluated_object(ctx->depsgraph, ob); + if (flag & MOD_APPLY_RENDER) { /* TODO(sergey): Use proper derived render in the future. */ - return ob->mesh_evaluated; + return ob_eval->mesh_evaluated; } else { - return ob->mesh_evaluated; + return ob_eval->mesh_evaluated; } } |