Skip to content

Add socket methods across vector, scalar, color, grid, bundle and data-block sockets - #247

Closed
BradyAJohnston wants to merge 7 commits into
mainfrom
socket-methods
Closed

BradyAJohnston wants to merge 7 commits into
mainfrom
socket-methods

Conversation

@BradyAJohnston

@BradyAJohnston BradyAJohnston commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #245 and #244 (merged into this branch); the diff shrinks to this PR's changes once those land.

  • Vector: Vector Math methods (min, max, floor, snap, wrap, trig, faceforward, refract, ...), to_spherical/to_cylindrical, project_point, euler_to_rotation.
  • Integer: divide_round, divide_ceiling, gcd, lcm, to_float, shift/rotate (Bit Math; right shifts are logical). Float: smooth_min/smooth_max, inverse_sqrt, is_close.
  • round(), math.floor/ceil/trunc on float sockets return integer sockets (Float To Integer).
  • Color: gamma(). Color + color (and -, *, /) uses Mix and keeps alpha; with a scalar or vector a color still acts as a vector. Breaking for color-color arithmetic, which returned a vector.
  • hash(seed) and blur() on the types their nodes support.
  • Grids: set_background, set_transform, advect, sdf_union/sdf_intersect/sdf_difference.
  • Bundles: store, get.<type>, has, join / | (later bundle wins, checked by evaluation), paths; geometry bundle() / set_bundle().
  • Data blocks: camera_info(), bone_info(), image info(), collection children(), material selection().

The exporter emits the methods where a spec can express them. Numeric methods are checked against Python/numpy in tests/test_socket_method_evaluation.py.

Found along the way: SDF Grid Boolean doesn't round-trip through codegen on main (#246).

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.37086% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.30%. Comparing base (048af3d) to head (8071c0d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/nodebpy/builder/socket.py 94.42% 15 Missing ⚠️
src/nodebpy/export/codegen.py 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #247      +/-   ##
==========================================
- Coverage   98.34%   98.30%   -0.05%     
==========================================
  Files         101      101              
  Lines       30283    30572     +289     
==========================================
+ Hits        29783    30055     +272     
- Misses        500      517      +17     

☔ 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.

@BradyAJohnston

Copy link
Copy Markdown
Owner Author

Squash-merged into main as a413f32 with the conflicts from #244, #245 and #248 resolved.

BradyAJohnston added a commit that referenced this pull request Oct 7, 2026
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