BigRoy / usd-qtpy

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

Add Selection & Selection syncing between widgets #25

Open BigRoy opened 7 months ago

BigRoy commented 7 months ago

Issue

  1. The USD Viewer does not show any selection highlighting when clicking in it
  2. There's no way to sync the Prim selections between different widgets

Proposal

Viewer selections

The USD View API already has a data model that can emit signals for prim selections and opinion selections - we might be best off hooking into those since they are readily available and we can piggyback off of work done by USD core team already.

For example have a look at what USD View's app controller does here for viewport selections.

Sync selections

Expose a Selection Model that we can provide as the "active" selection model for that widget - potentially allowing for also "pinning" a widget to a particular selection stream. So that one could say "sync these two models as A" and "sync these other two as B" so that you can view selections independently.

These 'streams' could then be global selection streams each widget can listen in to.

BigRoy commented 7 months ago

Adding selections to the view would also allow to resolve:

  • being able to focus the FreeCamera from UsdViewq on a selected object