diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-06-24 20:03:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-06-24 20:59:29 +0300 |
commit | 0357dbf148dcbfcf6c35a5e9e34cdfa272dc7a98 (patch) | |
tree | aae0d561af1e806279c406f65b9583147b60f5ee | |
parent | 8ef0a0b2310091d9e72b1bcced98b51999d42707 (diff) |
Fix T99058: geometry nodes ignore if subdivision surface modifier is disabled
It was looking up the last modifier in the stack, ignoring visibility, instead
of mesh->runtime.subsurf_runtime_data set by the modifier evaluation and used by
the drawing code.
-rw-r--r-- | source/blender/blenkernel/intern/mesh_wrapper.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/mesh_wrapper.cc b/source/blender/blenkernel/intern/mesh_wrapper.cc index fdebf1d6a26..48a29b2aad3 100644 --- a/source/blender/blenkernel/intern/mesh_wrapper.cc +++ b/source/blender/blenkernel/intern/mesh_wrapper.cc @@ -309,12 +309,7 @@ int BKE_mesh_wrapper_poly_len(const Mesh *me) static Mesh *mesh_wrapper_ensure_subdivision(const Object *ob, Mesh *me) { - SubsurfModifierData *smd = BKE_object_get_last_subsurf_modifier(ob); - if (!smd) { - return me; - } - - SubsurfRuntimeData *runtime_data = (SubsurfRuntimeData *)smd->modifier.runtime; + SubsurfRuntimeData *runtime_data = (SubsurfRuntimeData *)me->runtime.subsurf_runtime_data; if (runtime_data == nullptr || runtime_data->settings.level == 0) { return me; } @@ -335,7 +330,7 @@ static Mesh *mesh_wrapper_ensure_subdivision(const Object *ob, Mesh *me) /* Happens on bad topology, but also on empty input mesh. */ return me; } - const bool use_clnors = BKE_subsurf_modifier_use_custom_loop_normals(smd, me); + const bool use_clnors = runtime_data->use_loop_normals; if (use_clnors) { /* If custom normals are present and the option is turned on calculate the split * normals and clear flag so the normals get interpolated to the result mesh. */ |