Page MenuHome

Geometry Nodes: Remove unnecessary copy when replacing data
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Dec 9 2021, 10:36 PM.

Details

Summary

In the replace_mesh/replace_curve etc. methods, the component
was retrieved with write access. Retrieving with write access will
duplicate the data if the component has another user. This means that
the replaced geometry data was often duplicated just to be deleted
the moment afterwards.

I expect this would have a large impact in performance in some specific
situations when dealing with large geometry. In the flowershop scene
where there are many small meshes, I didn't observe a significant
difference (1% improvement of 40 runs).

I also made it so that replacing a geometry set's data with the same
data that's already in the set won't crash. I couldn't decide whether
to do that or assert, but this seems safer.

Diff Detail

Repository
rB Blender