29 if (cache ==
nullptr) {
38 curves.CreateBasisAttr(pxr::VtValue(pxr::UsdGeomTokens->bspline));
39 curves.CreateTypeAttr(pxr::VtValue(pxr::UsdGeomTokens->cubic));
42 curves.CreateBasisAttr(pxr::VtValue(pxr::UsdGeomTokens->catmullRom));
43 curves.CreateTypeAttr(pxr::VtValue(pxr::UsdGeomTokens->cubic));
44 curves.CreateWrapAttr(pxr::VtValue(pxr::UsdGeomTokens->pinned));
47 pxr::VtArray<pxr::GfVec3f> points;
48 pxr::VtIntArray curve_point_counts;
49 curve_point_counts.reserve(psys->
totpart);
56 for (
int strand_index = 0; strand_index < psys->
totpart; ++strand_index) {
57 strand = cache[strand_index];
59 int point_count = strand->
segments + 1;
60 curve_point_counts.push_back(point_count);
62 for (
int point_index = 0; point_index < point_count; ++point_index, ++strand) {
64 points.push_back(pxr::GfVec3f(vert.x, vert.y, vert.z));
68 pxr::UsdAttribute attr_points =
curves.CreatePointsAttr(pxr::VtValue(),
true);
69 pxr::UsdAttribute attr_vertex_counts =
curves.CreateCurveVertexCountsAttr(pxr::VtValue(),
true);
70 if (!attr_points.HasValue()) {
71 attr_points.Set(points, pxr::UsdTimeCode::Default());
72 attr_vertex_counts.Set(curve_point_counts, pxr::UsdTimeCode::Default());
75 usd_value_writer_.SetAttribute(attr_vertex_counts, pxr::VtValue(curve_point_counts), time);
78 pxr::VtArray<pxr::GfVec3f> colors;
79 colors.push_back(pxr::GfVec3f(cache[0]->col));
80 curves.CreateDisplayColorAttr(pxr::VtValue(colors));
84 auto prim =
curves.GetPrim();
struct ParticleCacheKey ** pathcache
const USDExportParams & export_params
const pxr::SdfPath usd_path
const pxr::UsdStageRefPtr stage