ynput / ayon-houdini

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

Add Load Shot LOP and Mute Layers LOP #56

Closed BigRoy closed 4 months ago

BigRoy commented 4 months ago

Changelog Description

This adds two new HDAs/OTLs for Houdini for the USD workflow:

Additional info

The Load Shot LOP makes it easy to load e.g. the current shot: image

The Mute Layers LOP has some 'easy access' presets you can apply to mute specific layers: image

Testing notes:

  1. Load Shot LOP and Mute Layers LOP should work and be understandable to use.
  2. Both should provide a simple yet understandable "HELP" (question mark on the node)
BigRoy commented 4 months ago

The layer muting is unfortunately based on wildcards to filename patterns. This means that also the "example defaults" are somewhat based on:

We may want to:

BigRoy commented 4 months ago

Could we add the ayon icon in the AYON Mute Layers , the help section can't find it. image

It should exist there. It also didn't work for me for the Load Asset LOP so I'm unsure what's wrong in this case since I assumed something on my end was just buggy and it'd never display.

It's as if on my end it never refreshes the HELP docs :)

Does https://github.com/ynput/ayon-houdini/pull/56/commits/ad6fe6491431b665b1088fe275d1abaa8dc28100 fix it for you @MustafaJafar ?

MustafaJafar commented 4 months ago

I think I've hit the issue mentioned in this comment https://github.com/ynput/ayon-houdini/pull/56#issuecomment-2257101711 I ended up checking my layer stack and picking names.

Since, the variant sets (department names) are hardcoded/specified in settings, Are we able to get the reference path of the current variant ? I think it won't care about how I named my files.

image

BigRoy commented 4 months ago

Since, the variant sets (department names) are hardcoded/specified in settings, Are we able to get the reference path of the current variant ? I think it won't care about how I named my files.

I'm not sure why/when you'd actually want to mute a specific variant's layer but that may be me missing the point. Usually it's way higher level just muting a specific full department layer - but maybe on your end you somehow have messed up not working department layers at all.

You seem to also be Loading Shot what is essentially an Asset Structure - so you should be loading an asset (reference) so that you can load into the scene structure the way you like instead of layering in the exact hierarchy of the asset file without control over where to put it into the scene.

MustafaJafar commented 4 months ago

I'm not sure why/when you'd actually want to mute a specific variant's layer but that may be me missing the point. Usually it's way higher level just muting a specific full department layer - but maybe on your end you somehow have messed up not working department layers at all.

In my example I had one USD layer for each USD department layer, for each variant in my department layer to be specific. Therefore, muting the whole department layer is the same as muting one layer. So, yeah, maybe I messed up.

Here's how the modeling department layer looks like on my side:

#usda 1.0
# robo_moco_usdMocoAsset_model_v015.usd
(
    defaultPrim = "moco"
    metersPerUnit = 1
    upAxis = "Y"
)

def Xform "moco" (
    variants = {
        string model = "MocoGeo"
    }
    prepend variantSets = "model"
)
{
    variantSet "model" = {
        "MocoGeo" (
            prepend references = [
                @\\storage\work\ayon_projects\Robo\Assets\Character\moco\publish\usd\usdMocoGeo\v004\robo_moco_usdMocoGeo_v004.usd@ (
                    customData = {
                        int ayon_order = 100
                        string ayon_uri = "ayon://Robo//Assets/Character/moco?product=usdMocoGeo&version=4&representation=usd"
                    }
                )
            ]
        ) {

        }
        "MocoGeo2" (
            prepend references = [
                @\\storage\work\ayon_projects\Robo\Assets\Character\moco\publish\usd\usdMocoGeo\v006\robo_moco_usdMocoGeo_v006.usd@ (
                    customData = {
                        int ayon_order = 100
                        string ayon_uri = "ayon://Robo//Assets/Character/moco?product=usdMocoGeo&version=6&representation=usd"
                    }
                )
            ]
        ) {

        }
    }
}

You seem to also be Loading Shot what is essentially an Asset Structure - so you should be loading an asset (reference) so that you can load into the scene structure the way you like instead of layering in the exact hierarchy of the asset file without control over where to put it into the scene.

Yeah, I'm exposed, that scene was some test scene that I published as asset and as shot to test the publish plugins. I should have better examples 😁

BigRoy commented 4 months ago

@MustafaJafar with you exposed does that mean this PR still has fixes to do? or is it actually ready for approval?

Layer muting in USD works off of filepaths (or actually layer.identifier I believe; which is usually the filepath or the AYON URI!? But we'll have to see that when that workflow is implemented; would just mean exposing other useful 'defaults' by then).

We can improve over time of course when issues arise.