From 6fee44760a8a7f31e0f485b5075883bdc74d8e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 26 Jun 2025 15:39:01 +0200 Subject: [PATCH] Fix: Overlay: Missing refresh when toggling retopology overlay This appear as meshes still present or missing when toggling the option. This was caused by the change in update detection from the overlay properties. --- source/blender/makesrna/intern/rna_space.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_space.cc b/source/blender/makesrna/intern/rna_space.cc index 0c06fd30834..646f20438a8 100644 --- a/source/blender/makesrna/intern/rna_space.cc +++ b/source/blender/makesrna/intern/rna_space.cc @@ -1096,6 +1096,14 @@ static void rna_SpaceView3D_shading_use_compositor_update(Main * /*bmain*/, WM_main_add_notifier(NC_SPACE | ND_SPACE_NODE, nullptr); } +static void rna_SpaceView3D_retopology_update(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/) +{ + /* Retopology can change the visibility of active object. + * There is no actual data change but we just notify the viewport engine to refresh and pickup + * the new visibility. */ + DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); +} + static void rna_SpaceView3D_region_quadviews_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { @@ -4940,7 +4948,8 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) "Retopology", "Hide the solid mesh and offset the overlay towards the view. " "Selection is occluded by inactive geometry, unless X-Ray is enabled"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, nullptr); + RNA_def_property_update( + prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_SpaceView3D_retopology_update"); prop = RNA_def_property(srna, "retopology_offset", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, nullptr, "overlay.retopology_offset");