Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:syoyo/tinyusdz into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
syoyo committed Sep 20, 2023
2 parents 692d620 + 743e6e8 commit a86d348
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions sandbox/tusdview/tusdview.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
#
# error happens in WSL2 environment

from PySide6.QtWidgets import QApplication, QWidget, QLabel
from PySide6.QtGui import QImage, QPixmap
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QLabel, QFileDialog
from PySide6.QtGui import QAction, QImage, QPixmap

#import cv2
import numpy as np


class MainWindow(QWidget):
class MainWindow(QMainWindow):

def __init__(self, parent=None):
def __init__(self, parent=None):
super().__init__(parent)

self.setup()

def setup(self):
def setup(self):

self.width = 512
self.height = 512
Expand All @@ -43,13 +43,38 @@ def setup(self):
imgLabel = QLabel(self)
imgLabel.setPixmap(pixmap)

self.resize(imgLabel.pixmap().size())
self.setWindowTitle("TinyUSDZ viewer")
#self.resize(imgLabel.pixmap().size())

open_file = QAction("Open(&O)", self)
open_file.setShortcut("Ctrl+O")
open_file.triggered.connect(self.openFile)

quit_app = QAction("Quit(&Q)", self)
quit_app.setShortcut("Ctrl+Q")
quit_app.triggered.connect(self.quitApp)

menu = self.menuBar()
file_menu = menu.addMenu("File")
file_menu.addAction(open_file)
file_menu.addAction(quit_app)


self.setWindowTitle("TinyUSDZ viewer")

def openFile(self):
filters = "USD files(*.usd *.usdc *.usda *.usdz);;Any files (*)"
filename = QFileDialog.getOpenFileName(filter=filters)
print(filename)

def quitApp(self):
import sys
sys.exit()

if __name__ == '__main__':
app = QApplication([])
window = MainWindow()
window.show()
app.exec()



0 comments on commit a86d348

Please sign in to comment.