I am currently working with USD and have been using layer muting to temporarily ignore certain layers during a session. However, I have found that this state does not persist across different sessions of my application, and I would have to programmatically mute the layers again each time I start a new session.
I am wondering if there is an alternative method or approach in USD that achieves the same effect as muting a layer but can be persisted across sessions? Ideally, I am looking for a way to save the state of ignored layers so that when I restart my application, the specified layers are automatically ignored without having to programmatically set their state each time.
Any advice or suggestions on how to manage this kind of state across sessions in USD would be greatly appreciated!
Although it is still a âwet paintâ feature (user doc is IP), USD Variable Expressions provide a way to conditionally enable layers, and record the âactivation stateâ in the root layer of a scene (among other powerful capabilities).
However, there isnât yet any DCC support for working with this feature, but all the API is there for you to experiment with, in the dev-branch of the repository.
Iâll also mention that âmuted stateâ is an aspect of session state that DCCâs could support, if there is call for it. I believe some DCCâs already leverage UsdStage Load state/rules, which is also session state, so it would not be unprecedented. But it would not travel from app to app, which might be one of your goals?
Thanks Spiff,
I wanted to use muting as a means to revert back to a previous state, non-destructively. I now believe the correct approach would be to insert a stronger layer, and make the reversions in that layer.
Are there any convenience methods for applying the reversions, essentially muting a layer?
Hmmm⌠reversion really sounds more like either an undo/redo transaction, or asset/version management/check-pointing? We donât provide any API or tools for non-destructively undoing edits that have accrued in a particular layer(s). I think in full generality that might require some pretty drastic flattening to guarantee the same results in all cases.
My use case is a âdigital twinâ type scenario, where, for example, some damage is tracked in a separate layer, and then after the repair, the damage would be reverted, but I want to keep the history of the damage.
That honestly sounds like a perfect use case for conditional layer inclusion with variable expressions, because the variable names and values can clearly provide the semantics of the âstatesâ you are trackingâŚ
Hi,
is there a way to save layer muting into a .usd file?
(I am working in Houdini / Solaris in this case)
For example:
I have an asset component (a waving flag).
The asset consists of the typical layers:
asset.usd
payload.usd
geo.usd
mtl.usd
Plus an additional geo_anim.usd that overlays a looping flag animation over the geo.
The asset gets exported and referenced into the lighting stage.
Now I want to be able to disable or enable the animation overlay not only in the viewport (which is possible via Houdiniâs Scene Graph Layer Menu or Configure Stage LOP), but also translate this into the (Karma) render.
The Configure Stage LOPâs doc sound to me like this should translate into the output usd stage, and with that the rendering. But this isnât the case.
Sounds like itâs not possible yet by USD architecture?
Would this be possible once SideFX had implemented USD Variable Expressions?
I suppose handling this via an additional nested variant set like (variant set anim [static, animated]) is probably smarter? But still would be interested if this was possible.
There is a post in the SideFX Forum as well, but couldnât get this to work on a render level.
You could use a variantSet in the defaultPrim of the asset to choose between (static | animated) variants. Then the animated variant could overlay your geo_anim layer.
About using Variable Expressions.
Letâs say you include them in your asset to enable/disable the geo_anim layer.
You will find a problem when you reference the asset into a shot, for example.
You would need to add the Variable Expression to the shot stage for the asset to pick it up, as Variable Expression doesnât get composed.
At least that is my understanding of USD Variable Expressions, hope it helps
Hey, thanks for the reply.
Yeah probably itâs a bad example, as this would be best handled with a variant set in practice.
However my question is actually, how you can mute any stage layer not only in the viewport, but also for .usd and render output.
I would have expected the Configure Stage LOP in Houdini to support that, with itâs Mute Layer functionality.
However this only works for the stage in the viewport, not at stage export or render.
So USD Variable Expressions would allow that correct?
Hi @adrianmeyerart , you could follow up with SideFX to see if they plan to support muting as a persistent operation in the context of Solaris⌠though because USD itself does not support it, it would be non-portable. While we are open to being persuaded otherwise, we see muting as a session-based, more limited functionality, whereas expression variables provide alot more power (including the ability to drive variant selections). Eventually I would imagine rendering tools (including usdrecord) to support command-line options that either allow you to directly specify expression variable overrides or (like usdview) specify a session layer for the stage that contains overrides. It may take a beat or two for that to happen, though.
Hi @spiff,
thanks a lot!
Okay I understand. If layer muting was only intended to be session based, I have full trust in smart brains like yours that this has itâs valid reasons (-;
Will have a closer look into Expression Variables then.