ynput / ayon-houdini

Houdini addon for AYON
Apache License 2.0
11 stars 9 forks source link

Support Houdini context options from the ROP node for the USD collectors + validations #145

Closed BigRoy closed 1 month ago

BigRoy commented 1 month ago

Changelog Description

Support Houdini context options from the ROP node for the USD collectors + validations

Additional info

With this change you can create a Solaris stage in LOPs that is dependent on context options, e.g. for multi-shot lighting workflows and publishing each of them will now correctly retrieve the expected render products for e.g. USD rendering for that Solaris context and/or whatever is different in the LOPs graph for that particular context.

This also changes the behavior that each validator recollects the stage and layers each time from the LOP. Instead, we query them once, keep in memory and re-use them in validators down the line. Whether this will be entirely correct, safe to do and remain without crashes we'll have to investigate in some good testing of publishing some decently complex graphs of models, looks and render scenes. A bigger test render scene with multi-shot workflow that I had seemed to run fine.

How to best keep the unique cloned layers in memory I wasn't sure about and took me a while to figure out something that didn't crash Houdini or was immensely slow. This now seems to behave consistent - but I have an open USD Alliance forum post here hoping to get even better approaches.

Testing notes:

  1. Set up a scene with context options
  2. On the USD ROP set the "Context Options" you want for a particular publish instance.
  3. Publish both at the same time.
  4. It should've correctly applied the validations and the publish.

Note: The generated USD product being correct isn't much up to us - that's still a regular Houdini ROP render so we would mostly be validating whether our collectors and validators are correctly picking up the context options. Like e.g. having different render product output paths per context, or different textures loaded per context (and have those correctly be published along with a look).

MustafaJafar commented 1 month ago

I'm not sure if I'm testing it correctly. I made this simple scene with some context vars used in my stage as well as my Rop to publish something to my shot_01 and shot_02.

The Rop works perfectly but the stage doesn't. RB_shot_01_fx_v001.zip

image

BigRoy commented 1 month ago

I'm not sure if I'm testing it correctly. I made this simple scene with some context vars used in my stage as well as my Rop to publish something to my shot_01 and shot_02.

Did you specify the context options on the ROP to override it?

For example:

image

That way you can have two ROPs pointing to the same graph but outputting something else. The usdTest ROP you have there doesn't seem to specify them on the ROP?

Here is a stupidly simple example that just changes the name of a cube prim based on the context options: simple_usd_rop_context_options.zip


So in this particular case.

  1. You still need a ROP per context options.
  2. We're not enforcing the actual AYON context options into it by default. I'd want to avoid doing that but instead rely completely on what Houdini does with its context options per ROP. Otherwise we're again taking control and making it so that clicking render on the ROP behaves different than what the publisher does.
  3. You can't use the context options as attributes on the ROP node itself for the collector to pick up - you can use them only in the LOPs network you're building.

In short, currently you'd still need a ROP per context you want to export.