Metadata-Version: 2.1
Name: usd-qtpy
Version: 0.0.3
Summary: Python Qt components for building custom USD tools.
Author: BigRoy, Hannes
License: MIT License
        
        Copyright (c) 2023 Colorbleed B.V.
        
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/BigRoy/usd-qtpy
Project-URL: Documentation, https://github.com/BigRoy/usd-qtpy
Project-URL: Issues, https://github.com/BigRoy/usd-qtpy/issues
Keywords: usd,qt
Classifier: Programming Language :: Python :: 3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: qtpy
Provides-Extra: usd
Requires-Dist: usd-core; extra == "usd"
Provides-Extra: usdview
Requires-Dist: PyOpenGL; extra == "usdview"

# USD-QtPy ![PyPI - Version](https://img.shields.io/pypi/v/usd-qtpy)


Python Qt components for building custom USD tools.


#### How to use?

The Qt components can be embedded in your own Qt interfaces and usually have
a `stage` entrypoint that you should pass a `pxr.Usd.Stage` instance.

However, a simple example Editor UI is also available to run standalone.

![USD Editor](/assets/images/editor_screenshot.png "USD Editor")

If you have the `usd_qtpy` package you can for example run it like:

```
python -m usd_qtpy "/path/to/file.usd"
```

Want to try it within your running Python session it should be as trivial to
do: 

```python
from pxr import Usd
from qtpy import QtWidgets
from usd_qtpy.editor import EditorWindow

filepath = "/path/to/file.usd"
stage = Usd.Stage.Open(filepath)

app = QtWidgets.QApplication()
dialog = EditorWindow(stage=stage)
dialog.resize(600, 600)
dialog.show()
app.exec_()
```

Or if you have a running `QApplication` instance (e.g. when inside Maya):

```python
from pxr import Usd
from usd_qtpy.editor import EditorWindow

filepath = "/path/to/file.usd"
stage = Usd.Stage.Open(filepath)

dialog = EditorWindow(stage=stage)
dialog.resize(600, 600)
dialog.show()
```

#### Why not Luma Picture's `usd-qt`?

Unlike [Luma Pictures's  `usd-qt`](https://github.com/LumaPictures/usd-qt) this repository tries to be easily 
redistributable by avoiding the need for extra C++ dependencies and solely
use the USD Python API. This will keep the build matrix simpler but does mean
the repository is not - by design - built for highly optimized large scale 
applications. Nonetheless, the intent is still to be able to carry average VFX 
scenes for debugging.



## install 
### from pip
```
python -m pip install usd-qtpy
```
### from repo
```
python -m pip install git+https://github.com/BigRoy/usd-qtpy.git@main
```


## Dependencies

The Viewer utilities are basically using `usdviewq` which may or may not
be included in your build. This also requires `PyOpenGL`. However, the other
tools do not and are intended to rely solely on USD core and Qt itself.

- qtpy 
- usd-core (when not using your own usd builds, install with `[usd]`)
- PyOpenGL (needed for usd viewport, install with `[usdview]`; you will still need use a custom `usd` build yourself for `pxr.Usdviewq` dependency)
