PathResolverContext().Get() is empty

Hey

we are trying to make out resolver working in Nuke (14.1). when trying to get the resolver from the stage via:
stage=geo_python.stage()
contexts=stage.GetPathResolverContext().Get()

We get an empty list.

In the same application opening a new stage via:
pinning_stage = Usd.Stage.Open(pinning_file) print(pinning_stage.GetPathResolverContext().Get())

returns us:
[CustomResolverCustomResolverContext([‘/searchpath’])]

What can be the reaseon that the Resolver Context attribute of a stage has an empty list?
stage.GetPathResolverContext().Get()

Thanks for your help in advance.
Cheers
Jonas

First guess is that the way Nuke is constructing that geo_python stage is thwarting Stage::Open’s default strategy of calling the primary resolver’s GetDefaultContextForAsset() method that presumably your plugin is implementing. You can always pass a context to an Open() method, so if Nuke is creating an empty one, that could explain it?

1 Like

Nuke isn’t opening a stage with Stage.Open, it creates an empty stage using Stage.CreateInMemory, hence the empty asset resolver context. Later versions of Nuke have a mechanism to set the asset resolver context for the stage going down the graph, but not in Nuke 14, sadly.

Jerry

1 Like