Page MenuHome

PoC: Allow shrinkwrap constraint to target curves
Changes PlannedPublic

Authored by Sergey Sharybin (sergey) on May 5 2022, 12:52 PM.

Details

Reviewers
None
Summary

This implies curve to be converted to mesh during evaluation so
that the constraint and modifier behavior is as close to the
feature parity between mesh and curve as possible.

In order to allow shrink-wrap to a curve without surface a new
"Edge" mode was added to the shrunkwrap constraint and modifier.

Diff Detail

Repository
rB Blender
Branch
shrinkwrap_edge (branched from master)
Build Status
Buildable 21977
Build 21977: arc lint + arc unit

Event Timeline

Sergey Sharybin (sergey) requested review of this revision.May 5 2022, 12:52 PM
Sergey Sharybin (sergey) created this revision.

I think this should be implemented a bit differently, without the mesh conversion, and using the proper evaluated curves rather than the displist.
Basically. the proper way to do this is more like D13890, but using CurvesGeometry rather than CurveEval. At the moment, any code that uses DispList ignores the more recent developments for curves.
Also, in that patch we discussed not sharing a common "Edge" mode between meshes and curves.

Converting the curves to a mesh just because another object references the object in a modifier also seems unexpected from a user level-- it is visible change that will mean the curves aren't accessible in geometry nodes, etc.

I think you've missed that this is proof of concept. Waiting for an another patch to be accepted or implementing fully battle-proofed BVHTree and Shrinkwrap modules just to find out that the idea is not really useful for its initial intended use is not something you do in the early stages.

Also, in that patch we discussed not sharing a common "Edge" mode between meshes and curves.

I do not see such discussion. In fact, I do not see any discussion there.

it is visible change that will mean the curves aren't accessible in geometry nodes, etc.

I am not sure what you mean by visible change. Converting curve to mesh should not change the way the object is rendered, at all.

Sergey Sharybin (sergey) planned changes to this revision.May 5 2022, 3:21 PM

Talked with Hans and the art team in the studio.

The visibility of changes with Curve->Mesh is not in rendering, but in how artists interact with object (attributes, geometry nodes etc). Totally fair point, and indeed avoiding Curve->Mesh is something to avoid as much as possible.

With some geometry node trickery it is possible to use Mesh codepath in the shrinkwrap. Still need to have an Edge mode by the looks of it though.
We are also looking into possibility to orient bone using tangent and normal of the curve.