You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c906438
Browse filesBrowse the repository at this point in the historyBrowse files
feat(skills): timers-modal-and-threading skill, snippet and example (#446)
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>
@@ -51,6 +51,7 @@ VERSION - Source of truth for the repo version
51
51
| bl-info-migration | Three-step migration from legacy `bl_info` to Extensions Platform, dual-format pattern |
52
52
| vse-python | VSE timeline from Python: `.strips` vs `.sequences`, `new_effect` kwargs, 5.2 COLOR `width`/`height` bake |
53
53
| extension-runtime-and-packaging | Bundled wheels, `extension_path_user` data that survives upgrades, `online_access`, `bl_ext` names, `--command extension` build in CI |
54
+
| timers-modal-and-threading |`bpy.app.timers` return values and `persistent`, modal operators on `event_timer_add`, worker thread + queue + main-thread drain, no timers in `--background`|
54
55
55
56
## Rules (9)
56
57
@@ -96,7 +97,7 @@ matching its `globs` does. Changing a glob changes when the rule fires.
96
97
- Unity / Godot / Unreal glTF export via the engine-export-presets contract
97
98
- Explicit exit codes matching `headless-batch-script-template` (0, then 2+)
98
99
99
-
## Snippets (28)
100
+
## Snippets (29)
100
101
101
102
Small standalone `.py` files at `snippets/<name>.py`, each 5 to 75 lines.
AI asset pipeline track: `decimate_to_budget.py`, `convex_hull_collider.py`, `lod_chain.py` (helper duplicated, not imported), `gltf_draco_export.py`, `export_preset_unity.py`, `export_preset_godot.py`, `export_preset_unreal.py`, `setup_bake_target_image.py`, `bake_normal_high_to_low.py`, `save_baked_image.py`.
108
109
109
-
Extensions runtime: `extension-user-data.py` (`extension_path_user` settings file and an `online_access` guard).
110
+
Extensions runtime: `extension-user-data.py` (`extension_path_user` settings file and an `online_access` guard). Long-running work: `thread-queue-timer.py` (worker thread, `queue.Queue`, main-thread drain timer).
110
111
111
-
## Examples (65)
112
+
## Examples (66)
112
113
113
114
Runnable scripts at `examples/<name>/`, each asserting a real API contract with
114
115
deterministic checks (exit non-zero on failure) and optionally rendering a still via
115
116
`--output`. All of them run headless on Blender 5.2 LTS and 4.5 LTS in `blender-smoke.yml` (5.1 on the weekly cron, the `needs-5.1` PR label, or manual dispatch);
116
-
**56 of the 65 ship a render in the site gallery** at `docs/gallery/`. The other
117
-
nine are **check-only**: they carry no `--output` path, no gallery entry, and no
117
+
**56 of the 66 ship a render in the site gallery** at `docs/gallery/`. The other
118
+
ten are **check-only**: they carry no `--output` path, no gallery entry, and no
118
119
hero asset. The criterion is whether the contract is expressible in pixels. An
119
120
example is check-only when its witness is a data or state fact that no scene
120
121
redesign can make visible — a datablock name, an RNA attribute's presence, a
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -276,7 +276,7 @@ The drift-check workflow enforces these on every push and PR.
276
276
277
277
## Aggregate Counts
278
278
279
-
`README.md` declares aggregate counts (e.g. "17 skills, 9 rules, 3 templates, 28 snippets, 65 examples, and 76 showcase pieces"). The `validate-counts` job in `.github/workflows/validate.yml` enforces these substrings against the filesystem on every push and PR. Showcase pieces are counted separately from examples. When you add or remove content, update the README counts in the same commit.
279
+
`README.md` declares aggregate counts (e.g. "18 skills, 9 rules, 3 templates, 29 snippets, 66 examples, and 76 showcase pieces"). The `validate-counts` job in `.github/workflows/validate.yml` enforces these substrings against the filesystem on every push and PR. Showcase pieces are counted separately from examples. When you add or remove content, update the README counts in the same commit.
This repository ships **17 skills, 9 rules, 3 templates, 28 snippets, 65 examples, and 76 showcase pieces** for Blender Python development targeting Blender 5.2 LTS (current stable) with Blender 4.5 LTS fallback support. Blender 5.1 is prior stable.
47
+
This repository ships **18 skills, 9 rules, 3 templates, 29 snippets, 66 examples, and 76 showcase pieces** for Blender Python development targeting Blender 5.2 LTS (current stable) with Blender 4.5 LTS fallback support. Blender 5.1 is prior stable.
48
48
49
49
The content is consumed by AI coding agents reading these files directly from a checkout — **there is no MCP server in this repository, and none is required**. Both agents install it as a plugin (see [Quick start](#quick-start)): Cursor loads the skills and applies `rules/*.mdc` wherever their scope globs match; Claude Code loads the skills and gets the rules through a generated `blender-rules` skill, since it does not read Cursor `.mdc` files. An agent picks a skill up when its description matches the task. Any agent that can read files in a workspace can use it the same way. There is no build step for the content — edit the Markdown and Python files directly.
50
50
@@ -63,14 +63,14 @@ The content is consumed by AI coding agents reading these files directly from a
-**Cursor** — install it as a local plugin from the slim `plugin-dist` branch, then run **Developer: Reload Window**. **Customize** lists the 17 skills and 9 rules; the rules apply by glob scope and the agent loads a skill when its description matches the task.
66
+
-**Cursor** — install it as a local plugin from the slim `plugin-dist` branch, then run **Developer: Reload Window**. **Customize** lists the 18 skills and 9 rules; the rules apply by glob scope and the agent loads a skill when its description matches the task.
(On Windows the folder is `%USERPROFILE%\.cursor\plugins\local\`. Cursor skips symlinks that point outside that folder, so clone or copy rather than link.) Teams can import the repository as a team marketplace instead; it carries `.cursor-plugin/marketplace.json`. For one project only, copy `skills/*` into the project's `.cursor/skills/` and `rules/*.mdc` into `.cursor/rules/` from a checkout. Copying only the rules gives you no skills.
73
-
-**Claude Code** — install as a plugin, then run `/skills` to see all 17 skills plus `blender-rules`:
73
+
-**Claude Code** — install as a plugin, then run `/skills` to see all 18 skills plus `blender-rules`:
@@ -105,7 +105,7 @@ Releases ship often; [CHANGELOG.md](CHANGELOG.md) lists what each one changed.
105
105
106
106
## Falsifiers
107
107
108
-
Every one of the 65 examples carries a **falsifier**: a flag that changes the
108
+
Every one of the 66 examples carries a **falsifier**: a flag that changes the
109
109
input so a real assertion fails. It never disables the assertion, skips the
110
110
check, or short-circuits to an error — it feeds the script something the
111
111
contract says must not pass, and the same check that guards the happy path
@@ -133,7 +133,7 @@ per-script exit-code model, are in
133
133
134
134
## Examples and showcase
135
135
136
-
**65 examples** in [`examples/`](examples/) are runnable, self-checking scripts: each asserts one API contract, carries a falsifier, and runs headless on Blender 5.2 LTS and 4.5 LTS in the `blender-smoke` workflow (5.1 on the weekly cron or by manual dispatch). Those whose contract is visible also render a still. **76 showcase pieces** in [`showcase/`](showcase/) exist to show the skills working together at production scale: each is a single headless script that models a game prop, then runs it through the same cleanup, bake, LOD, collider and export steps the skills teach, and fails if a measured budget (triangle counts, colliders, materials, real-world size) is missed. They are not API examples. Conventions: [`showcase/README.md`](showcase/README.md).
136
+
**66 examples** in [`examples/`](examples/) are runnable, self-checking scripts: each asserts one API contract, carries a falsifier, and runs headless on Blender 5.2 LTS and 4.5 LTS in the `blender-smoke` workflow (5.1 on the weekly cron or by manual dispatch). Those whose contract is visible also render a still. **76 showcase pieces** in [`showcase/`](showcase/) exist to show the skills working together at production scale: each is a single headless script that models a game prop, then runs it through the same cleanup, bake, LOD, collider and export steps the skills teach, and fails if a measured budget (triangle counts, colliders, materials, real-world size) is missed. They are not API examples. Conventions: [`showcase/README.md`](showcase/README.md).
137
137
138
138
Browse both, with filters, full-size renders and each script's README, in the **[gallery](https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/)**.
139
139
@@ -151,11 +151,11 @@ Browse both, with filters, full-size renders and each script's README, in the **
151
151
## How content is organized
152
152
153
153
```
154
-
skills/<name>/SKILL.md - 17 skill files, YAML frontmatter, one canonical pattern each
154
+
skills/<name>/SKILL.md - 18 skill files, YAML frontmatter, one canonical pattern each
0 commit comments