From 640b68b89c49b15027c3d12f28109551aafc9561 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 29 Oct 2021 18:30:57 +0200 Subject: [PATCH] initial commit of new tool --- openpype/tools/context_dialog/__init__.py | 10 +++++++++ openpype/tools/context_dialog/window.py | 26 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 openpype/tools/context_dialog/__init__.py create mode 100644 openpype/tools/context_dialog/window.py diff --git a/openpype/tools/context_dialog/__init__.py b/openpype/tools/context_dialog/__init__.py new file mode 100644 index 0000000000..9b10baf903 --- /dev/null +++ b/openpype/tools/context_dialog/__init__.py @@ -0,0 +1,10 @@ +from .window import ( + ContextDialog, + main +) + + +__all__ = ( + "ContextDialog", + "main" +) diff --git a/openpype/tools/context_dialog/window.py b/openpype/tools/context_dialog/window.py new file mode 100644 index 0000000000..492384ee42 --- /dev/null +++ b/openpype/tools/context_dialog/window.py @@ -0,0 +1,26 @@ +from Qt import QtWidgets, QtCore, QtGui + + +class ContextDialog(QtWidgets.QDialog): + """Dialog to select a context. + + Context has 3 parts: + - Project + - Aseet + - Task + + It is possible to predefine project and asset. In that case their widgets + will have passed preselected values and will be disabled. + """ + + +def main( + path_to_store, + project_name=None, + asset_name=None, + strict=True +): + app = QtWidgets.QApplication([]) + window = ContextDialog() + window.show() + app.exec_()