PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.98k stars 1.18k forks source link

Indexed primvars require int[] indices #859

Open AlexSchwank opened 5 years ago

AlexSchwank commented 5 years ago

Description of Issue

UsdGeomPrimvar::ComputeFlattened requires the indices of indexed primvars to be of type int[] (see https://github.com/PixarAnimationStudios/USD/blob/master/pxr/usd/lib/usdGeom/primvar.cpp#L323). We have files using uint[] for the indices (the geometry is an Alembic file) so those primvars don't make it into the stage but produce this error message:

Coding Error (secondary thread): in ComputeFlattened at line 330 of /.../pxr/usd/lib/usdGeom/primvar.cpp -- No indices authored for indexed primvar </root/pCube1.primvars:myUIntPrimvar>.

UsdView displays them fine as it doesn't call ComputeFlattened but the issue appears in DCCs like Katana.

Steps to Reproduce

  1. Try to load attached USD file in Katana: uintPrimvarIndices.usda.zip

  2. myIntPrimvar will be loaded as attribute but not myUIntPrimvar

Package Versions

19.05

spiffmon commented 5 years ago

So the problem is that usdAbc is not performing the needed data conversion, yes?

On Thu, May 30, 2019 at 8:11 AM AlexSchwank notifications@github.com wrote:

Description of Issue

UsdGeomPrimvar::ComputeFlattened requires the indices of indexed primvars to be of type int[] (see https://github.com/PixarAnimationStudios/USD/blob/master/pxr/usd/lib/usdGeom/primvar.cpp#L323). We have files using uint[] for the indices (the geometry is an Alembic file) so those primvars don't make it into the stage but produce this error message:

Coding Error (secondary thread): in ComputeFlattened at line 330 of /.../pxr/usd/lib/usdGeom/primvar.cpp -- No indices authored for indexed primvar </root/pCube1.primvars:myUIntPrimvar>.

UsdView displays them fine as it doesn't call ComputeFlattened but the issue appears in DCCs like Katana. Steps to Reproduce

1.

Try to load attached USD file in Katana: uintPrimvarIndices.usda.zip https://github.com/PixarAnimationStudios/USD/files/3237566/uintPrimvarIndices.usda.zip 2.

myIntPrimvar will be loaded as attribute but not myUIntPrimvar

Package Versions

19.05

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PixarAnimationStudios/USD/issues/859?email_source=notifications&email_token=ABPOU2FVHFVCS7RCS3OTRRTPX7VC5A5CNFSM4HRF6XX2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWX42NA, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPOU2HCMWUTA7B2BPALGY3PX7VC5ANCNFSM4HRF6XXQ .

-- --spiffiPhone

AlexSchwank commented 5 years ago

The problem can be solved on both ends. If we say that all indices should be of type int[] then yes, the problem is usdAbc not converting it. Or should UsdGeomPrimvar be more flexible and support unit[] for indices too?

spiffmon commented 5 years ago

Introducing more flexibility would be problematic for some of our internal constraints, and make importers more complex, so let’s go with the usdAbc fix, please?

On Fri, May 31, 2019 at 4:46 AM AlexSchwank notifications@github.com wrote:

The problem can be solved on both ends. If we say that all indices should be of type int[] then yes, the problem is usdAbc not converting it. Or should UsdGeomPrimvar be more flexible and support unit[] for indices too?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PixarAnimationStudios/USD/issues/859?email_source=notifications&email_token=ABPOU2AAFBAZ6UVRZJBU4C3PYEFXRA5CNFSM4HRF6XX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWU76YI#issuecomment-497680225, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPOU2F72C524KGSNTIXJODPYEFXRANCNFSM4HRF6XXQ .

-- --spiffiPhone

AlexSchwank commented 5 years ago

Sure, sounds good to me.

jilliene commented 5 years ago

Filed as internal issue #USD-5342