Page MenuHome

Geometry Nodes: Begin conversion to new curves
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Feb 18 2022, 6:32 AM.

Details

Summary

This commit changes CurveComponent to store the new curve
type by adding conversions to and from CurveEval in most nodes.
This will temporarily make performance of curves in geometry nodes
much worse, but as functionality is implemented for the new type
and it is used in more places, performance will become better than before.

We still use CurveEval for drawing curves, because the new Curves
data-block has no evaluated points yet. So the Curve ID is still generated
for rendering in the same way as before. It's also still needed for drawing
curve object edit mode overlays.

The old curve component isn't removed yet, because it is still used to
provide the attribute API used to implement the conversions back and
forth.

A few more attributes are added to make this possible:

  • nurbs_weight: The weight for each control point on NURBS curves (D12004)
  • nurbs_order: The order of the NURBS curve
  • knots_mode: This is less defined at the moment, but still necessary for conversion.
  • handle_type_{left/right}: An 8 bit integer attribute.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Feb 18 2022, 6:32 AM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) retitled this revision from Geometry Nodes: Begin conversion to new curves to Geometry Nodes: Begin conversion to new curves (WIP).
Hans Goudey (HooglyBoogly) set the repository for this revision to rB Blender.Feb 23 2022, 5:10 AM
Hans Goudey (HooglyBoogly) retitled this revision from Geometry Nodes: Begin conversion to new curves (WIP) to Geometry Nodes: Begin conversion to new curves.
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)

Finish change

source/blender/blenkernel/BKE_geometry_set.hh
466–503

I'll change these methods to add the s after curve in a separate commit.

Jacques Lucke (JacquesLucke) requested changes to this revision.Feb 25 2022, 4:00 PM

This seems to break the bf_wavefront_obj_tests test.

source/blender/blenkernel/BKE_geometry_set.hh
636

Missing .

source/blender/blenkernel/intern/curve_eval.cc
377

Can use VArray_Span here directly insead of creating an intermediate variable.

source/blender/blenkernel/intern/curves_geometry.cc
159

Use Span::contains

source/blender/blenkernel/intern/customdata.cc
1780

Why this change?

source/blender/geometry/intern/realize_instances.cc
448

use > 0

source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc
383

use src_splines

This revision now requires changes to proceed.Feb 25 2022, 4:00 PM

Interesting, I'll look into those tests.

source/blender/blenkernel/intern/curve_eval.cc
377

Oh, good to know!

source/blender/blenkernel/intern/customdata.cc
1780

Oh, right, I meant to commit that separately. It seems that without this default name, the custom data code considers this a layer like "MVert", where there can be only one layer with that type at a time.

Hans Goudey (HooglyBoogly) marked 6 inline comments as done.

Fix OBJ tests, various other cleanups, fixes, and resolutions of review comments

Jacques Lucke (JacquesLucke) requested changes to this revision.Feb 27 2022, 1:55 PM

The flower shop scene changes with this patch currently. I simplified it down to this (maybe there are other bugs when this is fixed):


This revision now requires changes to proceed.Feb 27 2022, 1:55 PM

Thanks for catching that. The optimization for a single poly spline was still being used in the tangent node.

This revision is now accepted and ready to land.Feb 28 2022, 3:19 PM