I'm looking to get the LopNode.stage() with specific context options, but I can't find a LopNode.stage(context_options=my_options) argument or LopNode.cook(context_options) and then LopNode.stage().
I have a bunch of USD Render ROP nodes in /out where each ROP specifies its own context options overrides. Now, I want to validate some things in the USD stage at the LOP path the USD Render ROP would be evaluating. Preferably I'd be able to do something along the lines of:
1. If there's function somewhere that could act as the get_context_options from the ROP node that'd be nice. I checked some loputils and loptoolutils but couldn't find any. 2. And of course some good way to get the stage of the LopNode with those context options from the ROP node.
For now I ended up computing the context options from the ROP myself and and writing a context options context manager to apply them temporarily. The code is here [github.com].
No, there is no way to do this in python right now. I think the right solution would be to add an optional "context_options_override" parameter to the hou.LopNode.stage() method (which is the function that you would generally use to cook a LOP node and access the resulting stage). Feel free to RFE this.