Skip to content

Commit 45291c6

Browse files
dalpixar-oss
authored andcommitted
usdRi: Authored old-style Ri attributes will win out over new-style primvars that are not authored (e.g. they exist solely due to applied API schema).
(Internal change: 2389437)
1 parent 2a5cec6 commit 45291c6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pxr/usd/usdRi/statementsAPI.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,17 @@ UsdRiStatementsAPI::GetRiAttributes(
211211
continue;
212212
}
213213
// If we encounter the same Ri attribute name encoded as both
214-
// a new and old style attribute, return only the new-style one.
214+
// a new and old style attribute, return only the new-style one,
215+
// unless the old style attribute is authored and the new-style
216+
// one is not (e.g. it exists due to applied schema).
215217
bool foundAsPrimvar = false;
218+
bool oldStylePropAuthored = prop.IsAuthored();
216219
for (size_t i=0; i < numNewStylePrimvars; ++i) {
220+
if (oldStylePropAuthored && !validProps[i].IsAuthored()) {
221+
// Old-style attribute wins if it is authored
222+
// but the new-style primvar is not.
223+
continue;
224+
}
217225
const std::string &primvarName =
218226
validProps[i].GetName().GetString();
219227
std::size_t nsOffset = primvarName.find(":");

0 commit comments

Comments
 (0)