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

Payload not loaded when parent prim is activated #604

Closed
mgland opened this issue Aug 26, 2018 · 2 comments
Closed

Payload not loaded when parent prim is activated #604

mgland opened this issue Aug 26, 2018 · 2 comments

Comments

@mgland
Copy link

mgland commented Aug 26, 2018

Description of Issue

Hi there,
When a deactivated prim-A got a payload, whose child prim B also got one, then activating the prim-A won't load the child B's payload, despite the fact that the stage is loaded with LoadAll flag.
The payload of prim-A is loaded through.

This will cause the fact that when LayerDidChange event is emitted, the payload of child prim B is not loaded yet, thus the data will be missed during the event handling.

I saw a related issue: #156
Cheers,
Miguel Gao

Steps to Reproduce

  1. Create a usda file called bootstrap.usda:
#usda 1.0
(
    defaultPrim = "shot"
)

def Xform "shot" (
)
{
    def Xform "camera" (
    )
    {
        def Xform "cache"(
            active = false
            payload = @cache_payload.usda@
        ){
            def "cam"(
                payload = @camera_cache.usda@
            ){
            }
        }
    }
}
  1. Create a file called cache_payload.usda:
#usda 1.0
(
    defaultPrim = "cam_extra"
)

def "cam_extra" (
)
{
    // Some heavy data goes here...
    def "cache_payload"(){}
}
  1. Create a file called camera_cache.usda:
#usda 1.0
(
    defaultPrim = "cam"
)

def Xform "cam" (
)
{
    // Some heavy data goes here...
    def "cam_payload"(){}
}
  1. Put all three files within same folder, run python code to test:
from pxr import Usd
stage = Usd.Stage.Open('/path/to/bootstrap.usda', Usd.Stage.LoadAll)
stage.SetEditTarget(stage.GetSessionLayer())
cachePrim = stage.GetPrimAtPath('/shot/camera/cache')
cachePrim.SetActive(True)
cachePayloadPrim = stage.GetPrimAtPath('/shot/camera/cache/cache_payload')
print 'The payload for cache is loaded: %s' % cachePayloadPrim.IsValid()
cameraPayloadPrim = stage.GetPrimAtPath('/shot/camera/cache/cam/cam_payload')
print 'The payload for cam is loaded: %s' % cameraPayloadPrim.IsValid()  # This is the problem
cachePrim.Load()
cameraPayloadPrim = stage.GetPrimAtPath('/shot/camera/cache/cam/cam_payload')
print 'The payload for cam is loaded after manually calling Load(): %s' % cameraPayloadPrim.IsValid()

System Information (OS, Hardware)

Linux, CentOS 7

Package Versions

0.8.5

Build Flags

@spiffmon
Copy link
Member

spiffmon commented Aug 28, 2018 via email

@jtran56
Copy link

jtran56 commented Aug 29, 2018

Filed as internal issue #USD-4712.

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

4 participants