Skip to content

Commit

Permalink
Fix crash that was occurring when scales and orientations were not sp…
Browse files Browse the repository at this point in the history
…ecified.

Fixes #239

(Internal change: 1767291)
  • Loading branch information
pixar-oss committed Jul 25, 2017
1 parent 0516c16 commit 9746195
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ PxrUsdInShipped_PointInstancerUtils::ComputeInstanceTransformsAtTime(
std::vector<GfMatrix4d> &curr = xforms[a];
curr.reserve(numInstances);

// Get sample-dependent values. Stop if topology differs.
// Get sample-dependent values. Stop if topology differs, but permit
// unspecified scales and orientations.
positionsAttr.Get(&positions, sampleTimes[a]);
if (positions.size() != numInstances) {
break;
Expand All @@ -95,8 +96,12 @@ PxrUsdInShipped_PointInstancerUtils::ComputeInstanceTransformsAtTime(
for (auto i = decltype(numInstances){0}; i < numInstances; ++i) {
GfTransform transform;
transform.SetTranslation(positions[i]);
transform.SetScale(scales[i]);
transform.SetRotation(GfRotation(orientations[i]));
if (scales.size() > 0) {
transform.SetScale(scales[i]);
}
if (orientations.size() > 0) {
transform.SetRotation(GfRotation(orientations[i]));
}
curr.push_back(transform.GetMatrix());
}

Expand Down

0 comments on commit 9746195

Please sign in to comment.