Skip to content

The ring shows ZBrush's state: lit toggles, current slider values, dimmed slots - #217

Merged
combwizard merged 21 commits into
mainfrom
state-channel
Nov 17, 2026
Merged

combwizard merged 21 commits into
mainfrom
state-channel

Conversation

@combwizard

@combwizard combwizard commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #188.

The ring shows ZBrush's state in ZBrush 2026 and newer: a Toggle slot has a dot, filled with the slot outlined while the switch is on and hollow while it is off; a Set slot shows its slider's current value and lights when that is its own value; a slot ZBrush would ignore right now is dimmed but can still be picked. Fans show the marks too.

How it works, per the design on #188:

  • bridge/zorbit_bridge.py (phase 1): the listener answers WM_APP_STATE with a snapshot of the asked paths in zstate.json and posts WM_APP_STATE_READY back, only to a ZOrbitControl window. It answers again after each pick. listener.json gets "state": 1, so an old plugin is never asked. The Status box has a State channel line.
  • zorbit/zstate.py (phase 2): the query, the snapshot parser, the cache (per ZBrush pid and session, dropped by a pick until the plugin has seen it), paths_for, marks_for, format_value and the Channel (one question in flight, lost after 2 s).
  • zorbit/ring.py (phase 3): marks= and refresh_marks(). Marked copies of slot pictures; the shared sprite and slot caches and their keys are untouched. marks=None draws exactly as before.
  • zorbit/radiald.py and config.py (phase 4): the app asks after ring.show(), never waits, and redraws an open ring when the answer comes. bridge.show_state (on by default) turns it off.
  • Studio (phase 5): Show ZBrush's state on the ring on the ZBrush bridge card (Full mode).
  • Docs (phase 6): bridge.md, menus.md, appearance.md with a new state.png, studio.md with a retaken settings-bridge.png, files.md, troubleshooting.md, the README feature list, CHANGELOG.md.

Checked in ZBrush 2026.2.1

Measured on 17 Nov 2026; the numbers are on #188.

  • Reads during a stroke: answers keep coming while ZBrush sculpts, at the same round trip as at rest: 42 of 42 questions during a 2 s mouse stroke, 117 of 117 during a 5.8 s pen stroke (15 ms median, 30 ms at most).
  • A long DynaMesh: the ring opens at once. The first ring of the session got its answer 844 ms after it showed (plugin reads 3.6 ms), so ZBrush answered as soon as it was free; a ring with marks already cached shows them from the start.
  • Round trip: the app logged "answered in 16 ms" for a real ring opened with --open; the marks were in about 19 ms after the ring showed, early in the 120 ms fade of the smooth animation. 24 paths: 14 ms median; 128 paths (the cap): 33 ms, with the plugin at its 20 ms limit.
  • A picture of the open ring showed the marks matching ZBrush.

Not checked by hand: two ZBrush instances (two of the same version cannot run at once), and ZBrush 2022 left unchanged (covered by tests: nothing is asked without "state": 1).

Found on the way: Edit:Undo and Edit:Redo always read as disabled through ZBrush's Python API, and pressing Edit:Undo through it does nothing, so an Undo slot would always be dimmed. No starter menu has one.

pytest: 3194 passed.

Merge by hand: this touches the ring, the daemon and the bridge.

…items in zstate.json, sent again after each pick
…shot, the cache, the marks and the conversation with the plugin, with tests
…tline on lit toggles, a value chip on Set slots, and dimmed slots (phase 3 of #188)
…stop when the app removes its question, and only the first ten answers and odd ones are logged
…h has one pick record, and the cache also gets stop(), a listener-wise question in flight and a capped path walk
…is on screen, redraws an open ring when the answer comes, records each pick handed to a ZBrush and takes back each one it drops, and bridge.show_state (on by default) turns it off
…ring (on by default, off writes bridge.show_state false), that the save summary and the Full-only note name, and a bad value in the file reads as a sentence
…tures of a full ring are kept, and a failing mark is logged once per ring and fan
… ring switches' start position and writes, that the show-state switch sits on the ZBrush bridge card after the bridge key field, and a bridge section that is not an object is dropped by loading first
…d Toggle slot shows, how the state travels and how to turn it off, the two new files and log lines, what to check when slots are dimmed or show no state, and a picture of the marks
…n file goes only when the setting is off or the app quits
…ow_state off takes the question away when the config loads, a pick is taken back only when the app removed its request, the plugin retries publishing listener.json, and a ring over a ZBrush that cannot answer leaves the other one's question alone
@combwizard
combwizard merged commit 6e54cc9 into main Nov 17, 2026
10 checks passed
@combwizard
combwizard deleted the state-channel branch November 17, 2026 17:49
@combwizard combwizard mentioned this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The ring shows ZBrush's state: lit toggles, current slider values, dimmed slots

1 participant