Skip to content
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

Closed
pmolodo opened this issue Jul 12, 2017 · 3 comments

Comments

@pmolodo
Copy link
Contributor

pmolodo commented Jul 12, 2017

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 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 call Get with some arbitrary time (other than the UsdTimeCode::Default()) - 0, or UsdTimeCode::EarliestTime() perhaps.

Steps to Reproduce

  1. Create a usd with a faceVarying time-sampled primvar.
  2. call ComputeFlattened() on it - it will be the simple, non-indexed version.
  3. call IsIndexed() on it - it will return False
@spiffmon
Copy link
Member

spiffmon commented Jul 13, 2017 via email

@jtran56
Copy link

jtran56 commented Jul 17, 2017

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)
@pmolodo
Copy link
Contributor Author

pmolodo commented Jul 28, 2017

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants