Curves: add warning when invalid uv map is used when adding curves

UV maps that are used for surface attachment must not have overlapping
uv islands, because then the same uv coordinate would correspond to
multiple surface positions.

Ref T99936.
This commit is contained in:
2022-07-25 11:42:27 +02:00
parent 53113a2e57
commit 1c05f30e4d
6 changed files with 33 additions and 4 deletions

View File

@@ -40,12 +40,19 @@ struct AddCurvesOnMeshInputs {
* interpolation is used.
*/
KDTree_3d *old_roots_kdtree = nullptr;
bool r_uv_error = false;
};
struct AddCurvesOnMeshOutputs {
bool uv_error = false;
};
/**
* Generate new curves on a mesh surface with the given inputs. Existing curves stay intact.
*/
void add_curves_on_mesh(bke::CurvesGeometry &curves, const AddCurvesOnMeshInputs &inputs);
AddCurvesOnMeshOutputs add_curves_on_mesh(bke::CurvesGeometry &curves,
const AddCurvesOnMeshInputs &inputs);
float3 compute_surface_point_normal(const MLoopTri &looptri,
const float3 &bary_coord,