Page MenuHome

Curves: Interpolate point count in add brush
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on May 6 2022, 3:53 PM.

Details

Summary

This commit adds an option to interpolate the number of control points in new
curves based on the count in neighboring existing curves. The idea is to provide
a more automatic default than manually controlling the number of points in a
curve, so users don't have to think about the resolution quite as much.

Internally, some utilities for creating new curves are extracted to a new header
file. These can be used for the various nodes and operators that create new curves.

The top-bar UI will be adjusted in a separate patch, probably moving all of
the settings that affect the size and shape of the new curves into a popover.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.May 6 2022, 3:53 PM
Jacques Lucke (JacquesLucke) created this revision.
Hans Goudey (HooglyBoogly) added inline comments.
source/blender/editors/sculpt_paint/curves_sculpt_add.cc
237–260

I think I'd recommend doing this a bit differently--

  • Resize the curves to the correct number of curves
  • Put the point count for each curve right in its offsets array
  • Accumulate the counts to make them into offsets (in D14769 I moved accumulate_counts_to_offsets to BKE_curves.hh)
  • Resize the point arrays to the last offset size
  • Then finally initialize point attributes.

I like how that workflow is basically standardized, the same thing can be done whenever creating CurvesGeometry with a known size for every curve.

Hans Goudey (HooglyBoogly) retitled this revision from Curves: Interpolate number of control points for new curves from neighboring curves. (WIP) to Curves: Interpolate point count in add brush.
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)
Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenkernel/BKE_curves_utils.hh
18

bke:: is unnecessary

This revision is now accepted and ready to land.May 10 2022, 6:07 PM