USD Export: New Curves/Hair Support #105375

Merged
Michael Kowalski merged 19 commits from SonnyCampbell_Unity/blender:unity/T102376-USD-Curves-Export into main 2023-05-16 20:04:26 +02:00
1 changed files with 10 additions and 0 deletions
Showing only changes of commit a1587d6b01 - Show all commits

View File

@ -134,6 +134,12 @@ static void populate_curve_verts(const bke::CurvesGeometry &geometry,
const int tot_points = curve_points.size();
control_point_counts[i_curve] = tot_points;
/* For periodic linear curve, segment count = curveVertexCount.
For periodic cubic curve, segment count = curveVertexCount / vstep.
For nonperiodic linear curve, segment count = curveVertexCount - 1.
For nonperiodic cubic curve, segment count = ((curveVertexCount - 4) / vstep) + 1.
This function handles linear and Catmull-Rom curves. For Catmull-Rom, vstep is 1.
https://graphics.pixar.com/usd/dev/api/class_usd_geom_basis_curves.html */
if (is_cyclic) {
segments[i_curve] = tot_points;
}
@ -215,6 +221,10 @@ static void populate_curve_verts_for_bezier(const bke::CurvesGeometry &geometry,
const blender::float3 left_handle = handles_l[start_point_index];
verts.push_back(pxr::GfVec3f(left_handle[0], left_handle[1], left_handle[2]));
verts.push_back(pxr::GfVec3f(positions[start_point_index][0],
positions[start_point_index][1],
positions[start_point_index][2]));
}
const int tot_points = verts.size() - start_verts_count;