Page MenuHome

Curves: Use uv coordinates to attach curves to mesh.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Jun 4 2022, 1:50 PM.

Details

Summary

The ReverseUVLookup class has a trivial implementation right now, that has to be replaced with something more efficient soon. I think it's ok to work on that data structure and to review it separately. It's currently only used when reattaching curves to the surface after deformation.

This updates the hair attachment approach based on T95776.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Jun 4 2022, 1:50 PM
Jacques Lucke (JacquesLucke) created this revision.

I think the description should give a user-level description of the change too, i.e. explaining what the reverse UV lookup is for and the consequences of the trivial implementation.

source/blender/editors/curves/intern/curves_ops.cc
548–557

I could imagine this looking a bit simpler and being more reusable if it was extracted to a separate function that had const Mesh & and const Curves & inputs. Then use_uvs could just be !surface_uv_map.is_empty().

source/blender/editors/sculpt_paint/curves_sculpt_add.cc
866–882

It would be a bit simpler to use curves_->offsets()[neighbor_curve_i] rather than .first(), but I'm fine with this too.

source/blender/geometry/GEO_reverse_uv_lookup.hh
19 ↗(On Diff #52260)

For something that's more of a "factory", the name sounds a bit too much like a noun IMO. That said, I'm not totally sure what would be better. Maybe ReverseUVSampler?

source/blender/geometry/intern/reverse_uv_lookup.cc
21–25 ↗(On Diff #52260)

Would be nice to have C++ implementations of these C math functions and macros, but I'm fine with waiting for that if you'd like.

This revision is now accepted and ready to land.Jun 4 2022, 3:02 PM