Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

- **HUD On** (Preferences, Dashboard): the checkbox now shows or hides the viewport dashboard immediately in every open
scene, not only in new ones. It is still the starting state of scenes that have not used CurioMesh yet.

## 0.9.8 - 2026-11-06

### Hard surface
Expand Down
10 changes: 8 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def _redraw(self, context):
overlay.tag_redraw()


def _hud_default_update(self, context):
overlay.set_hud_everywhere(bool(self.hud_default))


def _color(name: str, label: str, description: str):
return bpy.props.FloatVectorProperty(
name=label,
Expand Down Expand Up @@ -108,9 +112,10 @@ class CURIOMESH_AP_preferences(bpy.types.AddonPreferences):
)

hud_default: bpy.props.BoolProperty(
name="HUD On in New Scenes",
description="Whether the viewport dashboard starts on in scenes that have not used CurioMesh yet",
name="HUD On",
description="Show or hide the viewport dashboard right away, in every open scene. Also the starting state of scenes that have not used CurioMesh yet",
default=D["hud_default"],
update=_hud_default_update,
)
hud_corner: bpy.props.EnumProperty(
name="Corner",
Expand Down Expand Up @@ -256,6 +261,7 @@ def execute(self, context):
except Exception:
pass
apply_category()
overlay.set_hud_everywhere(bool(prefs.hud_default)) # property_unset skips update callbacks
overlay.tag_redraw()
return {"FINISHED"}

Expand Down
8 changes: 8 additions & 0 deletions overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ def apply_hud_default(scene=None) -> None:
settings.hud_enabled = False


def set_hud_everywhere(enabled: bool) -> None:
"""Show or hide the HUD right now in every open scene (live switch from the Preferences)."""
for sc in bpy.data.scenes:
settings = getattr(sc, "curiomesh_settings", None)
if settings is not None and settings.hud_enabled != enabled:
settings.hud_enabled = enabled # its update callback redraws the viewports


def tag_redraw() -> None:
wm = bpy.context.window_manager
if wm is None:
Expand Down
7 changes: 7 additions & 0 deletions tests/blender_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,13 @@ def run_ui_prefs_case(module):
if not settings.hud_enabled:
raise AssertionError("ui prefs: hud default applied twice")
prefs.hud_default = True
# The preference is also a live switch: it flips the HUD of the open scenes at once.
if not settings.hud_enabled:
raise AssertionError("ui prefs: hud_default True did not switch the HUD back on live")
prefs.hud_default = False
if settings.hud_enabled:
raise AssertionError("ui prefs: hud_default False did not hide the HUD live")
prefs.hud_default = True

# Every panel draws, in several states, with no unknown icon / property / operator.
states = []
Expand Down