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.
This commit is contained in:
Clément Foucault
2025-06-26 15:39:01 +02:00
parent 8ebb759046
commit 6fee44760a

View File

@@ -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");