Page MenuHome

Curves: Port tangent and normal calculation to the new data-block
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Apr 9 2022, 1:13 AM.

Details

Summary

Port the "Normal" and "Curve Tangent" nodes to the new curves data-block
to avoid the conversion to CurveEval. This should make them faster by
avoiding all that copying, but otherwise nothing else has changed.

This also includes a fix to move the normal mode as a built-in curve
attribute when converting to and from CurveEval. The attribute is
needed because the option is used implicitly in many nodes currently.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenkernel/BKE_curves.hh
184

grammar (calculated)

399

In the context of poly splines it is unclear which basis functions this comment is talking about (this is in the poly namespace).

628

Looks like it would be good to cache this rather sooner than later.

source/blender/blenkernel/intern/geometry_component_curves.cc
188

clear + resize for better performance. Maybe we could have a utility method for that. Similar to Array::reinitialize

192

A comment for why evaluated_normals is not used here would be good.

This revision is now accepted and ready to land.Apr 9 2022, 11:15 AM
source/blender/blenkernel/BKE_curves.hh
628

Yes, agreed, and it should be pretty simple, I'll look into that next week.