mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fix QApp utilization and minor style changes
This commit is contained in:
parent
496a29ba99
commit
e0ff9cc04f
3 changed files with 23 additions and 23 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import os
|
||||
import sys
|
||||
from uuid import uuid4
|
||||
|
||||
from avalon import api, io, harmony
|
||||
from avalon.vendor import Qt
|
||||
|
|
@ -10,9 +9,6 @@ from pype import lib
|
|||
from pype.api import config
|
||||
|
||||
|
||||
signature = str(uuid4())
|
||||
|
||||
|
||||
def set_scene_settings(settings):
|
||||
|
||||
signature = harmony.signature("set_scene_settings")
|
||||
|
|
@ -64,9 +60,12 @@ def get_asset_settings():
|
|||
"resolutionHeight": resolution_height
|
||||
}
|
||||
|
||||
harmony_config = config.get_presets()["harmony"]["general"]
|
||||
try:
|
||||
skip_resolution_check = \
|
||||
config.get_presets()["harmony"]["general"]["skip_resolution_check"]
|
||||
except KeyError:
|
||||
skip_resolution_check = []
|
||||
|
||||
skip_resolution_check = harmony_config.get(["skip_resolution_check"], [])
|
||||
if os.getenv('AVALON_TASK') in skip_resolution_check:
|
||||
scene_data.pop("resolutionWidth")
|
||||
scene_data.pop("resolutionHeight")
|
||||
|
|
@ -86,21 +85,20 @@ def ensure_scene_settings():
|
|||
valid_settings[key] = value
|
||||
|
||||
# Warn about missing attributes.
|
||||
print("Starting new QApplication..")
|
||||
app = Qt.QtWidgets.QApplication(sys.argv)
|
||||
|
||||
message_box = Qt.QtWidgets.QMessageBox()
|
||||
message_box.setIcon(Qt.QtWidgets.QMessageBox.Warning)
|
||||
msg = "Missing attributes:"
|
||||
if invalid_settings:
|
||||
print("Starting new QApplication..")
|
||||
app = Qt.QtWidgets.QApplication.instance()
|
||||
if not app:
|
||||
app = Qt.QtWidgets.QApplication(sys.argv)
|
||||
|
||||
message_box = Qt.QtWidgets.QMessageBox()
|
||||
message_box.setIcon(Qt.QtWidgets.QMessageBox.Warning)
|
||||
msg = "Missing attributes:"
|
||||
for item in invalid_settings:
|
||||
msg += f"\n{item}"
|
||||
message_box.setText(msg)
|
||||
message_box.exec_()
|
||||
|
||||
# Garbage collect QApplication.
|
||||
del app
|
||||
|
||||
set_scene_settings(valid_settings)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import os
|
||||
import uuid
|
||||
|
||||
import clique
|
||||
import json
|
||||
|
||||
from avalon import api, harmony
|
||||
import pype.lib
|
||||
import json
|
||||
|
||||
|
||||
copy_files = """function copyFile(srcFilename, dstFilename)
|
||||
{
|
||||
|
|
@ -256,7 +254,9 @@ class BackgroundLoader(api.Loader):
|
|||
container_nodes = []
|
||||
|
||||
for layer in sorted(layers):
|
||||
file_to_import = [os.path.join(bg_folder, layer).replace("\\", "/")]
|
||||
file_to_import = [
|
||||
os.path.join(bg_folder, layer).replace("\\", "/")
|
||||
]
|
||||
|
||||
read_node = harmony.send(
|
||||
{
|
||||
|
|
@ -301,8 +301,10 @@ class BackgroundLoader(api.Loader):
|
|||
print(container)
|
||||
|
||||
for layer in sorted(layers):
|
||||
file_to_import = [os.path.join(bg_folder, layer).replace("\\", "/")]
|
||||
print(20*"#")
|
||||
file_to_import = [
|
||||
os.path.join(bg_folder, layer).replace("\\", "/")
|
||||
]
|
||||
print(20 * "#")
|
||||
print(f"FILE TO REPLACE: {file_to_import}")
|
||||
print(f"LAYER: {layer}")
|
||||
node = harmony.find_node_by_name(layer, "READ")
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class ExtractRender(pyblish.api.InstancePlugin):
|
|||
if len(collections) > 1:
|
||||
for col in collections:
|
||||
if len(list(col)) > 1:
|
||||
collection = col
|
||||
collection = col
|
||||
else:
|
||||
collection = collections[0]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue