Skip to content

Commit

Permalink
Reverted primvar diff changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhicheng Ye authored and Zhicheng Ye committed May 4, 2022
1 parent 7801aee commit 536565b
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions plugin/al/usdmayautils/AL/usdmaya/utils/DiffPrimVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1637,19 +1637,15 @@ TfToken guessColourSetInterpolationTypeExtensive(

// check for per-vertex assignment
std::vector<uint32_t> indicesMap;
indicesMap.resize(numPoints);
std::set<int> visitedIndices;
indicesMap.resize(numPoints, -1);

{
for (uint32_t i = 0, n = pointIndices.length(); i < n; ++i) {
auto index = pointIndices[i];
if (uint32_t(index + 1) > numPoints) {
indicesMap.resize(index + 1);
}
if (visitedIndices.find(index) == visitedIndices.end()) {
auto lastIndex = indicesMap[index];
if (lastIndex == 0xFFFFFFFF) {
indicesMap[index] = i;
visitedIndices.emplace(index);
} else {
auto lastIndex = indicesMap[index];
#if defined(__SSE__)

const f128 rgba0 = loadu4f(rgba + 4 * lastIndex);
Expand Down Expand Up @@ -1744,19 +1740,13 @@ TfToken guessColourSetInterpolationTypeExtensive(

// check for per-vertex assignment
std::vector<uint32_t> indicesMap;
indicesMap.resize(numPoints);
std::set<int> visitedIndices;
indicesMap.resize(numPoints, -1);
for (uint32_t pntInx = 0, n = pointIndices.length(); pntInx < n; ++pntInx) {
auto index = pointIndices[pntInx];
if (uint32_t(index + 1) > numPoints) {
indicesMap.resize(index + 1);
}

if (visitedIndices.find(index) == visitedIndices.end()) {
auto lastIndex = indicesMap[index];
if (lastIndex == 0xFFFFFFFF) {
indicesMap[index] = pntInx;
visitedIndices.emplace(index);
} else {
auto lastIndex = indicesMap[index];
// if not, check to see if the indices differ, but the values are the same
const float x0 = rgba[4 * lastIndex + 0];
const float y0 = rgba[4 * lastIndex + 1];
Expand Down

0 comments on commit 536565b

Please sign in to comment.