Creating Shader Packages For Pipeline


#1

Hello all,

I’m writing a small pipeline for a project and we need a way to export a “Lookfile”/Shader Package from the lookdev scene and bring that data into the lighting scene.
We ran some tests and were able to export a JSON dictionary of all the shaders in the lookdev scene and the geometry that is to be assigned to them.
It worked fine but the problem is we have namespace when we reference the alembic caches, it’s also possible that we have objects with the same name in the scene so it’s not preferable to use the geo name route.
I ran another test using UUIDs, problem with that is the alembic caches get a new UUID once they are exported as alembic. To combat this, I made a new attribute on the alembic geo that contains the original geo’s uuid. This also works fine but it requires us to crawl through every object in the scene to find which geometry has that attribute value, since we can’t use ‘ls(uuid)’.

So my question is, what is the best way to approach shader packaging/and reassignment on assets? Has anyone ever seen a functioning maya pipeline and how they handle this?


#2

Hi,

Interesting question and a good problem to tackle.

We have been doing this for quite some years now and it has been very effective for us. However, we do not use Maya’s node UUIDs but store our own custom unique ID on the shapes as we generate them. So that effectively, throughout the pipeline and caches you can always identify to which asset the mesh belongs. And with that, you also know which shader to apply that was stored in a JSON dictionary.

Additionally we support shader variations, e.g. collecting the shader assignments from a specific renderlayer in the Look work file to allow the user to build different shader variations in a single scene, like lookDefault, lookDecay, etc.

This exact implementation is open-source available and can actually completely be adopted by using the Avalon pipeline. The shader assignment is implemented in many of the studio configurations for it that are out there but had its origins in our own, the Colorbleed config for Avalon.

If you’re solely looking for the implementation here are some important parts of it (note that it points to the acre branch as that is currently our internal master at Colorbleed):

If you’re interested in Avalon however, I’d recommend reading the documentation and join the Avalon gitter if you still have any questions on getting started.

Also note that USD might very likely soon allow to solve this in new and better ways - but since maya-usd is still under heavy development you’ll need to wait slightly more for that workflow to become production-proven.