Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-07-08 14:06:54 +0300
committerJeroen Bakker <jeroen@blender.org>2021-08-23 12:15:17 +0300
commitab572f3ac1b4708553e1ff22320f8c531fed7f75 (patch)
treeb6d9e8b8989507702b3267205a41a09e60979b34
parent3fa1de6ad68b1e3b22c5c30dc039820a1c36c2d4 (diff)
Fix: instances are made real when they shouldn't be
The original assumption that the `modifyMesh` function is only called when the modifier is applied was wrong. There are still a couple of other places calling it through `BKE_modifier_modify_mesh`. Now there is an extra check that makes sure instances are only realized when the modifier is actually applied.
-rw-r--r--source/blender/modifiers/intern/MOD_nodes.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 5c0301469c3..ccaa303f227 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -1420,9 +1420,11 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
*ctx->object);
modifyGeometry(md, ctx, geometry_set);
- /* This function is only called when applying modifiers. In this case it makes sense to realize
- * instances, otherwise in some cases there might be no results when applying the modifier. */
- geometry_set = blender::bke::geometry_set_realize_mesh_for_modifier(geometry_set);
+ if (ctx->flag & MOD_APPLY_TO_BASE_MESH) {
+ /* In this case it makes sense to realize instances, otherwise in some cases there might be no
+ * results when applying the modifier. */
+ geometry_set = blender::bke::geometry_set_realize_mesh_for_modifier(geometry_set);
+ }
Mesh *new_mesh = geometry_set.get_component_for_write<MeshComponent>().release();
if (new_mesh == nullptr) {