HOUDINI USD - publishing looks using referenced materials from external usd files

In our studio i have been working on a master material with promoted parameters and organised UI, so that we can take advantage of the houdini edit_material_properties LOP, which allow you to do several things:

  • edit the material parameters affecting all the geometries using it.

  • edit the material only on geometries affected by the node without reassigning a material copy (very convenient).

  • reference the parent material to create a new child material (needs to be reassigned)

  • make a new material that inherits from the parent material (needs to be reassigned)

  • specialize material to create a copy in the scene that is not referenced (needs to be reassigned)

Our shading network is quite complex with hundreds of parameters so we are precooking it into a USD file on disk and reloading it in the scene with a Reference LOP. This way we have a quick response in the scene when using the Edit_material_properties LOPs.

We also want to keep the master material outside of the asset material group so that when a look is published, it contains only the materials created for it.

But when I tried to publish a look in AYON, i encountered some issues.

  • empty texture paths in the material parameters caused errors (even when the parameters were not overridden or edited, just present in the parameter UI.

  • the validator complained about using references. Specifically from the Edit_material_properties LOP referencing the material that was imported as a USD file.

So this prevents us to use the edit and reference modes of the node, which removes the ability to override material settings on a geometry without duplicating and reassigning a material.

We put placeholders in the texture paths as a temp fix and we tried the other modes, ‘Inherit’ and ‘Specialize’ (these need for the material to be reassigned) just so we could get the publish through without errors.

But when we load the published look, it has no materials in it. Looks unshaded.

We are trying to understand how we can make this system work with AYON, without losing the conveniences of the Edit_material_properties LOPs and without copying the master shader in every single look. Using the live shading network in the scene is not doable.

1 Like

Look product in Houdini was built around standard use case where you have

  • Material assignment
  • Material Prims
  • Textures which will be copied as resources and the paths in the published look layer are updated to point to the copied textures.

From your post, I can see you are adopting a bit different approach where you are creating a material template with empty texture paths and without assignments. which seems to be something separate from the current look product.

Does using the generic USD type make more sense?

I was actually able to use this setup by keeping the USD file as a reference or sublayer ( before the layerbreak) and publish as a usd asset look product, as long as i keep the empty texture paths parameter overrides as set to ‘do nothing’ and reload the usd material library in the same primitive location in the render scene later. So I wonder if the validator script can be modified to let empty texture paths go through and just do the texture packaging of the paths that work. Or at least warn the user during the publish and run a cleanup script that sets them to ‘do nothing’.

The first time we reference the material from the library with a edit_material_properties LOP we have to assign it to the geo anyway, so there is indeed at least one material assignment LOP. I tried to publish it as a generic usd asset and reload it as a sublayer and that works! Although the master blacnk material used to create the asset look must be included in the publish. it has to be either as a reference or sublayer after the layerBreak LOP otherwise it is not included. Which is annoying as i would rather not have the use touch it or include it in the release. If it is loaded before the layer break, of cousre the look will appear blank when assigned to the asset as a sublayer later. However if the master material reference is reloaded in the rendering scene in the same exact location, the look starts working again. So including the material library master shader as a reference in all rendering scene templates could be a solution.
This way though we cannot take advantage of the texture packaging and the release being conveniently tagged as a look.
Is the look product something houdini specific or an AYON convention that can be modified to accomodate for this kind of use?

The look product was implement to fit the following requirement:

Well, it’s open source… Feel free to submit PRs.
https://github.com/ynput/ayon-houdini/pulls