Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Load Shot LOP and Mute Layers LOP #56

Merged
merged 20 commits into from
Jul 30, 2024

Conversation

BigRoy
Copy link
Contributor

@BigRoy BigRoy commented Jul 29, 2024

Changelog Description

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

  • Load Shot LOP: This is an equivalent to a Houdini "Sublayer" node but exposing the loader functionality in a similar manner as the Load Asset LOP.
  • Mute Layers LOP: This is a custom HDA that allows to mute layers by wildcard, which can make it easy to mute e.g. all layers with *modeling* in the name, to - in that way, hopefully make it trivial to mute the layers you don't want active in your current scene - e.g. the department layer you're currently working on.

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 BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Jul 29, 2024
@BigRoy BigRoy requested review from MustafaJafar and antirotor July 29, 2024 21:08
@BigRoy BigRoy self-assigned this Jul 29, 2024
@BigRoy
Copy link
Contributor Author

BigRoy commented Jul 29, 2024

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

  • Publish file templates (since it checks those files for the names)
  • Also, those examples may not be the actual 'custom' layers a studio might define in settings: ayon+settings://core/publish/CollectUSDLayerContributions/contribution_layers

We may want to:

  • somehow allow the defaults to be based on the defined layer names in settings
  • tweak the mute layer matching to be more reliable than solely using the filepath (yet at the same time for loaded nested filepaths that's about as much as we 'have' to be reliable on)
  • be able to mute the 'current department layer' of you current task automatically: this I'd like most! so that we can have just a "mute current task layer" on the Load Shot node directly. However the department layers aren't "linked" to a particular task name or task type by default. To be able to do that we would need to solve USD Contributions: Default "Add to department layer" to the task or task type ayon-core#803

Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update the node to match how lop import works

Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@BigRoy
Copy link
Contributor Author

BigRoy commented Jul 30, 2024

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 ad6fe64 fix it for you @MustafaJafar ?

@MustafaJafar
Copy link
Contributor

I think I've hit the issue mentioned in this comment #56 (comment)
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

Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ad6fe64 fix it for you @MustafaJafar ?

It needs two additional changes to work.
After applying the following changes, it works on my side.
image

Co-authored-by: Mustafa Taher <[email protected]>
@BigRoy
Copy link
Contributor Author

BigRoy commented Jul 30, 2024

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
Copy link
Contributor

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
Copy link
Contributor Author

BigRoy commented Jul 30, 2024

@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.

@MustafaJafar MustafaJafar self-requested a review July 30, 2024 13:29
Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Played with this PR and it is awesome 😉

@BigRoy BigRoy merged commit f44a054 into ynput:develop Jul 30, 2024
1 check passed
@BigRoy BigRoy deleted the enhancement/lop_load_shot branch July 30, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants