-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[usdGeom] PrimVar::ComputeFlattened not working for time-sampled faceVarying attributes #238
Comments
Ah, nice find, Paul. I suspect we changed from HasAuthoredValue() to Get() when we added attribute blocking (since a block *is* an authored value), and did so a little hastily. EarliestTime() is for just these kinds of queries. Should be able to fix quickly!
…--SpiffiPhone
On Jul 12, 2017, at 4:33 PM, Paul Molodowitch ***@***.***> wrote:
Description of Issue
If you create a time-sampled faceVarying primvar (ie, uv/st), then when you call ComputeFlattened() on it, it just returns the "raw" samples, not the expanded per-face-vert ones.
ie, if you have:
float2[] primvars:st (
interpolation = "faceVarying"
unauthoredValuesIndex = 0
)
float2[] primvars:st.timeSamples = {
0: [ (50 entries) ],
1: [ (50 entries) ],
...
}
int[] primvars:st:indices.timeSamples = {
0: [ (200 entries) ],
1: [ (200 entries) ],
...
}
...and you have a primvar for st, ComputeFlattened will return an array with 50 entries, not 200, as you would get if it weren't time sampled.
The reason is that PrimVar::IsIndexed() returns False, where I think it should return True. The culprit is that it's using indexAttr.Get() - ie, using the default time, which for a time-sampled attribute, returns nothing.
A possible (and easy) fix would be to change PrimVar::IsIndexed() to call Get with some arbitrary time (other than the UsdTimeCode::Default()) - 0, or UsdTimeCode::EarliestTime() perhaps.
Steps to Reproduce
Create a usd with a faceVarying time-sampled primvar.
call ComputeFlattened() on it - it will be the simple, non-indexed version.
call IsIndexed() on it - it will return False
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Filed as internal issue #148740. |
pixar-oss
pushed a commit
that referenced
this issue
Jul 25, 2017
for index attrs with only authored timeSamples. We now have UsdResolveInfo for answering "has value" questions without actually needing to read in an attribute value (in theory, though actually pulling off that optimization will require some SdfAbstractData API work, to allow USD to query a value's type, which in crate and other formats can be discovered without actually reading in the full value). Fixes #238 (Internal change: 1767403)
Saw that this was addressed (in 2746117) , so I'm closing this issue. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of Issue
If you create a time-sampled faceVarying primvar (ie, uv/st), then when you call ComputeFlattened() on it, it just returns the "raw" samples, not the expanded per-face-vert ones.
ie, if you have:
...and you have a primvar for st, ComputeFlattened will return an array with 50 entries, not 200, as you should get.
The reason is that PrimVar::IsIndexed() returns False, where I think it should return True. The culprit is that it's using
indexAttr.Get()
- ie, using the default time, which for a time-sampled attribute, returns nothing.A possible (and easy) fix would be to change
PrimVar::IsIndexed()
to callGet
with some arbitrary time (other than theUsdTimeCode::Default()
) - 0, orUsdTimeCode::EarliestTime()
perhaps.Steps to Reproduce
The text was updated successfully, but these errors were encountered: