Page MenuHome

Geometry Nodes: Curve Extract Spline Node
AbandonedPublic

Authored by Johnny Matthews (guitargeek) on Jul 29 2021, 5:08 PM.

Details

Summary

This node takes a curve input and a selection (Attribute (bool) or int index). The spline from the input curve with that index chosen (modulus to number of splines for "wrapping") or with a "true" value on the attribute is output to a new curve.

Use cases:

  • Multiple splines that are interchangeable in a single curve and you want to select one of them or one of them at random.
  • Animated lightning. Where each spline is a shape of a bolt. then you could keyframe the spline number.
  • You have a single curve object and you just want to pull out a single part of it
  • Reordering the splines in a curve without changing the original. Curve => Multiple Spline Extracts => Reordered into a Join Geometry
  • Pulling out multiple splines from a curve based on an attribute

Diff Detail

Repository
rB Blender

Event Timeline

Johnny Matthews (guitargeek) requested review of this revision.Jul 29 2021, 5:08 PM
Johnny Matthews (guitargeek) created this revision.

Hi @Johnny Matthews (guitargeek) I wonder what's the exact use case you wrote this node for? Isn't it easier to drag and drop curve objects(with one spline in it) into a node tree than blindly trying to set the right spline index?

Hi @Johnny Matthews (guitargeek) I wonder what's the exact use case you wrote this node for? Isn't it easier to drag and drop curve objects(with one spline in it) into a node tree than blindly trying to set the right spline index?

Some ideas:

  • You have multiple splines that are interchangeable in a single curve and you want to select one of them or one of them at random.
  • Animated lightning. Where each spline is a shape of a bolt. then you could keyframe the spline number.
  • Another might be where you have a single curve object and you just want to pull out a single part of it
  • Reordering the splines in a curve without changing the original. Curve => Multiple Spline Extracts => Reordered into a Join Geometry

There is some overlap with nodes like point geometry delete, etc. And I'm not totally convinced that an index input makes more sense than a selection attribute input, but generally I think the node is reasonable.

I think I'd remove the "Recenter" feature though. That should be solved more generally with a way to sample a single location from the spline and then a transform node (another thing that would work perfectly with the fields proposal!)

Maybe the use cases could be part of the patch description.

source/blender/nodes/geometry/nodes/node_geo_curve_extract_spline.cc
51

You can use spline.translate()

Johnny Matthews (guitargeek) edited the summary of this revision. (Show Details)
  • Remove recenter option
  • Add Attribute Selection
  • Make format did a number on a couple files
Hans Goudey (HooglyBoogly) requested changes to this revision.Aug 12 2021, 7:45 PM

I think we should wait until after the attribute workflow changes are committed to master, so we can see how this fits/whether it is still necessary.

release/scripts/startup/nodeitems_builtins.py
210–256

Unrelated changes

source/blender/makesrna/intern/rna_nodetree.c
9198

Even though it's a bit annoying, I think, this should use its own enum, because it's more about choosing whether to use a selection or an index.

This revision now requires changes to proceed.Aug 12 2021, 7:45 PM