├── .gitignore
├── .idea
├── auri.iml
├── misc.xml
├── modules.xml
├── vcs.xml
└── workspace.xml
├── LICENSE
├── README.md
├── __init__.py
├── app.py
├── auri_lib.py
├── controllers
├── __init__.py
├── common_controller.py
└── main_controller.py
├── docs
└── images
│ ├── auri_presentation.png
│ └── auri_stack_pres.png
├── models
├── __init__.py
├── main_model.py
└── project_model.py
├── resources
├── icons
│ ├── Arrow_Down.png
│ ├── Arrow_Up.png
│ ├── Delete.png
│ └── Duplicate.png
└── themes
│ └── houdini_base.qss
├── scripts
└── __init__.py
├── vendor
├── Qt.py
└── __init__.py
└── views
├── __init__.py
├── about_view.py
├── bootstrap_view.py
├── edit_script_view.py
├── main_view.py
├── menubar_view.py
├── message_box_view.py
├── script_module_view.py
└── script_selector_view.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | env/
12 | build/
13 | develop-eggs/
14 | dist/
15 | downloads/
16 | eggs/
17 | .eggs/
18 | lib/
19 | lib64/
20 | parts/
21 | sdist/
22 | var/
23 | wheels/
24 | *.egg-info/
25 | .installed.cfg
26 | *.egg
27 |
28 | # PyInstaller
29 | # Usually these files are written by a python script from a template
30 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
31 | *.manifest
32 | *.spec
33 |
34 | # Installer logs
35 | pip-log.txt
36 | pip-delete-this-directory.txt
37 |
38 | # Unit test / coverage reports
39 | htmlcov/
40 | .tox/
41 | .coverage
42 | .coverage.*
43 | .cache
44 | nosetests.xml
45 | coverage.xml
46 | *.cover
47 | .hypothesis/
48 |
49 | # Translations
50 | *.mo
51 | *.pot
52 |
53 | # Django stuff:
54 | *.log
55 | local_settings.py
56 |
57 | # Flask stuff:
58 | instance/
59 | .webassets-cache
60 |
61 | # Scrapy stuff:
62 | .scrapy
63 |
64 | # Sphinx documentation
65 | docs/_build/
66 |
67 | # PyBuilder
68 | target/
69 |
70 | # Jupyter Notebook
71 | .ipynb_checkpoints
72 |
73 | # pyenv
74 | .python-version
75 |
76 | # celery beat schedule file
77 | celerybeat-schedule
78 |
79 | # SageMath parsed files
80 | *.sage.py
81 |
82 | # dotenv
83 | .env
84 |
85 | # virtualenv
86 | .venv
87 | venv/
88 | ENV/
89 |
90 | # Spyder project settings
91 | .spyderproject
92 | .spyproject
93 |
94 | # Rope project settings
95 | .ropeproject
96 |
97 | # mkdocs documentation
98 | /site
99 |
100 | # mypy
101 | .mypy_cache/
102 |
103 | # scripts folder
104 | scripts/*
--------------------------------------------------------------------------------
/.idea/auri.iml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
92 |
99 |
121 |
123 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/__init__.py:
--------------------------------------------------------------------------------
1 | __version__ = "1.0.1"
2 |
--------------------------------------------------------------------------------
/app.py:
--------------------------------------------------------------------------------
1 | from auri.auri_lib import get_application, get_houdini_style
2 | from auri.views.bootstrap_view import BootstrapView
3 | from auri.vendor.Qt import QtWidgets, QtCore
4 | import sys
5 |
6 |
7 | def bootstrap_standalone():
8 | app = QtWidgets.QApplication(sys.argv)
9 | win = BootstrapView()
10 | win.setStyleSheet(get_houdini_style())
11 | app.exec_()
12 |
13 |
14 | def bootstrap_maya():
15 | from pymel import core as pmc
16 | # No statusbar because there is already one in maya (bottom left by default)
17 | win = BootstrapView(parent=pmc.toQtObject("MayaWindow"), statusbar=False)
18 |
19 |
20 | def bootstrap_houdini():
21 | import hou
22 | win = BootstrapView(parent=hou.ui.mainQtWindow())
23 | win.setStyleSheet(get_houdini_style())
24 |
25 |
26 | def bootstrap_modo():
27 | import modo
28 | win = BootstrapView()
29 |
30 |
31 | def bootstrap_nuke():
32 | win = BootstrapView(parent=QtWidgets.QApplication.activeWindow())
33 |
34 |
35 | def bootstrap():
36 | if get_application() == "standalone":
37 | bootstrap_standalone()
38 | elif get_application() == "maya":
39 | bootstrap_maya()
40 | elif get_application() == "houdini":
41 | bootstrap_houdini()
42 | elif get_application() == "modo":
43 | bootstrap_modo()
44 | elif get_application() == "nuke":
45 | bootstrap_nuke()
46 |
47 |
48 | if __name__ == "__main__":
49 | bootstrap_standalone()
50 |
--------------------------------------------------------------------------------
/auri_lib.py:
--------------------------------------------------------------------------------
1 | import abc
2 | import os
3 | import re
4 | from auri import __version__
5 | from auri.vendor.Qt import QtWidgets
6 |
7 |
8 | def get_application():
9 | try:
10 | import maya.OpenMayaUI as mui
11 | import maya.cmds as cmds
12 | import pymel.core as pymel
13 | host_application = "maya"
14 | except (ImportError, TypeError):
15 | try:
16 | import hou
17 | host_application = "houdini"
18 | except ImportError:
19 | try:
20 | import nuke
21 | import nukescripts
22 | host_application = "nuke"
23 | except ImportError:
24 | try:
25 | import MaxPlus
26 | host_application = "3dsmax"
27 | except ImportError:
28 | try:
29 | import modo
30 | host_application = "modo"
31 | except ImportError:
32 | host_application = "standalone"
33 | return host_application
34 |
35 |
36 | def get_auri_version():
37 | return __version__
38 |
39 |
40 | def get_scripts_directory():
41 | return os.path.join(os.path.dirname(os.path.realpath(__file__)), "scripts")
42 |
43 |
44 | def get_categories():
45 | categories = [cat for cat in os.listdir(get_scripts_directory()) if os.path.isdir(os.path.join(get_scripts_directory(), cat))]
46 | return categories
47 |
48 |
49 | def get_subcategories(category=None):
50 | if category is None:
51 | categories = get_categories()
52 | if len(categories) > 0:
53 | category = get_categories()[0]
54 | else:
55 | return []
56 | category = os.path.join(get_scripts_directory(), category)
57 | subcategories = [subcat for subcat in os.listdir(category) if subcat != ".git" and os.path.isdir(os.path.join(category, subcat))]
58 | return subcategories
59 |
60 |
61 | def get_scripts(category=None, subcategory=None):
62 | if category is None:
63 | return []
64 | if subcategory is None:
65 | return []
66 | scripts = next(os.walk(os.path.join(get_scripts_directory(), category, subcategory)))[2]
67 | excludes = r"(__init__.py)|(.*.pyc)"
68 | includes = r".*.py$"
69 | scripts = [s for s in scripts if re.match(includes, s) and not re.match(excludes, s)]
70 | return scripts
71 |
72 |
73 | def push_button(text, signal=None):
74 | assert isinstance(text, str)
75 | btn = QtWidgets.QPushButton(text)
76 | if signal is not None:
77 | btn.clicked.connect(signal)
78 | return btn
79 |
80 |
81 | def grpbox(title, lyt=None):
82 | if lyt is None:
83 | lyt = QtWidgets.QVBoxLayout()
84 | g = QtWidgets.QGroupBox(title=title)
85 | g.setLayout(lyt)
86 | return g
87 |
88 |
89 | def get_resources_path():
90 | return os.path.join(os.path.dirname(os.path.abspath(__file__)), "resources")
91 |
92 |
93 | def get_auri_icon(icon_name):
94 | return os.path.join(get_resources_path(), "icons", icon_name)
95 |
96 |
97 | def is_checked(chkbox_state):
98 | """
99 | Connect to a checkbox stateChanged
100 | Args:
101 | chkbox_state (int):
102 | """
103 | switch = {0: False, 2: True}
104 | return switch.get(chkbox_state)
105 |
106 |
107 | def get_houdini_style():
108 | with open(os.path.join(get_resources_path(), "themes", "houdini_base.qss"), "r") as houdini_style:
109 | style = houdini_style.read()
110 | return style
111 |
112 |
113 | class AuriScriptView(QtWidgets.QWidget):
114 | def __init__(self, *args, **kwargs):
115 | super(AuriScriptView, self).__init__(*args, **kwargs)
116 | self.ctrl = None
117 | self.model = None
118 | self.set_model()
119 | self.set_controller()
120 | self.setup_ui()
121 |
122 | @abc.abstractmethod
123 | def set_model(self):
124 | pass
125 |
126 | @abc.abstractmethod
127 | def set_controller(self):
128 | pass
129 |
130 | @abc.abstractmethod
131 | def setup_ui(self):
132 | pass
133 |
134 | @abc.abstractmethod
135 | def refresh_view(self):
136 | pass
137 |
138 | def refresh_fold(self):
139 | self.setVisible(not self.model.folded)
140 |
141 |
142 | class AuriScriptController:
143 | def __init__(self):
144 | pass
145 |
146 | @abc.abstractmethod
147 | def execute(self):
148 | pass
149 |
150 | @abc.abstractmethod
151 | def prebuild(self):
152 | pass
153 |
154 |
155 | class AuriScriptModel:
156 | def __init__(self):
157 | self.module_name = None
158 | self.folded = False
159 |
--------------------------------------------------------------------------------
/controllers/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/controllers/__init__.py
--------------------------------------------------------------------------------
/controllers/common_controller.py:
--------------------------------------------------------------------------------
1 | import json
2 | import os
3 |
4 | import re
5 |
6 | from auri.vendor.Qt import QtWidgets, QtCore
7 | from collections import OrderedDict
8 | from functools import partial
9 |
10 | from auri.auri_lib import get_categories, get_scripts, get_subcategories
11 | from auri.views.edit_script_view import EditScriptView
12 | from auri.views.main_view import MainView
13 | from auri.views.message_box_view import MessageBoxView
14 | from auri.views.script_module_view import ScriptModuleView
15 |
16 |
17 | class CommonController(object):
18 | def __init__(self, main_model, project_model, bootstrap_view):
19 | """
20 |
21 | Args:
22 | main_model (auri.models.main_model.MainModel):
23 | project_model (auri.models.project_model.ProjectModel):
24 | bootstrap_view (auri.views.bootstrap_view.BootstrapView):
25 | """
26 | self.dialog = QtWidgets.QFileDialog()
27 | self.dialog.setFilter(self.dialog.filter() | QtCore.QDir.Hidden)
28 | self.dialog.setDefaultSuffix("json")
29 | self.dialog.setNameFilters(["JSON (*.json)"])
30 |
31 | self.project_model = project_model
32 | self.main_model = main_model
33 | self.bootstrap_view = bootstrap_view
34 | self.main_view = None
35 | self.category_combobox = None
36 | self.subcategory_combobox = None
37 | self.script_selector = None
38 | self.edit_script_dialog = None
39 | self.message_box = None
40 | self.refresh()
41 |
42 | def add_script(self, category, subcategory, script, module_name, main_view, script_module_instance=None, model=None):
43 | if script_module_instance is not None:
44 | module_name = "{0}__DUPLICATE".format(module_name)
45 | if module_name in self.main_model.unique_names:
46 | self.message_box = MessageBoxView("Naming Error", "
A module named {0} already exists.\nYou should rename that module.
".format(module_name)) 47 | self.message_box.show() 48 | if script_module_instance is not None: 49 | script_view = ScriptModuleView(category, subcategory, script, module_name, self.main_model) 50 | main_view.scrollable_layout.insertWidget(script_module_instance.get_index() + 1, script_view) 51 | script_view.model.__dict__ = script_module_instance.model.__dict__.copy() 52 | script_view.model.module_name = module_name 53 | script_view.refresh_module_name() 54 | else: 55 | script_view = ScriptModuleView(category, subcategory, script, module_name, self.main_model) 56 | main_view.scrollable_layout.insertWidget(main_view.scrollable_layout.count() - 1, script_view) 57 | script_view.fold_btn.pressed.connect(partial(self.fold_script, script_view)) 58 | script_view.up_btn.pressed.connect(partial(self.move_script, script_view, 1)) 59 | script_view.down_btn.pressed.connect(partial(self.move_script, script_view, -1)) 60 | script_view.edit_btn.pressed.connect(partial(self.edit_script, script_view)) 61 | script_view.duplicate_btn.pressed.connect(partial(self.add_script, category, subcategory, script, module_name, main_view, script_view)) 62 | script_view.delete_btn.pressed.connect(partial(self.remove_script, script_view)) 63 | script_view.refresh_module_name() 64 | if model is not None: 65 | script_view.model.__dict__ = model 66 | script_view.the_view.refresh_fold() 67 | script_view.the_view.refresh_view() 68 | self.main_model.unique_names.append(module_name) 69 | 70 | def fold_script(self, script_view): 71 | """ 72 | 73 | Args: 74 | script_view (auri.views.script_module_view.ScriptModuleView): 75 | """ 76 | script_view.the_view.setVisible(script_view.model.folded) 77 | script_view.model.folded = not script_view.the_view.isVisible() 78 | 79 | def move_script(self, script_view, offset_position): 80 | """ 81 | 82 | Args: 83 | script_view (auri.views.script_module_view.ScriptModuleView): 84 | offset_position (int): 1 move one position up, -1 move one position down 85 | """ 86 | old_position = script_view.get_index() 87 | self.main_view.scrollable_layout.removeWidget(script_view) 88 | self.main_view.scrollable_layout.insertWidget(old_position - offset_position, script_view) 89 | 90 | def edit_script(self, script_view): 91 | """ 92 | 93 | Args: 94 | script_view (auri.views.script_module_view.ScriptModuleView): 95 | """ 96 | self.edit_script_dialog = EditScriptView(script_view, self.project_model, self.main_model) 97 | result = self.edit_script_dialog.exec_() 98 | if result == 1: 99 | self.refresh_project_model() 100 | 101 | def remove_script(self, script_view): 102 | """ 103 | 104 | Args: 105 | script_view (auri.views.script_module_view.ScriptModuleView): 106 | """ 107 | self.main_view.scrollable_layout.removeWidget(script_view) 108 | script_view.deleteLater() 109 | self.main_model.unique_names.remove(script_view.module_name) 110 | 111 | def set_window_title(self, title): 112 | self.bootstrap_view.setWindowTitle(title) 113 | 114 | def new_project(self): 115 | assert (isinstance(self.main_view, MainView)) 116 | while self.main_view.scrollable_layout.count(): 117 | child = self.main_view.scrollable_layout.takeAt(0) 118 | if child.widget(): 119 | child.widget().deleteLater() 120 | self.main_view.scrollable_layout.addStretch(1) 121 | self.main_model.current_project = None 122 | self.project_model.scripts_to_execute = [] 123 | self.main_model.unique_names = [] 124 | self.set_window_title("Auri - New Project") 125 | 126 | def open_project(self, is_import=False): 127 | self.dialog.setAcceptMode(QtWidgets.QFileDialog.AcceptOpen) 128 | if self.dialog.exec_() == QtWidgets.QDialog.Accepted: 129 | if not is_import: 130 | self.new_project() 131 | # Load the file 132 | self.main_model.current_project = self.dialog.selectedFiles()[0] 133 | file(self.main_model.current_project, "r").close() 134 | project_file_path = os.path.abspath(self.main_model.current_project) 135 | self.set_window_title("Auri - {0}".format(os.path.basename(self.main_model.current_project))) 136 | else: 137 | project_file_path = os.path.abspath(self.dialog.selectedFiles()[0]) 138 | with open(project_file_path, "r") as project_file: 139 | self.project_model.__dict__ = json.load(project_file, object_pairs_hook=OrderedDict) 140 | # Create the project 141 | for index in self.project_model.scripts_in_order: 142 | category = self.project_model.scripts_in_order[index]["Module Category"] 143 | subcategory = self.project_model.scripts_in_order[index]["Module SubCategory"] 144 | script = self.project_model.scripts_in_order[index]["Module Script"] 145 | model = self.project_model.scripts_in_order[index]["Model"] 146 | module_name = model["module_name"] 147 | self.add_script(category, subcategory, script, module_name, self.main_view, model=model) 148 | 149 | def refresh_project_model(self): 150 | self.project_model.scripts_in_order = {} 151 | self.main_model.scripts_to_execute = [] 152 | for widget_index in range(0, self.main_view.scrollable_layout.count()): 153 | script_view = self.main_view.scrollable_layout.itemAt(widget_index).widget() 154 | if not isinstance(script_view, ScriptModuleView): 155 | continue 156 | self.project_model.scripts_in_order[script_view.get_index()] = {} 157 | self.project_model.scripts_in_order[script_view.get_index()]["Module Category"] = script_view.category 158 | self.project_model.scripts_in_order[script_view.get_index()]["Module SubCategory"] = script_view.subcategory 159 | self.project_model.scripts_in_order[script_view.get_index()]["Module Script"] = script_view.script 160 | self.project_model.scripts_in_order[script_view.get_index()]["Model"] = script_view.model.__dict__ 161 | self.main_model.scripts_to_execute.append(script_view.the_ctrl) 162 | 163 | def save_project(self): 164 | # self.project_model.unique_names = [] 165 | if self.main_model.current_project is None: 166 | self.save_project_as() 167 | else: 168 | self.refresh_project_model() 169 | project_file_path = os.path.abspath(self.main_model.current_project) 170 | with open(project_file_path, "w") as project_file: 171 | json.dump(self.project_model.__dict__, project_file, sort_keys=True, indent=4, separators=(",", ": ")) 172 | self.set_window_title("Auri - {0}".format(os.path.basename(self.main_model.current_project))) 173 | 174 | def save_project_as(self): 175 | self.dialog.setAcceptMode(QtWidgets.QFileDialog.AcceptSave) 176 | if self.dialog.exec_() == QtWidgets.QDialog.Accepted: 177 | self.main_model.current_project = self.dialog.selectedFiles()[0] 178 | file(self.main_model.current_project, "w").close() 179 | self.save_project() 180 | else: 181 | # If the file does not exist, remove it from the title 182 | if self.main_model.current_project is not None: 183 | if not os.path.isfile(self.main_model.current_project): 184 | self.main_model.current_project = None 185 | self.set_window_title("Auri - New Project") 186 | 187 | def refresh(self): 188 | # Reload UI 189 | self.refresh_categories() 190 | self.refresh_subcategories() 191 | self.refresh_scripts() 192 | 193 | if self.main_view is None: 194 | return 195 | # Reload Scripts (temp save & reopen) 196 | self.refresh_project_model() 197 | old_project_model = self.project_model.__dict__ 198 | old_current_project = self.main_model.current_project 199 | 200 | self.new_project() 201 | if old_current_project is not None: 202 | self.main_model.current_project = old_current_project 203 | self.set_window_title("Auri - {0}".format(os.path.basename(self.main_model.current_project))) 204 | self.project_model.__dict__ = old_project_model 205 | self.main_view.add_btn.setDisabled(self.main_model.add_btn_disabled) 206 | 207 | # TODO: Extract that 208 | for index in self.project_model.scripts_in_order: 209 | category = self.project_model.scripts_in_order[index]["Module Category"] 210 | subcategory = self.project_model.scripts_in_order[index]["Module SubCategory"] 211 | script = self.project_model.scripts_in_order[index]["Module Script"] 212 | model = self.project_model.scripts_in_order[index]["Model"] 213 | module_name = model["module_name"] 214 | self.add_script(category, subcategory, script, module_name, self.main_view, model=model) 215 | 216 | def refresh_categories(self): 217 | categories = get_categories() 218 | self.main_model.categories = categories 219 | self.main_model.selected_category = None 220 | if self.category_combobox is not None: 221 | self.category_combobox.setCurrentIndex(0) 222 | 223 | def refresh_subcategories(self, new_category=None): 224 | subcategories = get_subcategories(new_category) 225 | self.main_model.subcategories = subcategories 226 | self.main_model.selected_subcategory = None 227 | if self.subcategory_combobox is not None: 228 | self.subcategory_combobox.setCurrentIndex(0) 229 | 230 | def refresh_scripts(self, category=None, subcategory=None): 231 | scripts = get_scripts(category, subcategory) 232 | self.main_model.scripts = scripts 233 | self.main_model.selected_script = None 234 | -------------------------------------------------------------------------------- /controllers/main_controller.py: -------------------------------------------------------------------------------- 1 | from functools import partial 2 | 3 | from auri.views.about_view import AboutView 4 | from auri.views.script_module_view import ScriptModuleView 5 | 6 | 7 | class MainController(object): 8 | def __init__(self, main_model, project_model, common_ctrl): 9 | """ 10 | 11 | Args: 12 | common_ctrl (auri.controllers.common_controller.CommonController): 13 | main_model (auri.models.main_model.MainModel): 14 | project_model (auri.models.project_model.ProjectModel): 15 | """ 16 | self.main_model = main_model 17 | self.project_model = project_model 18 | self.common_ctrl = common_ctrl 19 | self.about_dialog = AboutView() 20 | 21 | def category_changed(self, new_category): 22 | if new_category is not None: 23 | self.main_model.selected_category = self.main_model.categories.stringList()[new_category] 24 | self.common_ctrl.refresh_subcategories(self.main_model.selected_category) 25 | 26 | def subcategory_changed(self, new_subcategory): 27 | if new_subcategory is not None: 28 | self.main_model.selected_subcategory = self.main_model.subcategories.stringList()[new_subcategory] 29 | self.main_model.selected_script = self.main_model.selected_subcategory 30 | self.common_ctrl.refresh_scripts(self.main_model.selected_category, self.main_model.selected_script) 31 | 32 | def name_changed(self, new_name): 33 | self.main_model.module_name = new_name.replace(" ", "_") 34 | 35 | def setup(self, category_combobox, subcategory_combobox, script_selector): 36 | self.common_ctrl.category_combobox = category_combobox 37 | self.common_ctrl.subcategory_combobox = subcategory_combobox 38 | self.common_ctrl.script_selector = script_selector 39 | 40 | def add_selected_script(self, main_view): 41 | """ 42 | 43 | Args: 44 | main_view (auri.views.main_view.MainView): 45 | """ 46 | self.common_ctrl.add_script(self.main_model.selected_category, self.main_model.selected_subcategory, self.main_model.selected_script, self.main_model.module_name, main_view) 47 | 48 | def execute_all(self): 49 | self.common_ctrl.refresh_project_model() 50 | for script in self.main_model.scripts_to_execute: 51 | script.execute() 52 | 53 | def prebuild_all(self): 54 | self.common_ctrl.refresh_project_model() 55 | for script in self.main_model.scripts_to_execute: 56 | script.prebuild() 57 | 58 | def show_about(self): 59 | result = self.about_dialog.exec_() 60 | -------------------------------------------------------------------------------- /docs/images/auri_presentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/docs/images/auri_presentation.png -------------------------------------------------------------------------------- /docs/images/auri_stack_pres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/docs/images/auri_stack_pres.png -------------------------------------------------------------------------------- /models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/models/__init__.py -------------------------------------------------------------------------------- /models/main_model.py: -------------------------------------------------------------------------------- 1 | from auri.vendor.Qt import QtCore 2 | 3 | 4 | class MainModel(object): 5 | def __init__(self): 6 | self.categories_model = QtCore.QStringListModel() 7 | self.subcategories_model = QtCore.QStringListModel() 8 | self.scripts_model = QtCore.QStringListModel() 9 | self.module_name = None 10 | self.selected_subcategory = None 11 | self.selected_category = None 12 | self.selected_script = None 13 | self.current_part = None 14 | self.current_project = None 15 | self.unique_names = [] 16 | self.scripts_to_execute = [] 17 | 18 | @property 19 | def categories(self): 20 | return self.categories_model 21 | 22 | @categories.setter 23 | def categories(self, value): 24 | self.categories_model.setStringList(value) 25 | 26 | @property 27 | def subcategories(self): 28 | return self.subcategories_model 29 | 30 | @subcategories.setter 31 | def subcategories(self, value): 32 | self.subcategories_model.setStringList(value) 33 | 34 | @property 35 | def scripts(self): 36 | return self.scripts_model 37 | 38 | @scripts.setter 39 | def scripts(self, value): 40 | self.scripts_model.setStringList(value) 41 | 42 | @property 43 | def add_btn_disabled(self): 44 | if self.selected_subcategory is None or self.selected_category is None or self.selected_script is None or self.module_name is None: 45 | return True 46 | if len(self.selected_subcategory) > 0 and len(self.selected_category) > 0 and len(self.selected_script) > 0 and len(self.module_name) > 0: 47 | return False 48 | return True 49 | -------------------------------------------------------------------------------- /models/project_model.py: -------------------------------------------------------------------------------- 1 | class ProjectModel(object): 2 | def __init__(self): 3 | self.scripts_in_order = {} 4 | -------------------------------------------------------------------------------- /resources/icons/Arrow_Down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/resources/icons/Arrow_Down.png -------------------------------------------------------------------------------- /resources/icons/Arrow_Up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/resources/icons/Arrow_Up.png -------------------------------------------------------------------------------- /resources/icons/Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/resources/icons/Delete.png -------------------------------------------------------------------------------- /resources/icons/Duplicate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/resources/icons/Duplicate.png -------------------------------------------------------------------------------- /resources/themes/houdini_base.qss: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Houdini Style Sheet. 3 | 4 | When adding new styles, please add them to the appropriate section. 5 | And please maintain alphabetical order of style selectors within the same 6 | section with the exception of the QWidget styles in the GENERAL STYLES section. 7 | ******************************************************************************/ 8 | 9 | /****************************************************************************** 10 | GENERAL STYLES 11 | ******************************************************************************/ 12 | QWidget 13 | { 14 | /*font-family: "Source Sans Pro";*/ 15 | font-size: 12px; 16 | color: rgb(203, 203, 203); 17 | outline: none; 18 | } 19 | 20 | QWidget:disabled 21 | { 22 | color: rgb(131, 131, 131); 23 | } 24 | 25 | QWidget[transparent="true"] 26 | { 27 | background: none; 28 | border: none; 29 | } 30 | QWidget 31 | { 32 | background-color: rgb(58, 58, 58); 33 | } 34 | 35 | QCheckBox 36 | { 37 | background: rgb(58, 58, 58); 38 | color: rgb(203, 203, 203); 39 | } 40 | 41 | QCheckBox:disabled 42 | { 43 | color: rgb(131, 131, 131); 44 | } 45 | 46 | QCheckBox::indicator 47 | { 48 | color: rgb(203, 203, 203); 49 | } 50 | 51 | QComboBox 52 | { 53 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 54 | stop: 0.0 rgb(86, 86, 86), 55 | stop: 1.0 rgb(58, 58, 58)); 56 | 57 | border-top: 1px solid rgba(0, 0, 0, 40%); 58 | border-right: 1px solid rgba(0, 0, 0, 40%); 59 | border-bottom: 1px solid rgba(0, 0, 0, 62%); 60 | border-left: 1px solid rgba(0, 0, 0, 40%); 61 | 62 | border-radius: 1px; 63 | padding: 2px 10px 2px 10px; 64 | } 65 | 66 | QComboBox:disabled 67 | { 68 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 69 | stop: 0.0 rgba(86, 86, 86, 40%), 70 | stop: 1.0 rgba(58, 58, 58, 40%)); 71 | 72 | border-top: 1px solid rgba(0, 0, 0, 16%); 73 | border-right: 1px solid rgba(0, 0, 0, 16%); 74 | border-bottom: 1px solid rgba(0, 0, 0, 25%); 75 | border-left: 1px solid rgba(0, 0, 0, 16%); 76 | 77 | color: rgb(131, 131, 131); 78 | } 79 | 80 | QComboBox::down-arrow 81 | { 82 | width: 0; 83 | height: 0; 84 | border-left: 3px solid rgba(63, 63, 63, 0); 85 | border-right: 3px solid rgba(63, 63, 63, 0); 86 | border-top: 5px solid rgb(131, 131, 131); 87 | } 88 | 89 | QComboBox::drop-down 90 | { 91 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 92 | stop: 0.0 rgb(63, 63, 63), 93 | stop: 1.0 rgb(38, 38, 38)); 94 | width: 22px; 95 | } 96 | 97 | QComboBox QAbstractItemView 98 | { 99 | background-color: rgb(58, 58, 58); 100 | margin: 0px; 101 | 102 | border-top: 1px solid rgb(147, 147, 147); 103 | border-right: 1px solid rgb(38, 38, 38); 104 | border-bottom: 1px solid rgb(38, 38, 38); 105 | border-left: 1px solid rgb(147, 147, 147); 106 | padding: 0px; 107 | } 108 | 109 | QComboBox QAbstractItemView::item 110 | { 111 | padding: 5px 10px 5px 10px; 112 | } 113 | 114 | QComboBox QAbstractItemView::item:selected 115 | { 116 | background-color: rgb(178, 101, 0); 117 | color: rgb(255, 255, 255); 118 | } 119 | 120 | QCommandLinkButton#online_login_button, 121 | QCommandLinkButton#traditional_login_button 122 | { 123 | border: none; 124 | background: none; 125 | } 126 | 127 | QCommandLinkButton#online_login_button:hover, 128 | QCommandLinkButton#traditional_login_button:hover 129 | { 130 | background: rgb(90, 90, 90); 131 | } 132 | 133 | QDialog 134 | { 135 | background: rgb(58, 58, 58); 136 | color: rgb(203, 203, 203); 137 | padding: 10px; 138 | } 139 | 140 | QFrame, 141 | QGroupBox 142 | { 143 | /* Don\'t set the background on every possible box; */ 144 | /* it\'s unnecessary and prevents giving windows a background color */ 145 | /*background: rgb(58, 58, 58);*/ 146 | color: rgb(203, 203, 203); 147 | } 148 | 149 | QGroupBox 150 | { 151 | border: 1px solid rgb(28, 28, 28); 152 | border-radius: 5px; 153 | margin-top: 7px; 154 | padding-top: 6px; 155 | padding-right: 3px; 156 | padding-bottom: 0px; 157 | padding-left: 3px; 158 | } 159 | 160 | QGroupBox::title 161 | { 162 | subcontrol-origin: margin; 163 | subcontrol-position: top left; 164 | background: none; 165 | padding-left: 3px; 166 | padding-right: 3px; 167 | position: absolute; 168 | left: 5px; 169 | } 170 | 171 | QHeaderView::section 172 | { 173 | border: 1px solid rgb(25, 25, 25); 174 | border-right: 0; 175 | padding: 4px; 176 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 177 | stop: 0.0 rgb(58, 58, 58), 178 | stop: 1.0 rgb(38, 38, 38) ); 179 | } 180 | 181 | QLabel 182 | { 183 | background-color: rgb(58, 58, 58); 184 | } 185 | 186 | QLabel:enabled 187 | { 188 | color: rgb(203, 203, 203); 189 | } 190 | 191 | QLabel:disabled 192 | { 193 | color: rgb(131, 131, 131); 194 | } 195 | 196 | QLineEdit, 197 | QSpinBox 198 | { 199 | border: 1px solid rgb(35, 35, 35); 200 | border-radius: 1px; 201 | padding: 1px 1px; 202 | background: rgb(19, 19, 19); 203 | selection-color: rgb(0, 0, 0); 204 | selection-background-color: rgb(184, 133, 32); 205 | } 206 | 207 | QLineEdit:disabled, 208 | QSpinBox:disabled 209 | { 210 | border: 1px solid rgba(35, 35, 35, 40); 211 | border-radius: 1px; 212 | padding: 1px 1px; 213 | background: rgba(19, 19, 19, 40); 214 | color: rgb(131, 131, 131); 215 | } 216 | 217 | QListView 218 | { 219 | alternate-background-color: rgb(45, 45, 45); 220 | background: rgb(58, 58, 58); 221 | selection-background-color: rgba(184, 133, 32, 77); 222 | selection-color: rgb(0, 0, 0); 223 | color: rgb(203, 203, 203); 224 | } 225 | 226 | QListView::item 227 | { 228 | border-right: 1px solid rgb(25, 25, 25); 229 | border-left: 0; 230 | border-top: 0; 231 | border-bottom: 0; 232 | } 233 | 234 | QListView::item:selected 235 | { 236 | border-top: 1px solid rgb(184, 133, 32); 237 | border-bottom: 1px solid rgb(184, 133, 32); 238 | color: rgb(203, 203, 203); 239 | background: rgba(184, 133, 32, 77); 240 | } 241 | 242 | QMenu 243 | { 244 | background-color: rgb(58, 58, 58); 245 | border-top: 1px solid rgb(147, 147, 147); 246 | border-left: 1px solid rgb(147, 147, 147); 247 | border-bottom: 1px solid rgb(38, 38, 38); 248 | border-right: 1px solid rgb(38, 38, 38); 249 | padding: 0px; 250 | font-size: 12px; 251 | } 252 | 253 | QMenu::item 254 | { 255 | padding: 2px 25px 2px 21px; 256 | border: 1px solid transparent; 257 | } 258 | 259 | QMenu::item:selected:!disabled 260 | { 261 | background-color: rgb(178, 101, 0); 262 | color: rgb(255, 255, 255); 263 | } 264 | 265 | QMenu::item:disabled 266 | { 267 | color: rgb(160, 160, 160); 268 | } 269 | 270 | QMenu::icon 271 | { 272 | position: absolute; 273 | top: 0px; 274 | left: 3px; 275 | bottom: 0px; 276 | right: 0px; 277 | } 278 | 279 | QMenuBar 280 | { 281 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 282 | stop: 0.0 rgb(58, 58, 58), 283 | stop: 1.0 rgb(49, 49, 49)); 284 | border: 1px solid rgb(0, 0, 0); 285 | font-size: 12px; 286 | } 287 | 288 | QMenuBar::item 289 | { 290 | background: transparent; 291 | padding: 4px; 292 | } 293 | 294 | QMenuBar::item:selected 295 | { 296 | background-color: rgb(58, 58, 58); 297 | } 298 | 299 | QMenuBar::item:pressed 300 | { 301 | background: rgb(178, 101, 0); 302 | color: rgb(255, 255, 255); 303 | } 304 | 305 | QProgressBar 306 | { 307 | border: 1px solid rgb(147, 147, 147); 308 | text-align: center; 309 | background-color: rgb(49, 49, 49); 310 | } 311 | 312 | QProgressBar::chunk 313 | { 314 | background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, 315 | stop:0 rgb(184, 133, 32), 316 | stop:1 rgb(255, 229, 127)); 317 | } 318 | 319 | QPushButton 320 | { 321 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 322 | stop: 0.0 rgb(86, 86, 86), 323 | stop: 1.0 rgb(58, 58, 58)); 324 | border-top: 1px solid rgba(0, 0, 0, 40%); 325 | border-right: 1px solid rgba(0, 0, 0, 40%); 326 | border-bottom: 1px solid rgba(0, 0, 0, 62%); 327 | border-left: 1px solid rgba(0, 0, 0, 40%); 328 | border-radius: 1px; 329 | color: rgb(203, 203, 203); 330 | padding-top: 3px; 331 | padding-right: 15px; 332 | padding-bottom: 3px; 333 | padding-left: 15px; 334 | } 335 | 336 | QPushButton:checked, 337 | QToolButton:checked, 338 | QToolButton[transparent="true"]:checked 339 | { 340 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 341 | stop: 0.0 rgb(138, 100, 24), 342 | stop: 1.0 rgb(138, 100, 24)); 343 | color: rgb(255, 255, 255); 344 | } 345 | 346 | QPushButton:disabled, 347 | QToolButton:disabled 348 | { 349 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 350 | stop: 0.0 rgba(86, 86, 86, 40%), 351 | stop: 1.0 rgba(58, 58, 58, 40%)); 352 | 353 | border-top: 1px solid rgba(0, 0, 0, 16%); 354 | border-right: 1px solid rgba(0, 0, 0, 16%); 355 | border-bottom: 1px solid rgba(0, 0, 0, 25%); 356 | border-left: 1px solid rgba(0, 0, 0, 16%); 357 | 358 | color: rgb(131, 131, 131); 359 | } 360 | 361 | QPushButton:flat, 362 | QToolButton:flat 363 | { 364 | border: none; 365 | background: rgb(58, 58, 58); 366 | } 367 | 368 | QPushButton:hover, 369 | QToolButton:hover 370 | { 371 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 372 | stop: 0.0 rgb(90, 90, 90), 373 | stop: 1.0 rgb(61, 61, 61)); 374 | } 375 | 376 | QPushButton:pressed, 377 | QToolButton:pressed 378 | { 379 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 380 | stop: 0.0 rgba(184, 133, 32), 381 | stop: 1.0 rgba(184, 133, 32)); 382 | color: rgb(255, 255, 255); 383 | } 384 | 385 | QPushButton::menu-indicator 386 | { 387 | color: rgb(131, 131, 131); 388 | left: -5px; 389 | subcontrol-origin: padding; 390 | subcontrol-position: right center; 391 | } 392 | 393 | QPushButton::menu-indicator:disabled 394 | { 395 | color: rgba(131, 131, 131, 40%); 396 | } 397 | 398 | QRadioButton 399 | { 400 | background: rgb(58, 58, 58); 401 | color: rgb(203, 203, 203); 402 | padding: 4px; 403 | } 404 | 405 | QRadioButton:disabled 406 | { 407 | color: rgb(131, 131, 131); 408 | } 409 | 410 | QScrollArea 411 | { 412 | border: 1px solid rgb(35, 35, 35); 413 | } 414 | 415 | QScrollBar:horizontal 416 | { 417 | border: 1px solid rgb(45, 45, 45); 418 | background: rgb(38, 38, 38); 419 | height: 15px; 420 | margin: 0 17px 0 17px; 421 | } 422 | 423 | QScrollBar::handle:horizontal 424 | { 425 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 426 | stop: 0.0 rgb(86, 86, 86), 427 | stop: 1.0 rgb(58, 58, 58)); 428 | min-width: 30px; 429 | } 430 | 431 | QScrollBar::add-line:horizontal 432 | { 433 | border: 1px solid rgb(73, 73, 73); 434 | 435 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 436 | stop: 0.0 rgb(86, 86, 86), 437 | stop: 1.0 rgb(58, 58, 58)); 438 | width: 15px; 439 | subcontrol-position: right; 440 | subcontrol-origin: margin; 441 | } 442 | 443 | QScrollBar::sub-line:horizontal 444 | { 445 | border: 1px solid rgb(73, 73, 73); 446 | 447 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 448 | stop: 0.0 rgb(86, 86, 86), 449 | stop: 1.0 rgb(58, 58, 58)); 450 | width: 15px; 451 | subcontrol-position: left; 452 | subcontrol-origin: margin; 453 | } 454 | 455 | QScrollBar::left-arrow:horizontal 456 | { 457 | width: 0; 458 | height: 0; 459 | border-top: 3px solid rgb(86, 86, 86); 460 | border-bottom: 3px solid rgb(86, 86, 86); 461 | border-right: 5px solid rgb(131, 131, 131); 462 | } 463 | 464 | QScrollBar::right-arrow:horizontal 465 | { 466 | width: 0; 467 | height: 0; 468 | border-top: 3px solid rgb(86, 86, 86); 469 | border-bottom: 3px solid rgb(86, 86, 86); 470 | border-left: 5px solid rgb(131, 131, 131); 471 | } 472 | 473 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 474 | { 475 | background: none; 476 | } 477 | 478 | QScrollBar:vertical 479 | { 480 | border: 1px solid rgb(45, 45, 45); 481 | background: rgb(38, 38, 38); 482 | width: 15px; 483 | margin: 17px 0 17px 0; 484 | } 485 | 486 | QScrollBar::handle:vertical 487 | { 488 | background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, 489 | stop: 0.0 rgb(86, 86, 86), 490 | stop: 1.0 rgb(58, 58, 58)); 491 | min-height: 30px; 492 | } 493 | 494 | QScrollBar::add-line:vertical 495 | { 496 | border: 1px solid rgb(73, 73, 73); 497 | 498 | background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, 499 | stop: 0.0 rgb(86, 86, 86), 500 | stop: 1.0 rgb(58, 58, 58)); 501 | height: 15px; 502 | subcontrol-position: bottom; 503 | subcontrol-origin: margin; 504 | } 505 | 506 | QScrollBar::sub-line:vertical 507 | { 508 | border: 1px solid rgb(73, 73, 73); 509 | 510 | background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, 511 | stop: 0.0 rgb(86, 86, 86), 512 | stop: 1.0 rgb(58, 58, 58)); 513 | height: 15px; 514 | subcontrol-position: top; 515 | subcontrol-origin: margin; 516 | } 517 | 518 | QScrollBar::up-arrow:vertical 519 | { 520 | width: 0; 521 | height: 0; 522 | border-left: 3px solid rgba(86, 86, 86, 0); 523 | border-right: 3px solid rgba(86, 86, 86, 0); 524 | border-bottom: 5px solid rgb(131, 131, 131); 525 | } 526 | 527 | QScrollBar::down-arrow:vertical 528 | { 529 | width: 0; 530 | height: 0; 531 | border-left: 3px solid rgba(86, 86, 86, 0); 532 | border-right: 3px solid rgba(86, 86, 86, 0); 533 | border-top: 5px solid rgb(131, 131, 131); 534 | } 535 | 536 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 537 | { 538 | background: none; 539 | } 540 | 541 | QSlider::horizontal 542 | { 543 | height: 20px; 544 | } 545 | 546 | QSlider::vertical 547 | { 548 | width: 20px; 549 | } 550 | 551 | QSlider::groove::horizontal 552 | { 553 | border-top: 1px solid rgb(0, 0, 0); 554 | border-bottom: 1px solid rgb(0, 0, 0); 555 | border-radius: 1px; 556 | background: qlineargradient(x1:0, y1:0, x2:0, y2:1, 557 | stop:0.4 rgb(101, 101, 101), 558 | stop:0.5 rgb(76, 76, 76)); 559 | height: 3px; 560 | margin: 2px 0; 561 | } 562 | 563 | QSlider::groove::vertical 564 | { 565 | border-left: 1px solid rgb(0, 0, 0); 566 | border-right: 1px solid rgb(0, 0, 0); 567 | border-radius: 1px; 568 | background: qlineargradient(x1:0, y1:0, x2:1, y2:0, 569 | stop:0.4 rgb(101, 101, 101), 570 | stop:0.5 rgb(76, 76, 76)); 571 | width: 3px; 572 | margin: 0 2px; 573 | } 574 | 575 | QSlider::handle:horizontal 576 | { 577 | background: qlineargradient(x1:0, y1:0, x2:0, y2:1, 578 | stop:0 rgb(86, 86, 86), 579 | stop:1 rgb(58, 58, 58)); 580 | border-top: 1px solid rgb(0, 0, 0); 581 | border-left: 1px solid rgb(0, 0, 0); 582 | border-right: 1px solid rgb(0, 0, 0); 583 | border-bottom: 1px solid rgb(0, 0, 0); 584 | width: 4px; 585 | margin: -8px 0; 586 | border-radius: 1px; 587 | } 588 | 589 | QSlider::handle:vertical 590 | { 591 | background: qlineargradient(x1:0, y1:0, x2:1, y2:0, 592 | stop:0 rgb(86, 86, 86), 593 | stop:1 rgb(58, 58, 58)); 594 | border-top: 1px solid rgb(0, 0, 0); 595 | border-left: 1px solid rgb(0, 0, 0); 596 | border-right: 1px solid rgb(0, 0, 0); 597 | border-bottom: 1px solid rgb(0, 0, 0); 598 | height: 4px; 599 | margin: 0 -8px; 600 | border-radius: 1px; 601 | } 602 | 603 | QSlider::sub-page:horizontal 604 | { 605 | border-top: 1px solid rgb(0, 0, 0); 606 | border-bottom: 1px solid rgb(0, 0, 0); 607 | border-radius: 1px; 608 | background: qlineargradient(x1:0, y1:0, x2:0, y2:1, 609 | stop:0.4 rgb(76, 101, 127), 610 | stop:0.5 rgb(0, 50, 101)); 611 | height: 3px; 612 | margin: 2px 0; 613 | } 614 | 615 | QSlider::sub-page:vertical 616 | { 617 | border-left: 1px solid rgb(0, 0, 0); 618 | border-right: 1px solid rgb(0, 0, 0); 619 | border-radius: 1px; 620 | background: qlineargradient(x1:0, y1:0, x2:1, y2:0, 621 | stop:0.4 rgb(76, 101, 127), 622 | stop:0.5 rgb(0, 50, 101)); 623 | width: 3px; 624 | margin: 0 2px; 625 | } 626 | 627 | QSpinBox::up-arrow { 628 | background: rgb(63, 63, 63); 629 | width: 0; 630 | height: 0; 631 | border-left: 3px solid rgba(86, 86, 86, 0); 632 | border-right: 3px solid rgba(86, 86, 86, 0); 633 | border-bottom: 5px solid rgb(131, 131, 131); 634 | } 635 | 636 | QSpinBox::down-arrow { 637 | background: rgb(63, 63, 63); 638 | width: 0; 639 | height: 0; 640 | border-left: 3px solid rgba(86, 86, 86, 0); 641 | border-right: 3px solid rgba(86, 86, 86, 0); 642 | border-top: 5px solid rgb(131, 131, 131); 643 | } 644 | 645 | QSplitter::handle:horizontal 646 | { 647 | background-color: rgb(101, 101, 101); 648 | width: 4px; 649 | } 650 | 651 | QSplitter::handle:vertical 652 | { 653 | background-color: rgb(101, 101, 101); 654 | height: 4px; 655 | } 656 | 657 | QSplitter::handle:pressed 658 | { 659 | background-color: rgb(184, 133, 32); 660 | } 661 | 662 | QSplitterHandle:hover 663 | { 664 | } 665 | 666 | QSplitter::handle:hover 667 | { 668 | background-color: rgb(184, 133, 32); 669 | } 670 | 671 | QStatusBar 672 | { 673 | background: rgb(58, 58, 58); 674 | color: rgb(203, 203, 203); 675 | } 676 | 677 | QStatusBar::item 678 | { 679 | border: 0px; 680 | } 681 | 682 | QTabBar 683 | { 684 | background: rgb(58, 58, 58); 685 | border: none; 686 | } 687 | 688 | QTabBar::tab 689 | { 690 | padding-left: 6px; 691 | padding-right: 6px; 692 | height: 24px; 693 | margin-top: 1px; 694 | margin-left: -1px; 695 | border: 1px solid rgb(38, 38, 38); 696 | border-bottom: 0px; 697 | border-radius: 0px; 698 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 699 | stop: 0.0 rgb(45, 45, 45), 700 | stop: 1.0 rgb(45, 45, 45)); 701 | } 702 | 703 | QTabBar::tab:selected 704 | { 705 | border: 1px solid rgb(38, 38, 38); 706 | border-bottom: 0px; 707 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 708 | stop: 0.0 rgb(73, 73, 73), 709 | stop: 1.0 rgb(73, 73, 73)); 710 | } 711 | 712 | QTableView 713 | { 714 | alternate-background-color: rgb(45, 45, 45); 715 | background: rgb(58, 58, 58); 716 | selection-background-color: rgba(184, 133, 32, 77); 717 | selection-color: rgb(0, 0, 0); 718 | color: rgb(203, 203, 203); 719 | } 720 | 721 | QTableView::item 722 | { 723 | border-right: 1px solid rgb(25, 25, 25); 724 | border-left: 0; 725 | border-top: 0; 726 | border-bottom: 0; 727 | } 728 | 729 | QTableView::item:selected 730 | { 731 | border-top: 1px solid rgb(184, 133, 32); 732 | border-bottom: 1px solid rgb(184, 133, 32); 733 | color: rgb(203, 203, 203); 734 | background: rgba(184, 133, 32, 77); 735 | } 736 | 737 | QTabWidget 738 | { 739 | background: rgb(58, 58, 58); 740 | border: none; 741 | } 742 | 743 | QTabWidget::pane 744 | { 745 | border: 1px solid rgb(19, 19, 19); 746 | background: rgb(58, 58, 58); 747 | } 748 | 749 | QTabWidget::tab-bar 750 | { 751 | alignment: left; 752 | left: 1px; 753 | border: none; 754 | background: rgb(58, 58, 58); 755 | } 756 | 757 | QTextBrowser 758 | { 759 | color: rgb(203, 203, 203); 760 | selection-background-color: rgb(184, 133, 32); 761 | selection-color: rgb(0, 0, 0); 762 | border: none; 763 | } 764 | 765 | QTextEdit 766 | { 767 | background: rgb(19, 19, 19); 768 | color: rgb(203, 203, 203); 769 | selection-background-color: rgb(184, 133, 32); 770 | selection-color: rgb(0, 0, 0); 771 | } 772 | 773 | QTextEdit#code_edit 774 | { 775 | background: rgb(86, 86, 86); 776 | font-size: 15px; 777 | border: none; 778 | } 779 | 780 | QToolButton 781 | { 782 | border: 1px solid rgb(0, 0, 0); 783 | border-radius: 4px; 784 | padding-top: 2px; 785 | padding-bottom: 2px; 786 | padding-right: 2px; 787 | padding-left: 2px; 788 | margin: 1px; 789 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 790 | stop: 0.0 rgb(86, 86, 86), 791 | stop: 1.0 rgb(58, 58, 58)); 792 | } 793 | 794 | QToolButton[plain="true"], 795 | QToolButton[transparent="true"] 796 | { 797 | background: none; 798 | border: none; 799 | } 800 | 801 | QToolButton[transparent="true"]:hover 802 | { 803 | background:black; 804 | border: outset 1px; 805 | } 806 | 807 | QToolButton[plain="true"]:hover 808 | { 809 | background: none; 810 | border: none; 811 | } 812 | 813 | QToolButton[transparent="true"]:pressed 814 | { 815 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 816 | stop: 0.0 rgb(184, 133, 32), 817 | stop: 1.0 rgb(184, 133, 32)); 818 | color: rgb(255, 255, 255); 819 | } 820 | 821 | QToolButton[transparent="true"]:disabled 822 | { 823 | background: none; 824 | border: none; 825 | } 826 | 827 | QTreeView 828 | { 829 | alternate-background-color: rgb(45, 45, 45); 830 | background: rgb(58, 58, 58); 831 | selection-background-color: rgba(184, 133, 32, 77); 832 | selection-color: rgb(0, 0, 0); 833 | color: rgb(203, 203, 203); 834 | } 835 | 836 | QTreeView::item 837 | { 838 | border-right: 1px solid rgb(25, 25, 25); 839 | border-left: 0; 840 | border-top: 0; 841 | border-bottom: 0; 842 | } 843 | 844 | QTreeView::item:selected 845 | { 846 | border-top: 1px solid rgb(184, 133, 32); 847 | border-bottom: 1px solid rgb(184, 133, 32); 848 | color: rgb(203, 203, 203); 849 | background: rgba(184, 133, 32, 77); 850 | } 851 | 852 | /****************************************************************************** 853 | QT FEEL STYLES. 854 | ******************************************************************************/ 855 | #QT_Feel 856 | { 857 | border: 0px; 858 | } 859 | 860 | /****************************************************************************** 861 | RADIAL MENU STYLES. 862 | ******************************************************************************/ 863 | QT_RadialMenu 864 | { 865 | font-family: "Source Sans Pro"; 866 | font-size: 12px; 867 | color: rgb(203, 203, 203); 868 | background: rgb(58, 58, 58); 869 | selection-background-color: rgb(178, 101, 0); 870 | qproperty-bgLight: rgb(147, 147, 147); 871 | qproperty-bgDark: rgb(38, 38, 38); 872 | } 873 | 874 | /****************************************************************************** 875 | HELP BROWSER STYLES. 876 | ******************************************************************************/ 877 | QLineEdit[invalid="true"], 878 | QSpinBox[invalid="true"] 879 | { 880 | background: rgb(242, 142, 142); 881 | } 882 | 883 | QTabBar[webbrowser="true"]::tab 884 | { 885 | width: 100px; 886 | border-radius:1px; 887 | margin: 0px; 888 | } 889 | 890 | QTabBar[webbrowser="true"]::tab:last 891 | { 892 | border-color: rgb(58, 58, 58); 893 | border-radius: 0px; 894 | background: none; 895 | margin: 0px; 896 | } 897 | 898 | QTabBar[webbrowser="true"]::close-button 899 | { 900 | subcontrol-position: right; 901 | image: url(:/BUTTONS/delete.svg); 902 | width: 8px; 903 | height: 8px; 904 | margin: 4px; 905 | } 906 | 907 | #statusbar_line 908 | { 909 | color: rgb(0, 0, 0); 910 | } 911 | 912 | #toolbar_line 913 | { 914 | color: rgb(0, 0, 0); 915 | } 916 | 917 | /****************************************************************************** 918 | NETWORK EDITOR STYLES. 919 | ******************************************************************************/ 920 | NodeGraphFastFindWindow 921 | { 922 | background-color: rgb(58, 58, 58); 923 | } 924 | 925 | NodeGraphDispOptsWindow 926 | { 927 | background-color: rgb(58, 58, 58); 928 | } 929 | 930 | #node_popup_window 931 | { 932 | background-color: rgb(40, 42, 53); 933 | } 934 | 935 | #node_popup_window QTextBrowser 936 | { 937 | background-color: transparent; 938 | } 939 | 940 | #node_popup_window QToolButton:checked 941 | { 942 | background-color: rgb(184, 133, 32); 943 | } 944 | 945 | #node_popup_section 946 | { 947 | border-top: 1px solid rgb(101, 101, 101); 948 | background-color: transparent; 949 | } 950 | #node_popup_basic_section 951 | { 952 | background-color: rgb(31, 33, 43); 953 | } 954 | 955 | #node_popup_comment 956 | { 957 | background-color: transparent; 958 | color: rgb(109, 180, 189); 959 | selection-background-color: rgb(184, 133, 32); 960 | selection-color: rgb(0, 0, 0); 961 | border: none; 962 | } 963 | 964 | #node_popup_showcomment 965 | { 966 | color: rgb(109, 180, 189); 967 | } 968 | 969 | #node_popup_basic_html { 970 | background-color: black; 971 | } 972 | 973 | #node_popup_badgeicon 974 | { 975 | background-color: transparent; 976 | border: none; 977 | } 978 | 979 | /****************************************************************************** 980 | POSE LIBRARY STYLES. 981 | ******************************************************************************/ 982 | CaptureWidget 983 | { 984 | background-color: #FF0000; 985 | border-bottom: 1px solid rgb(203, 203, 203); 986 | } 987 | 988 | GridEntry 989 | { 990 | outline: none; 991 | } 992 | 993 | GridEntry:hover 994 | { 995 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 996 | stop: 0.0 rgb(94, 94, 94), 997 | stop: 1.0 rgb(64, 64, 64)); 998 | } 999 | 1000 | /****************************************************************************** 1001 | PYTHON PANEL HELP EXAMPLES STYLES. 1002 | ******************************************************************************/ 1003 | ExampleHelpWidget[help_text="true"] 1004 | { 1005 | border-bottom: 1px solid rgb(203, 203, 203); 1006 | } 1007 | 1008 | /****************************************************************************** 1009 | hou.qt SPECIFIC STYLES. 1010 | ******************************************************************************/ 1011 | *[houdiniStyle="true"] 1012 | { 1013 | background-color: rgb(58, 58, 58); 1014 | font-family: "Source Sans Pro"; 1015 | font-size: 12px; 1016 | color: rgb(203, 203, 203); 1017 | } 1018 | 1019 | QFrame[houdiniSeparator="true"] 1020 | { 1021 | background: rgb(0, 0, 0); 1022 | } 1023 | 1024 | QWidget[houdiniToolTip="true"] 1025 | { 1026 | background: rgb(0, 0, 0); 1027 | color: rgb(203, 203, 203); 1028 | } 1029 | 1030 | QLabel[houdiniToolTipTitle="true"] 1031 | { 1032 | padding: 4px 2px 2px 2px; 1033 | } 1034 | 1035 | QLabel[houdiniToolTipText="true"] 1036 | { 1037 | padding: 2px; 1038 | } 1039 | 1040 | QLabel[houdiniToolTipHotkeyText="true"] 1041 | { 1042 | font-style: italic; 1043 | padding: 0px 2px 2px 10px; 1044 | text-align: top left; 1045 | } 1046 | 1047 | QLabel[houdiniToolTipExtra="true"] 1048 | { 1049 | background: rgb(58, 73, 101); 1050 | color: rgb(203, 203, 203); 1051 | padding: 0px 2px 0px 2px; 1052 | } 1053 | 1054 | QPushButton[menu="true"] 1055 | { 1056 | border-radius: 2px; 1057 | height: 18px; 1058 | width: 18px; 1059 | padding: 0px; 1060 | } 1061 | 1062 | QPushButton[menu="true"]::menu-indicator 1063 | { 1064 | left: 0px; 1065 | subcontrol-position: center center; 1066 | } 1067 | 1068 | QToolButton[flat="true"] 1069 | { 1070 | background: none; 1071 | border: none; 1072 | border-radius: 0px; 1073 | padding: 0px; 1074 | } 1075 | 1076 | QToolButton[flat="true"]:hover 1077 | { 1078 | background: rgb(255, 255, 255, 45%); 1079 | } 1080 | -------------------------------------------------------------------------------- /scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sookhaal/auri/e9f4edbd67901df4c8892edef9ebb1a2f83e7968/scripts/__init__.py -------------------------------------------------------------------------------- /vendor/Qt.py: -------------------------------------------------------------------------------- 1 | """Minimal Python 2 & 3 shim around all Qt bindings 2 | 3 | DOCUMENTATION 4 | Qt.py was born in the film and visual effects industry to address 5 | the growing need for the development of software capable of running 6 | with more than one flavour of the Qt bindings for Python - PySide, 7 | PySide2, PyQt4 and PyQt5. 8 | 9 | 1. Build for one, run with all 10 | 2. Explicit is better than implicit 11 | 3. Support co-existence 12 | 13 | Default resolution order: 14 | - PySide2 15 | - PyQt5 16 | - PySide 17 | - PyQt4 18 | 19 | Usage: 20 | >> import sys 21 | >> from Qt import QtWidgets 22 | >> app = QtWidgets.QApplication(sys.argv) 23 | >> button = QtWidgets.QPushButton("Hello World") 24 | >> button.show() 25 | >> app.exec_() 26 | 27 | All members of PySide2 are mapped from other bindings, should they exist. 28 | If no equivalent member exist, it is excluded from Qt.py and inaccessible. 29 | The idea is to highlight members that exist across all supported binding, 30 | and guarantee that code that runs on one binding runs on all others. 31 | 32 | For more details, visit https://github.com/mottosso/Qt.py 33 | 34 | LICENSE 35 | 36 | See end of file for license (MIT, BSD) information. 37 | 38 | """ 39 | 40 | import os 41 | import sys 42 | import types 43 | import shutil 44 | import importlib 45 | import json 46 | 47 | 48 | __version__ = "1.3.2" 49 | 50 | # Enable support for `from Qt import *` 51 | __all__ = [] 52 | 53 | # Flags from environment variables 54 | QT_VERBOSE = bool(os.getenv("QT_VERBOSE")) 55 | QT_PREFERRED_BINDING_JSON = os.getenv("QT_PREFERRED_BINDING_JSON", "") 56 | QT_PREFERRED_BINDING = os.getenv("QT_PREFERRED_BINDING", "") 57 | QT_SIP_API_HINT = os.getenv("QT_SIP_API_HINT") 58 | 59 | # Reference to Qt.py 60 | Qt = sys.modules[__name__] 61 | Qt.QtCompat = types.ModuleType("QtCompat") 62 | 63 | try: 64 | long 65 | except NameError: 66 | # Python 3 compatibility 67 | long = int 68 | 69 | 70 | """Common members of all bindings 71 | 72 | This is where each member of Qt.py is explicitly defined. 73 | It is based on a "lowest common denominator" of all bindings; 74 | including members found in each of the 4 bindings. 75 | 76 | The "_common_members" dictionary is generated using the 77 | build_membership.sh script. 78 | 79 | """ 80 | 81 | _common_members = { 82 | "QtCore": [ 83 | "QAbstractAnimation", 84 | "QAbstractEventDispatcher", 85 | "QAbstractItemModel", 86 | "QAbstractListModel", 87 | "QAbstractState", 88 | "QAbstractTableModel", 89 | "QAbstractTransition", 90 | "QAnimationGroup", 91 | "QBasicTimer", 92 | "QBitArray", 93 | "QBuffer", 94 | "QByteArray", 95 | "QByteArrayMatcher", 96 | "QChildEvent", 97 | "QCoreApplication", 98 | "QCryptographicHash", 99 | "QDataStream", 100 | "QDate", 101 | "QDateTime", 102 | "QDir", 103 | "QDirIterator", 104 | "QDynamicPropertyChangeEvent", 105 | "QEasingCurve", 106 | "QElapsedTimer", 107 | "QEvent", 108 | "QEventLoop", 109 | "QEventTransition", 110 | "QFile", 111 | "QFileInfo", 112 | "QFileSystemWatcher", 113 | "QFinalState", 114 | "QGenericArgument", 115 | "QGenericReturnArgument", 116 | "QHistoryState", 117 | "QItemSelectionRange", 118 | "QIODevice", 119 | "QLibraryInfo", 120 | "QLine", 121 | "QLineF", 122 | "QLocale", 123 | "QMargins", 124 | "QMetaClassInfo", 125 | "QMetaEnum", 126 | "QMetaMethod", 127 | "QMetaObject", 128 | "QMetaProperty", 129 | "QMimeData", 130 | "QModelIndex", 131 | "QMutex", 132 | "QMutexLocker", 133 | "QObject", 134 | "QParallelAnimationGroup", 135 | "QPauseAnimation", 136 | "QPersistentModelIndex", 137 | "QPluginLoader", 138 | "QPoint", 139 | "QPointF", 140 | "QProcess", 141 | "QProcessEnvironment", 142 | "QPropertyAnimation", 143 | "QReadLocker", 144 | "QReadWriteLock", 145 | "QRect", 146 | "QRectF", 147 | "QRegExp", 148 | "QResource", 149 | "QRunnable", 150 | "QSemaphore", 151 | "QSequentialAnimationGroup", 152 | "QSettings", 153 | "QSignalMapper", 154 | "QSignalTransition", 155 | "QSize", 156 | "QSizeF", 157 | "QSocketNotifier", 158 | "QState", 159 | "QStateMachine", 160 | "QSysInfo", 161 | "QSystemSemaphore", 162 | "QT_TRANSLATE_NOOP", 163 | "QT_TR_NOOP", 164 | "QT_TR_NOOP_UTF8", 165 | "QTemporaryFile", 166 | "QTextBoundaryFinder", 167 | "QTextCodec", 168 | "QTextDecoder", 169 | "QTextEncoder", 170 | "QTextStream", 171 | "QTextStreamManipulator", 172 | "QThread", 173 | "QThreadPool", 174 | "QTime", 175 | "QTimeLine", 176 | "QTimer", 177 | "QTimerEvent", 178 | "QTranslator", 179 | "QUrl", 180 | "QVariantAnimation", 181 | "QWaitCondition", 182 | "QWriteLocker", 183 | "QXmlStreamAttribute", 184 | "QXmlStreamAttributes", 185 | "QXmlStreamEntityDeclaration", 186 | "QXmlStreamEntityResolver", 187 | "QXmlStreamNamespaceDeclaration", 188 | "QXmlStreamNotationDeclaration", 189 | "QXmlStreamReader", 190 | "QXmlStreamWriter", 191 | "Qt", 192 | "QtCriticalMsg", 193 | "QtDebugMsg", 194 | "QtFatalMsg", 195 | "QtMsgType", 196 | "QtSystemMsg", 197 | "QtWarningMsg", 198 | "qAbs", 199 | "qAddPostRoutine", 200 | "qChecksum", 201 | "qCritical", 202 | "qDebug", 203 | "qFatal", 204 | "qFuzzyCompare", 205 | "qIsFinite", 206 | "qIsInf", 207 | "qIsNaN", 208 | "qIsNull", 209 | "qRegisterResourceData", 210 | "qUnregisterResourceData", 211 | "qVersion", 212 | "qWarning", 213 | "qrand", 214 | "qsrand" 215 | ], 216 | "QtGui": [ 217 | "QAbstractTextDocumentLayout", 218 | "QActionEvent", 219 | "QBitmap", 220 | "QBrush", 221 | "QClipboard", 222 | "QCloseEvent", 223 | "QColor", 224 | "QConicalGradient", 225 | "QContextMenuEvent", 226 | "QCursor", 227 | "QDesktopServices", 228 | "QDoubleValidator", 229 | "QDrag", 230 | "QDragEnterEvent", 231 | "QDragLeaveEvent", 232 | "QDragMoveEvent", 233 | "QDropEvent", 234 | "QFileOpenEvent", 235 | "QFocusEvent", 236 | "QFont", 237 | "QFontDatabase", 238 | "QFontInfo", 239 | "QFontMetrics", 240 | "QFontMetricsF", 241 | "QGradient", 242 | "QHelpEvent", 243 | "QHideEvent", 244 | "QHoverEvent", 245 | "QIcon", 246 | "QIconDragEvent", 247 | "QIconEngine", 248 | "QImage", 249 | "QImageIOHandler", 250 | "QImageReader", 251 | "QImageWriter", 252 | "QInputEvent", 253 | "QInputMethodEvent", 254 | "QIntValidator", 255 | "QKeyEvent", 256 | "QKeySequence", 257 | "QLinearGradient", 258 | "QMatrix2x2", 259 | "QMatrix2x3", 260 | "QMatrix2x4", 261 | "QMatrix3x2", 262 | "QMatrix3x3", 263 | "QMatrix3x4", 264 | "QMatrix4x2", 265 | "QMatrix4x3", 266 | "QMatrix4x4", 267 | "QMouseEvent", 268 | "QMoveEvent", 269 | "QMovie", 270 | "QPaintDevice", 271 | "QPaintEngine", 272 | "QPaintEngineState", 273 | "QPaintEvent", 274 | "QPainter", 275 | "QPainterPath", 276 | "QPainterPathStroker", 277 | "QPalette", 278 | "QPen", 279 | "QPicture", 280 | "QPictureIO", 281 | "QPixmap", 282 | "QPixmapCache", 283 | "QPolygon", 284 | "QPolygonF", 285 | "QQuaternion", 286 | "QRadialGradient", 287 | "QRegExpValidator", 288 | "QRegion", 289 | "QResizeEvent", 290 | "QSessionManager", 291 | "QShortcutEvent", 292 | "QShowEvent", 293 | "QStandardItem", 294 | "QStandardItemModel", 295 | "QStatusTipEvent", 296 | "QSyntaxHighlighter", 297 | "QTabletEvent", 298 | "QTextBlock", 299 | "QTextBlockFormat", 300 | "QTextBlockGroup", 301 | "QTextBlockUserData", 302 | "QTextCharFormat", 303 | "QTextCursor", 304 | "QTextDocument", 305 | "QTextDocumentFragment", 306 | "QTextFormat", 307 | "QTextFragment", 308 | "QTextFrame", 309 | "QTextFrameFormat", 310 | "QTextImageFormat", 311 | "QTextInlineObject", 312 | "QTextItem", 313 | "QTextLayout", 314 | "QTextLength", 315 | "QTextLine", 316 | "QTextList", 317 | "QTextListFormat", 318 | "QTextObject", 319 | "QTextObjectInterface", 320 | "QTextOption", 321 | "QTextTable", 322 | "QTextTableCell", 323 | "QTextTableCellFormat", 324 | "QTextTableFormat", 325 | "QTouchEvent", 326 | "QTransform", 327 | "QValidator", 328 | "QVector2D", 329 | "QVector3D", 330 | "QVector4D", 331 | "QWhatsThisClickedEvent", 332 | "QWheelEvent", 333 | "QWindowStateChangeEvent", 334 | "qAlpha", 335 | "qBlue", 336 | "qGray", 337 | "qGreen", 338 | "qIsGray", 339 | "qRed", 340 | "qRgb", 341 | "qRgba" 342 | ], 343 | "QtHelp": [ 344 | "QHelpContentItem", 345 | "QHelpContentModel", 346 | "QHelpContentWidget", 347 | "QHelpEngine", 348 | "QHelpEngineCore", 349 | "QHelpIndexModel", 350 | "QHelpIndexWidget", 351 | "QHelpSearchEngine", 352 | "QHelpSearchQuery", 353 | "QHelpSearchQueryWidget", 354 | "QHelpSearchResultWidget" 355 | ], 356 | "QtMultimedia": [ 357 | "QAbstractVideoBuffer", 358 | "QAbstractVideoSurface", 359 | "QAudio", 360 | "QAudioDeviceInfo", 361 | "QAudioFormat", 362 | "QAudioInput", 363 | "QAudioOutput", 364 | "QVideoFrame", 365 | "QVideoSurfaceFormat" 366 | ], 367 | "QtNetwork": [ 368 | "QAbstractNetworkCache", 369 | "QAbstractSocket", 370 | "QAuthenticator", 371 | "QHostAddress", 372 | "QHostInfo", 373 | "QLocalServer", 374 | "QLocalSocket", 375 | "QNetworkAccessManager", 376 | "QNetworkAddressEntry", 377 | "QNetworkCacheMetaData", 378 | "QNetworkConfiguration", 379 | "QNetworkConfigurationManager", 380 | "QNetworkCookie", 381 | "QNetworkCookieJar", 382 | "QNetworkDiskCache", 383 | "QNetworkInterface", 384 | "QNetworkProxy", 385 | "QNetworkProxyFactory", 386 | "QNetworkProxyQuery", 387 | "QNetworkReply", 388 | "QNetworkRequest", 389 | "QNetworkSession", 390 | "QSsl", 391 | "QTcpServer", 392 | "QTcpSocket", 393 | "QUdpSocket" 394 | ], 395 | "QtOpenGL": [ 396 | "QGL", 397 | "QGLContext", 398 | "QGLFormat", 399 | "QGLWidget" 400 | ], 401 | "QtPrintSupport": [ 402 | "QAbstractPrintDialog", 403 | "QPageSetupDialog", 404 | "QPrintDialog", 405 | "QPrintEngine", 406 | "QPrintPreviewDialog", 407 | "QPrintPreviewWidget", 408 | "QPrinter", 409 | "QPrinterInfo" 410 | ], 411 | "QtSql": [ 412 | "QSql", 413 | "QSqlDatabase", 414 | "QSqlDriver", 415 | "QSqlDriverCreatorBase", 416 | "QSqlError", 417 | "QSqlField", 418 | "QSqlIndex", 419 | "QSqlQuery", 420 | "QSqlQueryModel", 421 | "QSqlRecord", 422 | "QSqlRelation", 423 | "QSqlRelationalDelegate", 424 | "QSqlRelationalTableModel", 425 | "QSqlResult", 426 | "QSqlTableModel" 427 | ], 428 | "QtSvg": [ 429 | "QGraphicsSvgItem", 430 | "QSvgGenerator", 431 | "QSvgRenderer", 432 | "QSvgWidget" 433 | ], 434 | "QtTest": [ 435 | "QTest" 436 | ], 437 | "QtWidgets": [ 438 | "QAbstractButton", 439 | "QAbstractGraphicsShapeItem", 440 | "QAbstractItemDelegate", 441 | "QAbstractItemView", 442 | "QAbstractScrollArea", 443 | "QAbstractSlider", 444 | "QAbstractSpinBox", 445 | "QAction", 446 | "QActionGroup", 447 | "QApplication", 448 | "QBoxLayout", 449 | "QButtonGroup", 450 | "QCalendarWidget", 451 | "QCheckBox", 452 | "QColorDialog", 453 | "QColumnView", 454 | "QComboBox", 455 | "QCommandLinkButton", 456 | "QCommonStyle", 457 | "QCompleter", 458 | "QDataWidgetMapper", 459 | "QDateEdit", 460 | "QDateTimeEdit", 461 | "QDesktopWidget", 462 | "QDial", 463 | "QDialog", 464 | "QDialogButtonBox", 465 | "QDirModel", 466 | "QDockWidget", 467 | "QDoubleSpinBox", 468 | "QErrorMessage", 469 | "QFileDialog", 470 | "QFileIconProvider", 471 | "QFileSystemModel", 472 | "QFocusFrame", 473 | "QFontComboBox", 474 | "QFontDialog", 475 | "QFormLayout", 476 | "QFrame", 477 | "QGesture", 478 | "QGestureEvent", 479 | "QGestureRecognizer", 480 | "QGraphicsAnchor", 481 | "QGraphicsAnchorLayout", 482 | "QGraphicsBlurEffect", 483 | "QGraphicsColorizeEffect", 484 | "QGraphicsDropShadowEffect", 485 | "QGraphicsEffect", 486 | "QGraphicsEllipseItem", 487 | "QGraphicsGridLayout", 488 | "QGraphicsItem", 489 | "QGraphicsItemGroup", 490 | "QGraphicsLayout", 491 | "QGraphicsLayoutItem", 492 | "QGraphicsLineItem", 493 | "QGraphicsLinearLayout", 494 | "QGraphicsObject", 495 | "QGraphicsOpacityEffect", 496 | "QGraphicsPathItem", 497 | "QGraphicsPixmapItem", 498 | "QGraphicsPolygonItem", 499 | "QGraphicsProxyWidget", 500 | "QGraphicsRectItem", 501 | "QGraphicsRotation", 502 | "QGraphicsScale", 503 | "QGraphicsScene", 504 | "QGraphicsSceneContextMenuEvent", 505 | "QGraphicsSceneDragDropEvent", 506 | "QGraphicsSceneEvent", 507 | "QGraphicsSceneHelpEvent", 508 | "QGraphicsSceneHoverEvent", 509 | "QGraphicsSceneMouseEvent", 510 | "QGraphicsSceneMoveEvent", 511 | "QGraphicsSceneResizeEvent", 512 | "QGraphicsSceneWheelEvent", 513 | "QGraphicsSimpleTextItem", 514 | "QGraphicsTextItem", 515 | "QGraphicsTransform", 516 | "QGraphicsView", 517 | "QGraphicsWidget", 518 | "QGridLayout", 519 | "QGroupBox", 520 | "QHBoxLayout", 521 | "QHeaderView", 522 | "QInputDialog", 523 | "QItemDelegate", 524 | "QItemEditorCreatorBase", 525 | "QItemEditorFactory", 526 | "QKeyEventTransition", 527 | "QLCDNumber", 528 | "QLabel", 529 | "QLayout", 530 | "QLayoutItem", 531 | "QLineEdit", 532 | "QListView", 533 | "QListWidget", 534 | "QListWidgetItem", 535 | "QMainWindow", 536 | "QMdiArea", 537 | "QMdiSubWindow", 538 | "QMenu", 539 | "QMenuBar", 540 | "QMessageBox", 541 | "QMouseEventTransition", 542 | "QPanGesture", 543 | "QPinchGesture", 544 | "QPlainTextDocumentLayout", 545 | "QPlainTextEdit", 546 | "QProgressBar", 547 | "QProgressDialog", 548 | "QPushButton", 549 | "QRadioButton", 550 | "QRubberBand", 551 | "QScrollArea", 552 | "QScrollBar", 553 | "QShortcut", 554 | "QSizeGrip", 555 | "QSizePolicy", 556 | "QSlider", 557 | "QSpacerItem", 558 | "QSpinBox", 559 | "QSplashScreen", 560 | "QSplitter", 561 | "QSplitterHandle", 562 | "QStackedLayout", 563 | "QStackedWidget", 564 | "QStatusBar", 565 | "QStyle", 566 | "QStyleFactory", 567 | "QStyleHintReturn", 568 | "QStyleHintReturnMask", 569 | "QStyleHintReturnVariant", 570 | "QStyleOption", 571 | "QStyleOptionButton", 572 | "QStyleOptionComboBox", 573 | "QStyleOptionComplex", 574 | "QStyleOptionDockWidget", 575 | "QStyleOptionFocusRect", 576 | "QStyleOptionFrame", 577 | "QStyleOptionGraphicsItem", 578 | "QStyleOptionGroupBox", 579 | "QStyleOptionHeader", 580 | "QStyleOptionMenuItem", 581 | "QStyleOptionProgressBar", 582 | "QStyleOptionRubberBand", 583 | "QStyleOptionSizeGrip", 584 | "QStyleOptionSlider", 585 | "QStyleOptionSpinBox", 586 | "QStyleOptionTab", 587 | "QStyleOptionTabBarBase", 588 | "QStyleOptionTabWidgetFrame", 589 | "QStyleOptionTitleBar", 590 | "QStyleOptionToolBar", 591 | "QStyleOptionToolBox", 592 | "QStyleOptionToolButton", 593 | "QStyleOptionViewItem", 594 | "QStylePainter", 595 | "QStyledItemDelegate", 596 | "QSwipeGesture", 597 | "QSystemTrayIcon", 598 | "QTabBar", 599 | "QTabWidget", 600 | "QTableView", 601 | "QTableWidget", 602 | "QTableWidgetItem", 603 | "QTableWidgetSelectionRange", 604 | "QTapAndHoldGesture", 605 | "QTapGesture", 606 | "QTextBrowser", 607 | "QTextEdit", 608 | "QTimeEdit", 609 | "QToolBar", 610 | "QToolBox", 611 | "QToolButton", 612 | "QToolTip", 613 | "QTreeView", 614 | "QTreeWidget", 615 | "QTreeWidgetItem", 616 | "QTreeWidgetItemIterator", 617 | "QUndoCommand", 618 | "QUndoGroup", 619 | "QUndoStack", 620 | "QUndoView", 621 | "QVBoxLayout", 622 | "QWhatsThis", 623 | "QWidget", 624 | "QWidgetAction", 625 | "QWidgetItem", 626 | "QWizard", 627 | "QWizardPage" 628 | ], 629 | "QtX11Extras": [ 630 | "QX11Info" 631 | ], 632 | "QtXml": [ 633 | "QDomAttr", 634 | "QDomCDATASection", 635 | "QDomCharacterData", 636 | "QDomComment", 637 | "QDomDocument", 638 | "QDomDocumentFragment", 639 | "QDomDocumentType", 640 | "QDomElement", 641 | "QDomEntity", 642 | "QDomEntityReference", 643 | "QDomImplementation", 644 | "QDomNamedNodeMap", 645 | "QDomNode", 646 | "QDomNodeList", 647 | "QDomNotation", 648 | "QDomProcessingInstruction", 649 | "QDomText", 650 | "QXmlAttributes", 651 | "QXmlContentHandler", 652 | "QXmlDTDHandler", 653 | "QXmlDeclHandler", 654 | "QXmlDefaultHandler", 655 | "QXmlEntityResolver", 656 | "QXmlErrorHandler", 657 | "QXmlInputSource", 658 | "QXmlLexicalHandler", 659 | "QXmlLocator", 660 | "QXmlNamespaceSupport", 661 | "QXmlParseException", 662 | "QXmlReader", 663 | "QXmlSimpleReader" 664 | ], 665 | "QtXmlPatterns": [ 666 | "QAbstractMessageHandler", 667 | "QAbstractUriResolver", 668 | "QAbstractXmlNodeModel", 669 | "QAbstractXmlReceiver", 670 | "QSourceLocation", 671 | "QXmlFormatter", 672 | "QXmlItem", 673 | "QXmlName", 674 | "QXmlNamePool", 675 | "QXmlNodeModelIndex", 676 | "QXmlQuery", 677 | "QXmlResultItems", 678 | "QXmlSchema", 679 | "QXmlSchemaValidator", 680 | "QXmlSerializer" 681 | ] 682 | } 683 | 684 | """ Missing members 685 | 686 | This mapping describes members that have been deprecated 687 | in one or more bindings and have been left out of the 688 | _common_members mapping. 689 | 690 | The member can provide an extra details string to be 691 | included in exceptions and warnings. 692 | """ 693 | 694 | _missing_members = { 695 | "QtGui": { 696 | "QMatrix": "Deprecated in PyQt5", 697 | }, 698 | } 699 | 700 | 701 | def _qInstallMessageHandler(handler): 702 | """Install a message handler that works in all bindings 703 | 704 | Args: 705 | handler: A function that takes 3 arguments, or None 706 | """ 707 | def messageOutputHandler(*args): 708 | # In Qt4 bindings, message handlers are passed 2 arguments 709 | # In Qt5 bindings, message handlers are passed 3 arguments 710 | # The first argument is a QtMsgType 711 | # The last argument is the message to be printed 712 | # The Middle argument (if passed) is a QMessageLogContext 713 | if len(args) == 3: 714 | msgType, logContext, msg = args 715 | elif len(args) == 2: 716 | msgType, msg = args 717 | logContext = None 718 | else: 719 | raise TypeError( 720 | "handler expected 2 or 3 arguments, got {0}".format(len(args))) 721 | 722 | if isinstance(msg, bytes): 723 | # In python 3, some bindings pass a bytestring, which cannot be 724 | # used elsewhere. Decoding a python 2 or 3 bytestring object will 725 | # consistently return a unicode object. 726 | msg = msg.decode() 727 | 728 | handler(msgType, logContext, msg) 729 | 730 | passObject = messageOutputHandler if handler else handler 731 | if Qt.IsPySide or Qt.IsPyQt4: 732 | return Qt._QtCore.qInstallMsgHandler(passObject) 733 | elif Qt.IsPySide2 or Qt.IsPyQt5: 734 | return Qt._QtCore.qInstallMessageHandler(passObject) 735 | 736 | 737 | def _getcpppointer(object): 738 | if hasattr(Qt, "_shiboken2"): 739 | return getattr(Qt, "_shiboken2").getCppPointer(object)[0] 740 | elif hasattr(Qt, "_shiboken"): 741 | return getattr(Qt, "_shiboken").getCppPointer(object)[0] 742 | elif hasattr(Qt, "_sip"): 743 | return getattr(Qt, "_sip").unwrapinstance(object) 744 | raise AttributeError("'module' has no attribute 'getCppPointer'") 745 | 746 | 747 | def _wrapinstance(ptr, base=None): 748 | """Enable implicit cast of pointer to most suitable class 749 | 750 | This behaviour is available in sip per default. 751 | 752 | Based on http://nathanhorne.com/pyqtpyside-wrap-instance 753 | 754 | Usage: 755 | This mechanism kicks in under these circumstances. 756 | 1. Qt.py is using PySide 1 or 2. 757 | 2. A `base` argument is not provided. 758 | 759 | See :func:`QtCompat.wrapInstance()` 760 | 761 | Arguments: 762 | ptr (long): Pointer to QObject in memory 763 | base (QObject, optional): Base class to wrap with. Defaults to QObject, 764 | which should handle anything. 765 | 766 | """ 767 | 768 | assert isinstance(ptr, long), "Argument 'ptr' must be of typeAuri is a modular python script launcher.
The main idea is to build a library of scripts (we call them modules) and have a shell (Auri) executing the stacked scripts in a top to bottom order.
A module named {0} already exists.
".format(self.new_name.text())) 52 | self.message_box.show() 53 | QtWidgets.QDialog.reject(self) 54 | 55 | def cancel_pressed(self): 56 | QtWidgets.QDialog.reject(self) 57 | -------------------------------------------------------------------------------- /views/main_view.py: -------------------------------------------------------------------------------- 1 | from auri.vendor.Qt import QtWidgets, QtCore, QtGui 2 | from functools import partial 3 | 4 | from auri.auri_lib import push_button, grpbox 5 | from auri.views.script_selector_view import ScriptSelectorView 6 | 7 | 8 | class MainView(QtWidgets.QWidget): 9 | def __init__(self, main_model, main_ctrl): 10 | """ 11 | 12 | Args: 13 | main_ctrl (auri.controllers.main_controller.MainController): 14 | main_model (auri.models.main_model.MainModel): 15 | """ 16 | self.model = main_model 17 | self.main_ctrl = main_ctrl 18 | super(MainView, self).__init__() 19 | self.main_layout = QtWidgets.QVBoxLayout() 20 | self.scrollable_layout = QtWidgets.QVBoxLayout() 21 | self.scrollable_layout.addStretch(1) 22 | self.category_combobox = QtWidgets.QComboBox() 23 | self.subcategory_combobox = QtWidgets.QComboBox() 24 | self.script_selector_dialog = ScriptSelectorView(self.model.scripts, self.model) 25 | self.script_selector = push_button("Scripts", self.open_script_selector) 26 | self.add_btn = push_button("Add", partial(self.main_ctrl.add_selected_script, self)) 27 | 28 | self.main_ctrl.setup(self.category_combobox, self.subcategory_combobox, self.script_selector) 29 | self.setup_ui() 30 | 31 | def open_script_selector(self): 32 | result = self.script_selector_dialog.exec_() 33 | self.add_btn.setDisabled(self.model.add_btn_disabled) 34 | 35 | def setup_ui(self): 36 | self.setup_parts_ui() 37 | self.setup_properties_ui() 38 | self.setup_build_area() 39 | self.setLayout(self.main_layout) 40 | 41 | def setup_parts_ui(self): 42 | def create_category_combobox(): 43 | self.category_combobox.setModel(self.model.categories) 44 | self.category_combobox.currentIndexChanged.connect(self.main_ctrl.category_changed) 45 | self.category_combobox.currentIndexChanged.connect(lambda: self.add_btn.setDisabled(self.model.add_btn_disabled)) 46 | self.model.selected_category = self.category_combobox.currentText() 47 | return self.category_combobox 48 | 49 | def create_subcategory_combobox(): 50 | self.subcategory_combobox.setModel(self.model.subcategories) 51 | self.subcategory_combobox.currentIndexChanged.connect(self.main_ctrl.subcategory_changed) 52 | self.subcategory_combobox.currentIndexChanged.connect(lambda: self.add_btn.setDisabled(self.model.add_btn_disabled)) 53 | self.model.selected_subcategory = self.subcategory_combobox.currentText() 54 | return self.subcategory_combobox 55 | 56 | def create_script_selector(): 57 | return self.script_selector 58 | 59 | def create_name_textbox(): 60 | name_textbox = QtWidgets.QLineEdit() 61 | 62 | # Replace spaces with underscores 63 | def name_fixup(): 64 | old_cursor_pos = name_textbox.cursorPosition() 65 | name_textbox.setText(name_textbox.text().replace(" ", "_")) 66 | name_textbox.setCursorPosition(old_cursor_pos) 67 | 68 | name_textbox.setPlaceholderText("Name") 69 | # name_validator = QtGui.QRegExpValidator(QtCore.QRegExp("^[a-zA-Z][a-zA-Z\d#_ ]*")) 70 | # name_textbox.setValidator(name_validator) 71 | name_textbox.textChanged.connect(name_fixup) 72 | name_textbox.textChanged.connect(self.main_ctrl.name_changed) 73 | name_textbox.textChanged.connect(lambda: self.add_btn.setDisabled(self.model.add_btn_disabled)) 74 | return name_textbox 75 | 76 | def create_add_btn(): 77 | self.add_btn.setDisabled(1) 78 | return self.add_btn 79 | 80 | parts_layout = QtWidgets.QHBoxLayout() 81 | parts_grp = grpbox("Parts", parts_layout) 82 | 83 | parts_layout.addWidget(create_category_combobox()) 84 | parts_layout.addWidget(create_subcategory_combobox()) 85 | parts_layout.addWidget(create_script_selector()) 86 | parts_layout.addWidget(create_name_textbox()) 87 | parts_layout.addWidget(create_add_btn()) 88 | 89 | parts_grp.setLayout(parts_layout) 90 | self.main_layout.addWidget(parts_grp) 91 | 92 | def setup_properties_ui(self): 93 | def create_scroll_area(): 94 | scroll_area = QtWidgets.QScrollArea() 95 | scroll_area.setWidgetResizable(1) 96 | scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) 97 | scrollable_widget = QtWidgets.QWidget() 98 | scrollable_widget.setLayout(self.scrollable_layout) 99 | scroll_area.setWidget(scrollable_widget) 100 | return scroll_area 101 | 102 | properties_layout = QtWidgets.QVBoxLayout() 103 | properties_grp = grpbox("Properties", properties_layout) 104 | 105 | properties_layout.addWidget(create_scroll_area()) 106 | 107 | self.main_layout.addWidget(properties_grp) 108 | 109 | def setup_build_area(self): 110 | def create_execute_all_btn(): 111 | execute_all_btn = push_button("Execute All", self.main_ctrl.execute_all) 112 | return execute_all_btn 113 | 114 | def create_prebuild_all_btn(): 115 | prebuild_all_btn = push_button("Prebuild All", self.main_ctrl.prebuild_all) 116 | return prebuild_all_btn 117 | 118 | build_layout = QtWidgets.QHBoxLayout() 119 | build_grp = grpbox("Build", build_layout) 120 | 121 | build_layout.addWidget(create_prebuild_all_btn()) 122 | build_layout.addWidget(create_execute_all_btn()) 123 | self.main_layout.addWidget(build_grp) 124 | pass 125 | -------------------------------------------------------------------------------- /views/menubar_view.py: -------------------------------------------------------------------------------- 1 | from auri.vendor.Qt import QtWidgets 2 | from functools import partial 3 | 4 | 5 | class MenuBarView(QtWidgets.QMenuBar): 6 | def __init__(self, common_ctrl, main_ctrl): 7 | """ 8 | 9 | Args: 10 | common_ctrl (auri.controllers.common_controller.CommonController): 11 | main_ctrl (auri.controllers.main_controller.MainController): 12 | """ 13 | self.common_ctrl = common_ctrl 14 | self.main_ctrl = main_ctrl 15 | super(MenuBarView, self).__init__() 16 | 17 | file_menu = self.addMenu("&File") 18 | file_menu.addAction(self.new_project_action()) 19 | file_menu.addAction(self.open_project_action()) 20 | file_menu.addAction(self.save_project_action()) 21 | file_menu.addAction(self.save_project_as_action()) 22 | file_menu.addAction(self.import_project_action()) 23 | 24 | edit_menu = self.addMenu("&Edit") 25 | edit_menu.addAction(self.refresh_action()) 26 | edit_menu.addAction(self.prebuild_all_action()) 27 | edit_menu.addAction(self.execute_all_action()) 28 | 29 | about_menu = self.addMenu("&Help") 30 | about_menu.addAction(self.about_action()) 31 | 32 | # about_menu = self.addMenu("&About") 33 | 34 | def new_project_action(self): 35 | action = QtWidgets.QAction("&New Project", self) 36 | action.triggered.connect(self.common_ctrl.new_project) 37 | action.setShortcut("Ctrl+N") 38 | action.setStatusTip("Clear current project") 39 | return action 40 | 41 | def open_project_action(self): 42 | action = QtWidgets.QAction("&Open Project", self) 43 | action.triggered.connect(self.common_ctrl.open_project) 44 | action.setShortcut("Ctrl+O") 45 | action.setStatusTip("Open a project") 46 | return action 47 | 48 | def save_project_action(self): 49 | action = QtWidgets.QAction("&Save Project", self) 50 | action.triggered.connect(self.common_ctrl.save_project) 51 | action.setShortcut("Ctrl+S") 52 | action.setStatusTip("Save current project") 53 | return action 54 | 55 | def save_project_as_action(self): 56 | action = QtWidgets.QAction("Save Project &As", self) 57 | action.triggered.connect(self.common_ctrl.save_project_as) 58 | action.setShortcut("Ctrl+Shift+S") 59 | action.setStatusTip("Save current project as") 60 | return action 61 | 62 | def import_project_action(self): 63 | action = QtWidgets.QAction("Import Project", self) 64 | action.triggered.connect(partial(self.common_ctrl.open_project, True)) 65 | action.setShortcut("Ctrl+I") 66 | action.setStatusTip("Import & append a project to the currect project") 67 | return action 68 | 69 | def refresh_action(self): 70 | action = QtWidgets.QAction("&Refresh", self) 71 | action.triggered.connect(self.common_ctrl.refresh) 72 | action.setShortcut("Ctrl+R") 73 | action.setStatusTip("Refresh categories & scripts") 74 | return action 75 | 76 | def prebuild_all_action(self): 77 | action = QtWidgets.QAction("Pre&build All", self) 78 | action.triggered.connect(self.main_ctrl.prebuild_all) 79 | action.setShortcut("Ctrl+B") 80 | action.setStatusTip("Launch the Prebuild function of every scripts") 81 | return action 82 | 83 | def execute_all_action(self): 84 | action = QtWidgets.QAction("&Execute All", self) 85 | action.triggered.connect(self.main_ctrl.execute_all) 86 | action.setShortcut("Ctrl+E") 87 | action.setStatusTip("Launch the Execute function of every scripts") 88 | return action 89 | 90 | def about_action(self): 91 | action = QtWidgets.QAction("&About", self) 92 | action.triggered.connect(self.main_ctrl.show_about) 93 | action.setShortcut("Ctrl+Alt+A") 94 | action.setStatusTip("Show the About window") 95 | return action 96 | -------------------------------------------------------------------------------- /views/message_box_view.py: -------------------------------------------------------------------------------- 1 | from auri.vendor.Qt import QtWidgets, QtCore 2 | from auri.auri_lib import push_button, get_application, get_houdini_style 3 | 4 | 5 | class MessageBoxView(QtWidgets.QDialog): 6 | def __init__(self, window_title="Message", message="ENTER A MESSAGE"): 7 | super(MessageBoxView, self).__init__() 8 | self.setWindowTitle(window_title) 9 | self.setModal(1) 10 | self.setMinimumWidth(250) 11 | self.setMinimumHeight(150) 12 | self.main_layout = QtWidgets.QVBoxLayout() 13 | self.message = QtWidgets.QLabel(message) 14 | self.ok_btn = push_button("Ok", self.ok_pressed) 15 | self.setup_ui() 16 | if get_application() is "standalone" or get_application() is "houdini": 17 | self.setStyleSheet(get_houdini_style()) 18 | 19 | def setup_ui(self): 20 | self.main_layout.addWidget(self.message) 21 | self.main_layout.addWidget(self.ok_btn) 22 | self.setLayout(self.main_layout) 23 | 24 | def ok_pressed(self): 25 | QtWidgets.QDialog.accept(self) 26 | -------------------------------------------------------------------------------- /views/script_module_view.py: -------------------------------------------------------------------------------- 1 | from auri.vendor.Qt import QtWidgets, QtCore, QtGui 2 | from functools import partial 3 | 4 | from auri.auri_lib import grpbox, get_auri_icon 5 | 6 | 7 | class ScriptModuleView(QtWidgets.QGroupBox): 8 | def __init__(self, category, subcategory, script, module_name, main_model): 9 | """ 10 | 11 | Args: 12 | main_model (auri.models.main_model.MainModel): 13 | module_name (str): 14 | script (str): 15 | category (str): 16 | """ 17 | self.main_model = main_model 18 | self.category = category 19 | self.subcategory = subcategory 20 | self.script = script 21 | self.module_name = module_name 22 | 23 | super(ScriptModuleView, self).__init__() 24 | # Create the script module view & controller 25 | exec "import auri.scripts.{0}.{1}.{2} as the_script; reload(the_script); the_view = the_script.View(); the_ctrl = the_view.ctrl".format(category, subcategory, script) 26 | the_ctrl.model.module_name = module_name 27 | self.the_view = the_view 28 | self.model = the_ctrl.model 29 | self.the_ctrl = the_ctrl 30 | 31 | grp_title = "{0} - {1} - {2} - {3}".format(category, subcategory, script, module_name) 32 | self.setTitle(grp_title) 33 | # Create the shell to hold the view 34 | script_layout = QtWidgets.QGridLayout() 35 | self.setLayout(script_layout) 36 | 37 | # Create the basic buttons 38 | btns_layout = QtWidgets.QHBoxLayout() 39 | btns_size = QtCore.QSize(24, 24) 40 | 41 | self.fold_btn = QtWidgets.QToolButton() 42 | self.fold_btn.setText("FOLD") 43 | self.fold_btn.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum) 44 | 45 | self.up_btn = QtWidgets.QToolButton() 46 | up_icon = QtGui.QIcon() 47 | up_icon.addPixmap(QtGui.QPixmap(get_auri_icon("Arrow_Up.png"))) 48 | self.up_btn.setIcon(up_icon) 49 | self.up_btn.setIconSize(btns_size) 50 | self.up_btn.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum) 51 | 52 | self.down_btn = QtWidgets.QToolButton() 53 | down_icon = QtGui.QIcon() 54 | down_icon.addPixmap(QtGui.QPixmap(get_auri_icon("Arrow_Down.png"))) 55 | self.down_btn.setIcon(down_icon) 56 | self.down_btn.setIconSize(btns_size) 57 | self.down_btn.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum) 58 | 59 | self.edit_btn = QtWidgets.QToolButton() 60 | self.edit_btn.setText("EDIT") 61 | self.edit_btn.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum) 62 | 63 | self.duplicate_btn = QtWidgets.QToolButton() 64 | duplicate_icon = QtGui.QIcon() 65 | duplicate_icon.addPixmap(QtGui.QPixmap(get_auri_icon("Duplicate.png"))) 66 | self.duplicate_btn.setIcon(duplicate_icon) 67 | self.duplicate_btn.setIconSize(btns_size) 68 | self.duplicate_btn.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum) 69 | 70 | self.delete_btn = QtWidgets.QToolButton() 71 | delete_icon = QtGui.QIcon() 72 | delete_icon.addPixmap(QtGui.QPixmap(get_auri_icon("Delete.png"))) 73 | self.delete_btn.setIcon(delete_icon) 74 | self.delete_btn.setIconSize(btns_size) 75 | self.delete_btn.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum) 76 | 77 | 78 | # Add the buttons 79 | btns_layout.addWidget(self.fold_btn) 80 | btns_layout.addWidget(self.up_btn) 81 | btns_layout.addWidget(self.down_btn) 82 | btns_layout.addWidget(self.edit_btn) 83 | btns_layout.addWidget(self.duplicate_btn) 84 | btns_layout.addWidget(self.delete_btn) 85 | script_layout.addLayout(btns_layout, 0, 0) 86 | # Add the view 87 | script_layout.addWidget(the_view, 1, 0) 88 | 89 | def change_module_name(self, module_name=""): 90 | """ 91 | 92 | :type project_model: auri.models.project_model.ProjectModel 93 | """ 94 | grp_title = self.get_module_name() 95 | self.setTitle(grp_title) 96 | self.model.module_name = module_name 97 | self.module_name = module_name 98 | self.refresh_module_name() 99 | 100 | def refresh_module_name(self): 101 | self.module_name = self.model.module_name 102 | grp_title = self.get_module_name() 103 | self.setTitle(grp_title) 104 | 105 | def get_module_name(self): 106 | return "{0} - {1} - {2}".format(self.category, self.script, self.module_name) 107 | 108 | def get_index(self): 109 | return self.parent().layout().indexOf(self) 110 | -------------------------------------------------------------------------------- /views/script_selector_view.py: -------------------------------------------------------------------------------- 1 | import os 2 | from auri.vendor.Qt import QtWidgets, QtCore 3 | from auri.auri_lib import push_button, get_application, get_houdini_style 4 | 5 | 6 | class ScriptSelectorView(QtWidgets.QDialog): 7 | def __init__(self, scripts, main_model): 8 | """ 9 | 10 | Args: 11 | main_model (auri.models.main_model.MainModel): 12 | """ 13 | self.model = main_model 14 | self.scripts = scripts 15 | super(ScriptSelectorView, self).__init__() 16 | self.setWindowTitle("Script Selection") 17 | self.setModal(1) 18 | self.main_layout = QtWidgets.QVBoxLayout() 19 | self.script_list = QtWidgets.QListView() 20 | self.ok_btn = push_button("Ok", self.ok_pressed) 21 | self.cancel_btn = push_button("Cancel", self.cancel_pressed) 22 | self.setup_ui() 23 | if get_application() is "standalone" or get_application() is "houdini": 24 | self.setStyleSheet(get_houdini_style()) 25 | 26 | def setup_ui(self): 27 | self.script_list.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) 28 | self.script_list.setModel(self.scripts) 29 | 30 | self.main_layout.addWidget(self.script_list) 31 | self.main_layout.addWidget(self.ok_btn) 32 | self.main_layout.addWidget(self.cancel_btn) 33 | self.setLayout(self.main_layout) 34 | 35 | def ok_pressed(self): 36 | index = self.script_list.currentIndex() 37 | self.model.selected_script = os.path.splitext(index.data())[0] 38 | QtWidgets.QDialog.accept(self) 39 | 40 | def cancel_pressed(self): 41 | QtWidgets.QDialog.reject(self) 42 | 43 | def exec_(self, *args, **kwargs): 44 | # Select first item if old selection index is not valid 45 | if not self.script_list.currentIndex().isValid(): 46 | self.script_list.setCurrentIndex(self.scripts.index(0, 0)) 47 | return super(ScriptSelectorView, self).exec_() 48 | --------------------------------------------------------------------------------