feat(skills): timers-modal-and-threading skill, snippet and example - #446
Merged
Merged
Conversation
Long-running add-on work had no coverage. New skill timers-modal-and-threading covers: - bpy.app.timers return values and persistent=True - modal operators driven by event_timer_add - worker threads that hand results to the main thread through a queue.Queue - why none of this runs in --background Every claim is measured on 4.5.11, 5.1.2 and 5.2.1: - In --background a registered timer never runs. - A None timer runs once; a float timer re-runs; a 0.0 timer keeps re-running. - first_interval is keyword-only; register(fn, 0.5) raises TypeError. - A file load keeps persistent timers and drops plain ones. - bpy.types.Event has no `timer` attribute, so event.timer in modal() raises AttributeError. - A modal operator ticks to FINISHED and removes its timer. New snippet snippets/thread-queue-timer.py. New check-only example examples/timers-modal-threading runs a --background child and a windowed child that quits itself, with falsifiers --return-zero-once (exit 5) and --non-persistent (exit 8). The windowed child needs a display; smoke runs under xvfb. Counts move to 18 skills, 29 snippets and 66 examples (10 check-only); the example maps to this skill and operators. Closes #381 Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TMHSDigital
force-pushed
the
feat/timers-modal-threading-skill
branch
from
October 5, 2026 03:15
7e29598 to
525191b
Compare
Owner
Author
|
CI evidence before merge: all checks pass ( 13 pass ). Blender Smoke on PR head: Blender 5.2.2 LTS / Blender 4.5.14 LTS. Summaries (happy path; falsifiers) per leg: 145 passed, 1 skipped, 0 failed;166 passed, 0 skipped, 0 failed;143 passed, 3 skipped, 0 failed;151 passed, 15 skipped, 0 failed; |
Owner
Author
|
Linux evidence (run 37258749968, head 525191b): the windowed child ran under xvfb, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #381. (Rebased onto main after #445 merged.)
What ships
timers-modal-and-threading:bpy.app.timersreturn values andpersistent=True;event_timer_add;queue.Queue;--background.snippets/thread-queue-timer.py.examples/timers-modal-threading:--backgroundchild, and a windowed child that quits itself from a timer and reports JSON;--return-zero-once(exit 5) and--non-persistent(exit 8).examples/skills.json(→ this skill and operators); Cursor manifest; counts (18 skills, 29 snippets, 66 examples, 10 check-only).Measured facts the skill relies on (4.5.11, 5.1.2, 5.2.1)
--backgroundchildis_registeredTrue, never runsNonetimer / timer returning 0.05 until its 3rd call0.0register(fn, 0.5)TypeError: register() takes exactly 1 positional argument (2 given)on all three. 5.2's docstring shows the*; 4.5's doesn't, but the behaviour is the samewm.read_factory_settingsfrom a timerINVOKE_DEFAULTundertemp_override(window=…)RUNNING_MODAL, 3TIMERevents,FINISHED, timer removed'timer' in bpy.types.Event.bl_rna.propertiesevent.timerraisedAttributeErrorin a 5.2.1 modal, which first hung my probeFound while building: the first windowed run hung, because the timer meant to quit Blender was itself dropped by the file load the example performs. That is the contract under test. The quit timer is now
persistent=True, and the skill says so.Evidence
Live run:
tests/smoke/run_catalog.pyover the new row on local Windows binaries; all PASS.--return-zero-once--non-persistentLocal checks:
tests/run_all.py31 passed, 0 failed.Not yet proven: the windowed child on Linux under xvfb. This PR's smoke legs are the first such run. If the child cannot open a window there, the row fails with exit 4 rather than passing silently.
🤖 Generated with Claude Code