Skip to content

Add an examples gallery to the docs - #255

Merged
BradyAJohnston merged 1 commit into
mainfrom
docs-examples
Oct 9, 2026
Merged

BradyAJohnston merged 1 commit into
mainfrom
docs-examples

Conversation

@BradyAJohnston

@BradyAJohnston BradyAJohnston commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Adds an Examples section to the docs: a Quarto grid listing of nine complete node trees, each linking through to a page with the script, a render, the interactive node tree and a link to the original.

Renders of the nine examples

Example Ported from Shows
Voxelize Geometry Script tutorial one >> chain, Set Material on generated geometry
Mesh to LEGO Geometry Script Mesh to LEGO.py CustomGeometryGroup, Mesh Boolean class methods
City Builder Geometry Script tutorial proximity selection, panels, frames
Repeat Grid Geometry Script Repeat Grid.py bounding-box arithmetic, .x/.y socket properties
Golf Ball geonodes balls.py map_range, a material built alongside the tree
Forest geonodes forest.py group variants from a Python list comprehension, helper functions for shaders
Gear Train geonodes gears.py Index Switch from Python lists, Python floats vs sockets in a loop
Explosion geonodes explosion.py simulation zone, field evaluation order
Arrow Field geonodes arrows.py vector arithmetic, .point.max(), instancer attributes in a material

The examples are rewritten as nodebpy code rather than translated line for line. Both source projects are GPL-3.0 like nodebpy.

How it fits together

  • Each example is one script in docs/examples/code/. Its page pulls it in with {{< include >}} inside an executed {python} cell, so the code shown is the code that runs, and a hidden cell displays tree.
  • docs/examples/render.py runs each example in its own bpy process, puts the tree on a staged object (Suzanne, an icosphere, a curve of roads or an empty mesh), frames the camera from the evaluated bounds and renders with Cycles on the CPU to a transparent PNG with a shadow catcher. Shots are configured per example in SHOTS.
  • It is a Quarto pre-render step, and only re-renders examples whose script, shot or the render script changed (hashes in images/.hashes.json). The images are git-ignored; the docs workflow caches them.
  • make examples runs it on its own.

Found along the way: s.AmbientOcclusion() comes out with samples=1 (the signature says 0, the RNA default) whereas Blender's own node starts at 16, so AO is effectively off unless samples is passed. The examples pass samples=16; the default needs fixing in the generator separately.

Nine complete node trees ported from Geometry Script and geonodes, each on
its own page with the script (included from docs/examples/code and
executed during the build), a Cycles render, the node tree and a link to
the original. The examples index is a Quarto grid listing.

docs/examples/render.py renders the images in one bpy process per
example, attaching each tree to a staged object. It runs as a Quarto
pre-render step and only re-renders examples whose source or shot
changed; CI caches the images between builds.
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.30%. Comparing base (565b7c6) to head (bc85f80).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #255   +/-   ##
=======================================
  Coverage   98.30%   98.30%           
=======================================
  Files         101      101           
  Lines       30574    30574           
=======================================
  Hits        30056    30056           
  Misses        518      518           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 15 untouched benchmarks


Comparing docs-examples (bc85f80) with main (565b7c6)

Open in CodSpeed

@BradyAJohnston
BradyAJohnston merged commit bb31a77 into main Oct 9, 2026
11 checks passed
@BradyAJohnston
BradyAJohnston deleted the docs-examples branch October 9, 2026 08:17
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.

1 participant