BigRoy / usd-qtpy

Python Qt components for building custom USD tools.
MIT License
57 stars 8 forks source link

Implement simple USD check visualizer tool for artists #42

Open BigRoy opened 7 months ago

BigRoy commented 7 months ago

It can be tricky for artists to identify and really understand what types of data a layer or stage has opinions on.

An artist might prefer to just select a USD file (or a layer in it) and see e.g.:

### Layer X

Variants
- [ ] Defines variants

Geometry
- [ ] Defines Mesh
- [ ] Defines Mesh UVs
- [x] Defines Mesh point positions

Materials
- [ ] Defines Materials
- [ ] Defines Material Assignments

References
- [ ] Defines payloads
- [ ] Defines references

The exact content is to be defined - but I often see questions come up like:

Where debugging usually comes down to: "What opinions is the layer adding?"

Originally thought of due to questions popping up on Prism pipeline discord, e.g. here.


Proposal

I'm thinking of doing a simple Plugin system where checks could be easily added. Some simple pseudocode

class Check(usd_qtpy.plugins.LayerCheck):
    label = "Has render prim"
    group = "render"  # putting it within a certain grouping in the list?

    def process(self, layer):
        if layer.GetPrimAtPath("/render"):
            self.set_checked(True)

Then each of those bullet points could be just a simple "check". It's quite similar to e.g. Pyblish plug-in structure where we just 'collect' some data to make a list of generated results.

As such, we could mimic a lot of Pyblish. Like e.g. also allowing a single plug-in to register multiple entries in the checks list, e.g. self.add_result(label="Has render prim", checked=True)


This technically could also be debugged with a "Composition" or "Layer Stack" like USD View offers, some docs of Omniverse here show similar to USD View.

However, that often is still too hard to grasp for an artist as to what's really going on per layer - but also, they need to actively identify the right Prim and property to see the relevant composition. Good for detailed technical debugging, not for a simple "does this layer override geometry" or "does this layer write opinions on the geometry's shader assignments".