25 if (cache ==
nullptr) {
34 curves.CreateBasisAttr(pxr::VtValue(pxr::UsdGeomTokens->bspline));
35 curves.CreateTypeAttr(pxr::VtValue(pxr::UsdGeomTokens->cubic));
38 curves.CreateBasisAttr(pxr::VtValue(pxr::UsdGeomTokens->catmullRom));
39 curves.CreateTypeAttr(pxr::VtValue(pxr::UsdGeomTokens->linear));
40 curves.CreateWrapAttr(pxr::VtValue(pxr::UsdGeomTokens->pinned));
43 pxr::VtArray<pxr::GfVec3f> points;
44 pxr::VtIntArray curve_point_counts;
45 curve_point_counts.reserve(psys->
totpart);
52 for (
int strand_index = 0; strand_index < psys->
totpart; ++strand_index) {
53 strand = cache[strand_index];
58 for (
int point_index = 0; point_index <
point_count; ++point_index, ++strand) {
60 points.push_back(pxr::GfVec3f(vert.x, vert.y, vert.z));
64 pxr::UsdAttribute attr_points = curves.CreatePointsAttr(pxr::VtValue(),
true);
65 pxr::UsdAttribute attr_vertex_counts = curves.CreateCurveVertexCountsAttr(pxr::VtValue(),
true);
66 if (!attr_points.HasValue()) {
67 attr_points.Set(points, pxr::UsdTimeCode::Default());
68 attr_vertex_counts.Set(curve_point_counts, pxr::UsdTimeCode::Default());
71 usd_value_writer_.SetAttribute(attr_vertex_counts, pxr::VtValue(curve_point_counts), time);
74 pxr::VtArray<pxr::GfVec3f> colors;
75 colors.push_back(pxr::GfVec3f(cache[0]->
col));
76 curves.CreateDisplayColorAttr(pxr::VtValue(colors));
80 auto prim = curves.GetPrim();
struct ParticleCacheKey ** pathcache