22 if (cache ==
nullptr) {
31 curves.CreateBasisAttr(pxr::VtValue(pxr::UsdGeomTokens->bspline));
32 curves.CreateTypeAttr(pxr::VtValue(pxr::UsdGeomTokens->cubic));
34 pxr::VtArray<pxr::GfVec3f> points;
35 pxr::VtIntArray curve_point_counts;
36 curve_point_counts.reserve(psys->
totpart);
39 for (
int strand_index = 0; strand_index < psys->
totpart; ++strand_index) {
40 strand = cache[strand_index];
45 for (
int point_index = 0; point_index <
point_count; ++point_index, ++strand) {
46 points.push_back(pxr::GfVec3f(strand->
co));
50 pxr::UsdAttribute attr_points = curves.CreatePointsAttr(pxr::VtValue(),
true);
51 pxr::UsdAttribute attr_vertex_counts = curves.CreateCurveVertexCountsAttr(pxr::VtValue(),
true);
52 if (!attr_points.HasValue()) {
53 attr_points.Set(points, pxr::UsdTimeCode::Default());
54 attr_vertex_counts.Set(curve_point_counts, pxr::UsdTimeCode::Default());
57 usd_value_writer_.SetAttribute(attr_vertex_counts, pxr::VtValue(curve_point_counts), timecode);
60 pxr::VtArray<pxr::GfVec3f> colors;
61 colors.push_back(pxr::GfVec3f(cache[0]->
col));
62 curves.CreateDisplayColorAttr(pxr::VtValue(colors));
66 auto prim = curves.GetPrim();
struct ParticleCacheKey ** pathcache
const pxr::SdfPath usd_path
const pxr::UsdStageRefPtr stage