Page MenuHome

Geometry Nodes: Set Handle Type Node
ClosedPublic

Authored by Johnny Matthews (guitargeek) on Jul 21 2021, 10:01 PM.

Details

Summary

This node takes a curve and a point selection and allows you to set the specified (or all) points left/right or both handles to a given type.

Diff Detail

Repository
rB Blender

Event Timeline

Johnny Matthews (guitargeek) requested review of this revision.Jul 21 2021, 10:01 PM
Johnny Matthews (guitargeek) created this revision.
Hans Goudey (HooglyBoogly) requested changes to this revision.Jul 22 2021, 4:56 AM

Looks great! Just a few smaller comments.

  • I wonder if it would make sense to have an NodeWarningType::Info message when there are no Bezier splines in the curve. Maybe it would help someone who expected it to work on poly splines or something.
  • NodeGeometrySetCurveHandles would probably make sense, since we'll have other nodes that deal with handle types.
source/blender/makesrna/intern/rna_nodetree.c
9447–9466

I really like your descriptions here! Two comments:

  • For better or worse, the periods are added automatically by the tooltip system.
  • We have icons for these, which we might as well use-- ICON_HANDLE_VECTOR, etc.
9470–9471
  • No periods in the descriptions
  • Handle should probably be plural
source/blender/nodes/geometry/nodes/node_geo_curve_handles.cc
16–21 ↗(On Diff #39788)

Generally the different modules / prefixes get newlines between them.

55 ↗(On Diff #39788)

Thsee parentheses are unnecessary: (params.node().storage) -> params.node().storage

68 ↗(On Diff #39788)

handlesd -> handles

81–94 ↗(On Diff #39788)

Best to just do this once, rather than in the loop. Also, you can make it a separate function, then you can use return in the switch cases, which is a bit nicer.

This revision now requires changes to proceed.Jul 22 2021, 4:56 AM
Johnny Matthews (guitargeek) marked 6 inline comments as done.

Code cleanup and Hans' notes applied

This revision was not accepted when it landed; it landed in state Needs Review.Jul 22 2021, 4:56 PM
This revision was automatically updated to reflect the committed changes.

I'll make a couple small changes when committing.

source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc
69

This function doesn't have a return for all possible values of type:

BLI_assert_unreachable();
return BezierSpline::HandleType::Auto;
98

I changed the variable names here a bit and checked the spline type and continued, just to decrease indentation a bit.