This object is used to define a with
block in Python, which guarantees a
well defined lifetime. Inside this block, this object provides access to an
editable USD layer. When the block ends and this object is destroyed, the
changes made to the USD layer are saved to the LOP Network, and any viewers
pointed at nodes inside that LOP Network will be updated appropriately.
This object is returned by a call to hou.LopNetwork.editablePostLayer.
A post-layer is a concept within Solaris which allows USD layers to be added
to the session layer of every LOP node’s composed stage. These layers live
outside the LOP node cook process, and so their content does not affect the
operation of any LOP nodes. For example, primitives defined in a post-layer
cannot be seen by any LOP nodes. But any request to access the stage of a LOP
node will contain the content of these post-layers unless you specifically
request that post-layers be excluded (using the apply_post_layers
parameter
in hou.LopNode.stage or turning off post layers in the Scene Viewer).
Disabling post-layers should generally only be required when debugging the
post-layer content.
Because these are session layers, their opinions are stronger than any opinions authored by LOP nodes (which author opinions on the stage’s root layer). Unlike Viewport Overrides, the content of these layers is also saved by the USD and USD Render ROPs, and so will affect final renders.
Use cases for post-layers include the creation of standard primitives (like Render Settings) which should be available anywhere in the LOP Network. Another use case would be to apply a final pass to the scene graph data, such as disabling all materials for quick render tests. But since post-layers can only be authored by python code, integrating them into an artist’s workflow will always require some custom user interface, though that interface may be as simple as providing checkboxes to turn certain post-layers on or off.
Methods ¶
layer()
→ pxr.Sdf.Layer
Returns a pxr.Sdf.Layer
object that can be modified with pxr.Sdf
methods. For maximum editing performance, create a pxr.Sdf.ChangeBlock
object around any modifications to this layer. This will delay
recomposition until the change block is deleted.
stage()
→ pxr.Usd.Stage
Return a pxr.Usd.Stage
object that can be modified with pxr.Usd
methods. The edit target for this stage will already point to the
requested post-layer (also accessible through the layer()
method on
this object). The edit target should not be changed, and other layers on
the stage should not be modified.