BigRoy / usd-qtpy

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

Add Variants management: editing, adding, setting default variant per layer #24

Closed BigRoy closed 7 months ago

BigRoy commented 7 months ago

Issue

With #21 we now can add variant sets but can not:

Proposal

We should expose a UI that allows adding variants for each variant set, and via a bullet point select which one is the active (in the current edit target).

Additionally we will want to make edits within a specific variant as well, like e.g. adding a reference to a prim inside that particular variant. As far as I know this usually needs to be done by running edit commands within a variant_set.GetVariantEditContext() context. Since we allow the user to edit anything in general it might be non-trivial to get edits to be put inside that variant set.

However, I believe we should also be able to set the current edit target to the variant without a context block, using variant_set.GetVariantEditTarget and then setting the stage.SetEditTarget(edit_target)

edit_target = variant_set.GetVariantEditTarget()
stage.SetEditTarget(edit_target)

This will set the edit target to be that variant for the current edit target layer being edited. 👍