6 #include <pxr/usd/usdGeom/basisCurves.h>
7 #include <pxr/usd/usdGeom/tokens.h>
23 if (cache ==
nullptr) {
32 curves.CreateBasisAttr(pxr::VtValue(pxr::UsdGeomTokens->bspline));
33 curves.CreateTypeAttr(pxr::VtValue(pxr::UsdGeomTokens->cubic));
35 pxr::VtArray<pxr::GfVec3f> points;
36 pxr::VtIntArray curve_point_counts;
37 curve_point_counts.reserve(psys->
totpart);
40 for (
int strand_index = 0; strand_index < psys->
totpart; ++strand_index) {
41 strand = cache[strand_index];
43 int point_count = strand->
segments + 1;
44 curve_point_counts.push_back(point_count);
47 points.push_back(pxr::GfVec3f(strand->
co));
51 pxr::UsdAttribute attr_points =
curves.CreatePointsAttr(pxr::VtValue(),
true);
52 pxr::UsdAttribute attr_vertex_counts =
curves.CreateCurveVertexCountsAttr(pxr::VtValue(),
true);
53 if (!attr_points.HasValue()) {
54 attr_points.Set(points, pxr::UsdTimeCode::Default());
55 attr_vertex_counts.Set(curve_point_counts, pxr::UsdTimeCode::Default());
58 usd_value_writer_.SetAttribute(attr_vertex_counts, pxr::VtValue(curve_point_counts), timecode);
61 pxr::VtArray<pxr::GfVec3f> colors;
62 colors.push_back(pxr::GfVec3f(cache[0]->
col));
63 curves.CreateDisplayColorAttr(pxr::VtValue(colors));
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
pxr::UsdTimeCode get_export_time_code() const
pxr::UsdUtilsSparseValueWriter usd_value_writer_
const USDExporterContext usd_export_context_
virtual bool check_is_animated(const HierarchyContext &context) const override
virtual void do_write(HierarchyContext &context) override
USDHairWriter(const USDExporterContext &ctx)
struct ParticleCacheKey ** pathcache
const pxr::SdfPath usd_path
const pxr::UsdStageRefPtr stage