Page MenuHome

Geometry Nodes: Modify existing mesh in split edges node
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Nov 25 2022, 6:24 PM.

Details

Summary

Instead of creating a new mesh from scratch, modify an existing mesh.
This allows us to keep derived caches for triangulation and bounds
alive more easily, and allows keeping materials and non-generic
attributes like vertex groups alive on the mesh.

It also has other performance benefits, since face and face corner
attributes aren't affected at all, and because of reduced overhead
from not allocating a new mesh.

Updating edge attributes is a bit more complicated now, since we
have to completely replace the arrays but keep the existing attribute
IDs around. The new mesh update tag is also slightly too specific IMO.
But I think both of those things will improve in the future because
of existing plans for further refactoring these areas:

  • New attribute storage that gives pointer stability
  • Further use and granularity of mesh update tagging that will make the correct API more clear

Fixes T102711

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Nov 25 2022, 6:24 PM
Hans Goudey (HooglyBoogly) created this revision.

Looks good. I think this change is indeed the best solution to T102711: Regression: Geometry Node: Split edges lost materials

Hopefully the current ugliness to transfer the edge domain attributes can be abstracted away somewhat in the future, or at least made simpler.
I don't know if you looked into transferring the attributes in parallel, but that should be a separate patch anyway. In any case, the attribute transferring
is not the main bottleneck.

This revision is now accepted and ready to land.Nov 26 2022, 1:18 PM