Page MenuHome

Curves: Remove use of CurveEval in sculpt brushes
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Jul 1 2022, 9:28 PM.

Details

Summary

This commit removes the use of PolySpline for resampling curves and
replaces it with the length parameterization utility for that purpose.
That leaves only 5 remaining uses of the BKE_spline.hh header,
not including existing patches. I didn't test performance, but I
would expect the shrinking to be slightly faster because I reused
some arrays to avoid allocating them for every curve. I noted some
potential improvements in the "add curves" function.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Jul 1 2022, 9:28 PM
Hans Goudey (HooglyBoogly) created this revision.
Jacques Lucke (JacquesLucke) requested changes to this revision.Jul 1 2022, 9:45 PM

Doesn't seem to work correctly currently. In master it works correctly.

source/blender/geometry/intern/add_curves_on_mesh.cc
211

Could use some bigger inline buffer to avoid an allocation every time.

This revision now requires changes to proceed.Jul 1 2022, 9:45 PM

Fix adding curves. I missed that "lookup evaluator factor" was used instead of "lookup evaluated length".
I also used an inline buffer of 32 for the arrays, that should cover most hair use cases.

Hans Goudey (HooglyBoogly) marked an inline comment as done.Jul 3 2022, 3:38 AM

Looks good. However, I can make it crash when there are curves with a single point. (didn't check if the same issue exists in master)

To reproduce it, just click on the cube in the file below (triggers in assert in debug builds).

I don't have to look at the patch again when that is fixed.

This revision is now accepted and ready to land.Jul 19 2022, 10:45 PM