Repository navigation
Add an examples gallery to the docs - #255
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
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.
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.
>>chain, Set Material on generated geometryMesh to LEGO.pyCustomGeometryGroup, Mesh Boolean class methodsRepeat Grid.py.x/.ysocket propertiesballs.pymap_range, a material built alongside the treeforest.pygears.pyexplosion.pyarrows.py.point.max(), instancer attributes in a materialThe examples are rewritten as
nodebpycode rather than translated line for line. Both source projects are GPL-3.0 like nodebpy.How it fits together
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 displaystree.docs/examples/render.pyruns each example in its ownbpyprocess, 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 inSHOTS.pre-renderstep, and only re-renders examples whose script, shot or the render script changed (hashes inimages/.hashes.json). The images are git-ignored; the docs workflow caches them.make examplesruns it on its own.Found along the way:
s.AmbientOcclusion()comes out withsamples=1(the signature says 0, the RNA default) whereas Blender's own node starts at 16, so AO is effectively off unlesssamplesis passed. The examples passsamples=16; the default needs fixing in the generator separately.