Skip to content

Commit e70db04

Browse files
authored
Merge pull request #49 from TMHSDigital/feat/examples-shape-key-blend-curve-bevel-arc
feat: add shape-key-blend and curve-bevel-arc examples
2 parents c56fc6c + 268c3f7 commit e70db04

15 files changed

Lines changed: 1472 additions & 0 deletions

File tree

.cursor-plugin/plugin.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@
6060
],
6161
"examples": [
6262
"examples/bmesh-gear",
63+
"examples/curve-bevel-arc",
6364
"examples/depsgraph-export",
6465
"examples/driver-wave",
6566
"examples/gn-instance-grid",
6667
"examples/gn-sdf-remesh",
6768
"examples/shader-node-group",
69+
"examples/shape-key-blend",
6870
"examples/swatch-grid",
6971
"examples/temp-override-join",
7072
"examples/turntable",

.github/workflows/blender-smoke.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,21 @@ jobs:
212212
# Material carries Lime. Exits non-zero on failure.
213213
xvfb-run -a "$BLENDER" --background \
214214
--python examples/gn-instance-grid/gn_instance_grid.py --
215+
216+
- name: Shipped example - shape-key blend (data API + evaluated mesh)
217+
run: |
218+
set -euo pipefail
219+
# Frame-independent check only (no render): relative Tall shape key at
220+
# value=0.5; asserts undeformed mesh stays at Basis and evaluated z matches
221+
# basis + value*(key-basis). Exits non-zero on failure.
222+
xvfb-run -a "$BLENDER" --background \
223+
--python examples/shape-key-blend/shape_key_blend.py --
224+
225+
- name: Shipped example - curve bevel arc (Bezier + bevel_depth)
226+
run: |
227+
set -euo pipefail
228+
# Frame-independent check only (no render): beveled Bezier semicircle via
229+
# curve data API; asserts 8 points, bevel_depth=0.12, eval verts=850
230+
# faces=840, tube rests on floor. Exits non-zero on failure.
231+
xvfb-run -a "$BLENDER" --background \
232+
--python examples/curve-bevel-arc/curve_bevel_arc.py --

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,36 @@ A generative Geometry Nodes tree — Mesh Grid → Instance on Points → Realiz
189189
attached as a `NODES` modifier with no Group Input. Asserts evaluated topology is
190190
verts = 72, faces = 54, and `Set Material` carries the lime accent.
191191

192+
</td>
193+
</tr>
194+
<tr>
195+
<td width="46%" valign="middle">
196+
<a href="examples/shape-key-blend/"><img src="examples/shape-key-blend/preview.webp" alt="Shape-key blend: a tall violet rectangular block on a dark studio floor, stretched by a relative Tall shape key at value 0.5" /></a>
197+
</td>
198+
<td valign="middle">
199+
200+
### [shape-key-blend](examples/shape-key-blend/)
201+
202+
A relative shape key authored through the data API — `shape_key_add`, per-vertex
203+
`key_blocks` data, and `.value`. Witnesses that shape keys do not rewrite
204+
`mesh.vertices`: undeformed top stays at Basis, evaluated z matches
205+
`basis + value × (key − basis)`.
206+
207+
</td>
208+
</tr>
209+
<tr>
210+
<td width="46%" valign="middle">
211+
<a href="examples/curve-bevel-arc/"><img src="examples/curve-bevel-arc/preview.webp" alt="Curve bevel arc: a rose beveled Bezier semicircle tube resting on a dark studio floor" /></a>
212+
</td>
213+
<td valign="middle">
214+
215+
### [curve-bevel-arc](examples/curve-bevel-arc/)
216+
217+
A beveled Bezier semicircle authored on `bpy.types.Curve``splines.new('BEZIER')`,
218+
`bezier_points`, `bevel_depth` — so the curve renders as a tube without a prior mesh
219+
conversion. Asserts eight points, `bevel_depth == 0.12`, and evaluated topology
220+
850 verts / 840 faces.
221+
192222
</td>
193223
</tr>
194224
</table>
12.6 KB
Loading
7.96 KB
Loading

docs/gallery/curve-bevel-arc/index.html

Lines changed: 451 additions & 0 deletions
Large diffs are not rendered by default.

docs/gallery/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,10 @@ <h1>Examples Gallery</h1>
175175
<div class="chips" role="toolbar" aria-label="Filter examples by topic">
176176
<button class="chip active" data-tag="" type="button">All</button>
177177
<button class="chip" data-tag="animation" type="button">animation</button>
178+
<button class="chip" data-tag="bevel" type="button">bevel</button>
178179
<button class="chip" data-tag="bmesh" type="button">bmesh</button>
179180
<button class="chip" data-tag="context" type="button">context</button>
181+
<button class="chip" data-tag="curves" type="button">curves</button>
180182
<button class="chip" data-tag="depsgraph" type="button">depsgraph</button>
181183
<button class="chip" data-tag="drivers" type="button">drivers</button>
182184
<button class="chip" data-tag="export" type="button">export</button>
@@ -188,6 +190,7 @@ <h1>Examples Gallery</h1>
188190
<button class="chip" data-tag="operators" type="button">operators</button>
189191
<button class="chip" data-tag="performance" type="button">performance</button>
190192
<button class="chip" data-tag="rendering" type="button">rendering</button>
193+
<button class="chip" data-tag="shape-keys" type="button">shape-keys</button>
191194
</div>
192195
<main id="main">
193196
<div class="grid">
@@ -301,6 +304,28 @@ <h2><a href="gn-instance-grid/">gn-instance-grid</a></h2>
301304
<a class="card-link" href="gn-instance-grid/">View example <span aria-hidden="true">&rarr;</span></a>
302305
</div>
303306
</article>
307+
<article class="card" data-tags="mesh shape-keys">
308+
<a class="card-media" href="shape-key-blend/" aria-label="shape-key-blend example detail page">
309+
<img src="assets/shape-key-blend-hero.webp" alt="shape-key-blend — A relative shape key authored entirely through the data API — shape_key_add, per-vertex key_blocks data, and " loading="lazy" decoding="async" />
310+
</a>
311+
<div class="card-body">
312+
<h2><a href="shape-key-blend/">shape-key-blend</a></h2>
313+
<p class="teaches">A relative shape key authored entirely through the data API — shape_key_add, per-vertex key_blocks data, and .value — read back from the depsgraph-evaluated mesh.</p>
314+
<p class="witnesses"><span class="tag">witnesses</span> Shape keys do not rewrite mesh.vertices: undeformed top z stays at Basis, and evaluated z matches basis + value × (key − basis).</p>
315+
<a class="card-link" href="shape-key-blend/">View example <span aria-hidden="true">&rarr;</span></a>
316+
</div>
317+
</article>
318+
<article class="card" data-tags="curves bevel">
319+
<a class="card-media" href="curve-bevel-arc/" aria-label="curve-bevel-arc example detail page">
320+
<img src="assets/curve-bevel-arc-hero.webp" alt="curve-bevel-arc — A beveled Bezier semicircle authored on bpy" loading="lazy" decoding="async" />
321+
</a>
322+
<div class="card-body">
323+
<h2><a href="curve-bevel-arc/">curve-bevel-arc</a></h2>
324+
<p class="teaches">A beveled Bezier semicircle authored on bpy.types.Curve — splines.new(&#x27;BEZIER&#x27;), bezier_points, bevel_depth — so the curve renders as a tube without a prior mesh conversion.</p>
325+
<p class="witnesses"><span class="tag">witnesses</span> Curve tubes are curve datablocks: eight Bezier points, bevel_depth == 0.12, and the evaluated mesh has deterministic topology (850 verts, 840 faces) resting on the floor.</p>
326+
<a class="card-link" href="curve-bevel-arc/">View example <span aria-hidden="true">&rarr;</span></a>
327+
</div>
328+
</article>
304329
</div>
305330
</main>
306331
<footer>

0 commit comments

Comments
 (0)