Skip to content

Commit

Permalink
added time support for face indices
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeioris committed Oct 24, 2024
1 parent c9a7815 commit f1ea8cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/usdGeom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ Interpolation GeomMesh::get_normalsInterpolation() const {
return Interpolation::Vertex; // default 'vertex'
}

const std::vector<int32_t> GeomMesh::get_faceVertexCounts() const {
const std::vector<int32_t> GeomMesh::get_faceVertexCounts(double time) const {
std::vector<int32_t> dst;

if (!faceVertexCounts.authored() || faceVertexCounts.is_blocked()) {
Expand All @@ -825,15 +825,14 @@ const std::vector<int32_t> GeomMesh::get_faceVertexCounts() const {

if (auto pv = faceVertexCounts.get_value()) {
std::vector<int32_t> val;
// TOOD: timesamples
if (pv.value().get_scalar(&val)) {
if (pv.value().get(time, &val, value::TimeSampleInterpolationType::Held)) {
dst = std::move(val);
}
}
return dst;
}

const std::vector<int32_t> GeomMesh::get_faceVertexIndices() const {
const std::vector<int32_t> GeomMesh::get_faceVertexIndices(double time) const {
std::vector<int32_t> dst;

if (!faceVertexIndices.authored() || faceVertexIndices.is_blocked()) {
Expand All @@ -847,8 +846,7 @@ const std::vector<int32_t> GeomMesh::get_faceVertexIndices() const {

if (auto pv = faceVertexIndices.get_value()) {
std::vector<int32_t> val;
// TOOD: timesamples
if (pv.value().get_scalar(&val)) {
if (pv.value().get(time, &val, value::TimeSampleInterpolationType::Held)) {
dst = std::move(val);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/usdGeom.hh
Original file line number Diff line number Diff line change
Expand Up @@ -797,14 +797,14 @@ struct GeomMesh : GPrim {
///
/// @return face vertex counts vector(copied)
///
const std::vector<int32_t> get_faceVertexCounts() const;
const std::vector<int32_t> get_faceVertexCounts(double time = value::TimeCode::Default()) const;

///
/// @brief Returns `faceVertexIndices`.
///
/// @return face vertex indices vector(copied)
///
const std::vector<int32_t> get_faceVertexIndices() const;
const std::vector<int32_t> get_faceVertexIndices(double time = value::TimeCode::Default()) const;

//
// SubD attribs.
Expand Down

0 comments on commit f1ea8cb

Please sign in to comment.