Page MenuHome

Geometry Nodes: Add Spline Point Count to Spline Length Node
ClosedPublic

Authored by Johnny Matthews (guitargeek) on Nov 19 2021, 5:06 AM.

Details

Summary

Spline Length Node

  • Add Spline Point Count Output

Diff Detail

Repository
rB Blender

Event Timeline

Johnny Matthews (guitargeek) requested review of this revision.Nov 19 2021, 5:06 AM
Johnny Matthews (guitargeek) created this revision.

Curve Length Node

  • add Curve Total Points
  • add Spline Count

Spline Length

  • add Spline Point Count
  • add Segment Length
Johnny Matthews (guitargeek) retitled this revision from Geometry Nodes: Expand Spline Length Input Node - WIP to Geometry Nodes: Expand Spline Length and Curve Length.Nov 19 2021, 8:56 PM
Johnny Matthews (guitargeek) edited the summary of this revision. (Show Details)
Johnny Matthews (guitargeek) edited the summary of this revision. (Show Details)
source/blender/nodes/geometry/nodes/node_geo_curve_length.cc
40–41 ↗(On Diff #45009)

These functions allocate arrays, and shouldn't be called when only the last value is needed.

Since this keeps coming up, maybe this patch could add total_length() and point_size() functions to CurveEval

  • Add total_length() and point_size() to CurveEval.
  • Merge branch 'master' into curvelengthnode
  • Merge branch 'master' into curvelengthnode
  • Remove declarations of new CurveEval functions
  • Fix function name
  • Update Node name to Curve Metadata
  • name changing
  • Finish Rename + Versioning
  • Merge branch 'master' into curvelengthnode
  • Split segment length out into it's own node
  • Update for cyclic
  • Revert Curve Length Node
  • Merge branch 'master' into curvelengthnode
Johnny Matthews (guitargeek) retitled this revision from Geometry Nodes: Expand Spline Length and Curve Length to Geometry Nodes: Expand Spline Length and add Segment Length.Nov 24 2021, 11:07 PM
Johnny Matthews (guitargeek) edited the summary of this revision. (Show Details)
  • Merge branch 'master' into curvelengthnode
  • Split Spline point count out to its own patch
Johnny Matthews (guitargeek) retitled this revision from Geometry Nodes: Expand Spline Length and add Segment Length to Geometry Nodes: Add Spline Point Count to Spline Length Node.Nov 25 2021, 6:55 PM
Johnny Matthews (guitargeek) edited the summary of this revision. (Show Details)
Hans Goudey (HooglyBoogly) requested changes to this revision.Nov 26 2021, 3:11 PM

Looking good. It would be nice to have a screenshot of the node in the patch.

Just a few smaller code style comments.

source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc
29

There's a section about sections in the style guide: https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Comments

I think for this case I like the style after the following non-doxy sections are also acceptable:

104

This should use spline.size() directly, rather than the size of only the positions. Functionally it's the same, but it's just a little clearer.

115

Return {} instead.

This revision now requires changes to proceed.Nov 26 2021, 3:11 PM
Johnny Matthews (guitargeek) marked 3 inline comments as done.
Johnny Matthews (guitargeek) edited the summary of this revision. (Show Details)
  • Formatting Changes
  • Minor changes
  • Merge branch 'master' into splinelengthnode
Hans Goudey (HooglyBoogly) accepted this revision.EditedNov 30 2021, 10:12 PM

Looks good! Please wait for committing until we decide about node socket versioning tomorrow though.

Also, the patch description could use a few more words describing what this does to someone with less context than us.

source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc
33

Could you add a newline after these comment sections?

This revision is now accepted and ready to land.Nov 30 2021, 10:12 PM