|
16 | 16 | <meta property="og:image" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/assets/depsgraph-export-hero.webp" /> |
17 | 17 | <meta property="og:image:width" content="1280" /> |
18 | 18 | <meta property="og:image:height" content="720" /> |
19 | | - <meta property="og:image:alt" content="A teal cube beside a slightly faceted teal sphere on a dark studio floor." /> |
| 19 | + <meta property="og:image:alt" content="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." /> |
20 | 20 | <meta property="og:site_name" content="Blender Developer Tools" /> |
21 | 21 | <meta name="twitter:card" content="summary_large_image" /> |
22 | 22 | <meta name="twitter:title" content="depsgraph-export — Examples — Blender Developer Tools" /> |
23 | 23 | <meta name="twitter:description" content="The depsgraph lifetime contract — evaluated_get().to_mesh() paired with to_mesh_clear() — measured against an OBJ export of the same object." /> |
24 | 24 | <meta name="twitter:image" content="https://tmhsdigital.github.io/Blender-Developer-Tools/gallery/assets/depsgraph-export-hero.webp" /> |
25 | | - <meta name="twitter:image:alt" content="A teal cube beside a slightly faceted teal sphere on a dark studio floor." /> |
| 25 | + <meta name="twitter:image:alt" content="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." /> |
26 | 26 | <style> |
27 | 27 | /* fonts are deployed by the landing build (docs/fonts/) */ |
28 | 28 | @font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; |
@@ -268,8 +268,8 @@ <h1>depsgraph-export</h1> |
268 | 268 | <p>The depsgraph lifetime contract — evaluated_get().to_mesh() paired with to_mesh_clear() — measured against an OBJ export of the same object.</p> |
269 | 269 | </header> |
270 | 270 | <main id="main"> |
271 | | - <button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: A teal cube beside a slightly faceted teal sphere on a dark studio floor."> |
272 | | - <img src="../assets/depsgraph-export-hero.webp" alt="A teal cube beside a slightly faceted teal sphere on a dark studio floor." width="1280" height="720" /> |
| 271 | + <button class="detail-hero" id="heroZoom" type="button" aria-label="View full size: A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor."> |
| 272 | + <img src="../assets/depsgraph-export-hero.webp" alt="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." width="1280" height="720" /> |
273 | 273 | </button> |
274 | 274 | <p class="zoom-hint">Rendered headless by the example itself — click to zoom.</p> |
275 | 275 | <div class="callout"><span class="tag">witnesses</span> Exports ship evaluated geometry: the exported vertex count equals the subsurf-applied count and is strictly greater than the base mesh.</div> |
@@ -431,6 +431,28 @@ <h2>Source</h2> |
431 | 431 | <span class="k">for</span> poly <span class="k">in</span> obj.data.polygons: |
432 | 432 | poly.use_smooth = <span class="k">True</span> |
433 | 433 |
|
| 434 | + <span class="c"># Edge cages over both: the check compares vertex counts, and two teal</span> |
| 435 | + <span class="c"># silhouettes alone read as "a cube and a ball". The base cage shows the</span> |
| 436 | + <span class="c"># 8 verts the datablock holds; the evaluated cage is the same SUBSURF</span> |
| 437 | + <span class="c"># followed by WIREFRAME, so it draws exactly the edges the OBJ ships.</span> |
| 438 | + <span class="c"># Render-path scaffolding only: separate objects, added after check().</span> |
| 439 | + cage_mat = principled(<span class="s">"Cage"</span>, (<span class="n">0.92</span>, <span class="n">0.80</span>, <span class="n">0.56</span>, <span class="n">1.0</span>), <span class="n">0.0</span>, <span class="n">0.35</span>) |
| 440 | + cages = [] |
| 441 | + <span class="k">for</span> src, subsurf <span class="k">in</span> ((base_obj, <span class="k">False</span>), (obj, <span class="k">True</span>)): |
| 442 | + cage = bpy.data.objects.new(src.name + <span class="s">"Cage"</span>, obj.data.copy()) |
| 443 | + cage.data.materials.clear() |
| 444 | + cage.data.materials.append(cage_mat) |
| 445 | + cage.location = src.location |
| 446 | + cage.rotation_euler = src.rotation_euler |
| 447 | + <span class="k">if</span> subsurf: |
| 448 | + cage.modifiers.new(<span class="s">"ss"</span>, <span class="s">'SUBSURF'</span>).levels = <span class="n">2</span> |
| 449 | + wire = cage.modifiers.new(<span class="s">"cage"</span>, <span class="s">'WIREFRAME'</span>) |
| 450 | + wire.thickness = <span class="n">0.035</span> <span class="k">if</span> <span class="k">not</span> subsurf <span class="k">else</span> <span class="n">0.018</span> |
| 451 | + wire.offset = <span class="n">1.0</span> <span class="c"># grow outward so the lines sit on the surface</span> |
| 452 | + wire.use_even_offset = <span class="k">True</span> |
| 453 | + bpy.context.collection.objects.link(cage) |
| 454 | + cages.append(cage) |
| 455 | + |
434 | 456 | floor_me = bpy.data.meshes.new(<span class="s">"Floor"</span>) |
435 | 457 | bm = bmesh.new() |
436 | 458 | <span class="k">try</span>: |
@@ -505,7 +527,7 @@ <h2>Source</h2> |
505 | 527 | fcode = gallery_framing.check_framing( |
506 | 528 | scene, cam, |
507 | 529 | hero=[base_obj, obj], |
508 | | - elements=[base_obj, obj], |
| 530 | + elements=[base_obj, obj] + cages, |
509 | 531 | stage=[floor, wall], |
510 | 532 | ) |
511 | 533 | <span class="k">if</span> fcode: |
@@ -554,7 +576,7 @@ <h2>Source</h2> |
554 | 576 | </main> |
555 | 577 | <dialog class="lightbox" id="lightbox" aria-label="Full-size render"> |
556 | 578 | <button class="lightbox-close" type="button" autofocus>Close</button> |
557 | | - <img src="../assets/depsgraph-export-hero.webp" alt="A teal cube beside a slightly faceted teal sphere on a dark studio floor." /> |
| 579 | + <img src="../assets/depsgraph-export-hero.webp" alt="A teal cube outlined by its twelve edges beside a faceted teal sphere covered in a dense pale wire grid, on a dark studio floor." /> |
558 | 580 | </dialog> |
559 | 581 | <footer> |
560 | 582 | <div class="statusbar"> |
|
0 commit comments