BigRoy / usd-qtpy

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

Enhancement: Add Variant Set management #32

Closed BigRoy closed 7 months ago

BigRoy commented 7 months ago

Feature

This PR also fixes some minor issues with the Prim Spec Editor:

Screenshots

variant_sets_editor

BigRoy commented 7 months ago

So this PR is in quite a usable state - even allows to now manage and edit variants in Maya too, including allowing creating edits in variants via the Maya UI. Pretty nice.

The Variant Sets edit widget UX can be improved - it's not pretty, but - it does work which would make it ok for a first version. We can iterate as we get some more testers.

There's however a bit off an odd issue with the renaming we're doing in the Hierarchy editor. USD doesn't seem to like editing the names of PrimSpecs inside a variant - it'll basically crash it. More details here: https://forum.aousd.org/t/perform-namespace-edit-inside-a-variant-set-edit-target/1006/3

It seems Prism Editor can rename the prim inside the variant without a crash but as you rename it the prim disappears from the editor which funnily enough would be exactly what would avoid the crash since you wouldn't be accessing the invalid address. Maybe @RichardFrangenberg can shed some more light on how he's renaming the prims there - it could be that in the code snippet as I set up in the link I'm just doing something particular that makes it crash.

BigRoy commented 7 months ago

Since we are in early alpha versioning and this exposes decent prototype functionality I'll merge this with the known caveat that it may crash on certain edge cases with USD when e.g. renaming prims inside a variant. The issue isn't "new" to this PR but is just likelier to happen because this PR exposes Variant Editing. Nonetheless, without this PR the edit target could've still been set through the API, etc.

Here's a Pixar USD issue to track the crash.