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

UsdCollectionAPI explicitOnly includeRoot rendering error #2258

Closed
miguelh-nvidia opened this issue Feb 8, 2023 · 3 comments
Closed

UsdCollectionAPI explicitOnly includeRoot rendering error #2258

miguelh-nvidia opened this issue Feb 8, 2023 · 3 comments

Comments

@miguelh-nvidia
Copy link

UsdCollectionAPI explicitOnly includeRoot logs error

Hi!,
We run into an unexpected warning, I can easily reproduce doing the following in Interpreter in usdview.

UsdLux.SphereLight.Define(usdviewApi.stage, "/hello/light")
light = usdviewApi.stage.GetPrimAtPath("/hello/light")
collection = Usd.CollectionAPI.Get(light, "lightLink")
collection.GetExpansionRuleAttr().Set(Usd.Tokens.explicitOnly)

Will produce:

ERROR: Usdview encountered an error while rendering.
        Error in 'pxrInternal_v0_20__pxrReserved__::`anonymous-namespace'::_ComputeIncludedImpl' at line 142 in file C:\sources\usd-build\USD\pxr\usd\usd\collectionMembershipQuery.cpp : 'Unknown path type in membership-map.'
        Error in 'pxrInternal_v0_20__pxrReserved__::`anonymous-namespace'::_ComputeIncludedImpl' at line 142 in file C:\sources\usd-build\USD\pxr\usd\usd\collectionMembershipQuery.cpp : 'Unknown path type in membership-map.'
        Error in 'pxrInternal_v0_20__pxrReserved__::`anonymous-namespace'::_ComputeIncludedImpl' at line 142 in file C:\sources\usd-build\USD\pxr\usd\usd\collectionMembershipQuery.cpp : 'Unknown path type in membership-map.'

What seems to happen is when creating this light (or any collection), includeRoot will be True, and expansionRule will be expandPrims. If we change expansionRule to explicitOnly (while keeping includeRoot, True), it throws that message.

Looking at the code here: https://github.com/PixarAnimationStudios/USD/blob/release/pxr/usd/usd/collectionMembershipQuery.cpp#L110, there seems to be missing a case for when IsAbsoluteRootPath is true. Is that the case? or am I missing something else?

Further discussion: https://groups.google.com/g/usd-interest/c/nNppu_TcT6c

Steps to Reproduce

  1. Open usdview
  2. Make sure the Demo is there (i.e. blue ball)
  3. Open script editor, copy paste this:
UsdLux.SphereLight.Define(usdviewApi.stage, "/hello/light")
light = usdviewApi.stage.GetPrimAtPath("/hello/light")
collection = Usd.CollectionAPI.Get(light, "lightLink")
collection.GetExpansionRuleAttr().Set(Usd.Tokens.explicitOnly)
  1. Console errors will appear:
ERROR: Usdview encountered an error while rendering.
        Error in 'pxrInternal_v0_20__pxrReserved__::`anonymous-namespace'::_ComputeIncludedImpl' at line 142 in file C:\sources\usd-build\USD\pxr\usd\usd\collectionMembershipQuery.cpp : 'Unknown path type in membership-map.'
        Error in 'pxrInternal_v0_20__pxrReserved__::`anonymous-namespace'::_ComputeIncludedImpl' at line 142 in file C:\sources\usd-build\USD\pxr\usd\usd\collectionMembershipQuery.cpp : 'Unknown path type in membership-map.'
        Error in 'pxrInternal_v0_20__pxrReserved__::`anonymous-namespace'::_ComputeIncludedImpl' at line 142 in file C:\sources\usd-build\USD\pxr\usd\usd\collectionMembershipQuery.cpp : 'Unknown path type in membership-map.'

System Information (OS, Hardware)

  • Windows x86, Linux x86 (Ubuntu)

Package Versions

Build Flags

  • NA
@miguelh-nvidia miguelh-nvidia changed the title UsdCollectionAPI explicitOnly includeRoot logs error UsdCollectionAPI explicitOnly includeRoot renderingerror Feb 8, 2023
@miguelh-nvidia miguelh-nvidia changed the title UsdCollectionAPI explicitOnly includeRoot renderingerror UsdCollectionAPI explicitOnly includeRoot rendering error Feb 8, 2023
@tallytalwar
Copy link
Contributor

Filed as internal issue #USD-7992

@blevin
Copy link
Member

blevin commented Mar 4, 2023

Hi Miguel. Your steps mention "Make sure the Demo is there (i.e. blue ball)" -- do you have a particular USD file meant to be used here? Thanks.

@blevin
Copy link
Member

blevin commented Mar 4, 2023

Here is a repro that does not require a starting USD file or usdview:

from pixar import Usd, UsdLux
stage = Usd.Stage.CreateInMemory()
UsdLux.SphereLight.Define(stage, "/hello/light")
light = stage.GetPrimAtPath("/hello/light")
collection = Usd.CollectionAPI.Get(light, "lightLink")
collection.GetExpansionRuleAttr().Set(Usd.Tokens.explicitOnly)
query = collection.ComputeMembershipQuery()
paths = Usd.ComputeIncludedPathsFromCollection(query, stage)
print(paths)

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