Merge branch 'develop' of github.com:pypeclub/OpenPype into feature/OP-3908_Make-New-Publisher-default-in-Photoshop

This commit is contained in:
Petr Kalis 2022-11-02 12:00:26 +01:00
commit a73318474c
3 changed files with 43 additions and 28 deletions

View file

@ -7,7 +7,12 @@ import json
import platform
import uuid
import re
from Deadline.Scripting import RepositoryUtils, FileUtils, DirectoryUtils
from Deadline.Scripting import (
RepositoryUtils,
FileUtils,
DirectoryUtils,
ProcessUtils,
)
def get_openpype_version_from_path(path, build=True):
@ -162,9 +167,8 @@ def inject_openpype_environment(deadlinePlugin):
print(">>> Temporary path: {}".format(export_url))
args = [
exe,
"--headless",
'extractenvironments',
"extractenvironments",
export_url
]
@ -188,15 +192,18 @@ def inject_openpype_environment(deadlinePlugin):
if not os.environ.get("OPENPYPE_MONGO"):
print(">>> Missing OPENPYPE_MONGO env var, process won't work")
env = os.environ
env["OPENPYPE_HEADLESS_MODE"] = "1"
env["AVALON_TIMEOUT"] = "5000"
os.environ["AVALON_TIMEOUT"] = "5000"
print(">>> Executing: {}".format(" ".join(args)))
std_output = subprocess.check_output(args,
cwd=os.path.dirname(exe),
env=env)
print(">>> Process result {}".format(std_output))
args_str = subprocess.list2cmdline(args)
print(">>> Executing: {} {}".format(exe, args_str))
process = ProcessUtils.SpawnProcess(
exe, args_str, os.path.dirname(exe)
)
ProcessUtils.WaitForExit(process, -1)
if process.ExitCode != 0:
raise RuntimeError(
"Failed to run OpenPype process to extract environments."
)
print(">>> Loading file ...")
with open(export_url) as fp:

View file

@ -225,6 +225,12 @@ class PublisherWindow(QtWidgets.QDialog):
# Floating publish frame
publish_frame = PublishFrame(controller, self.footer_border, self)
# Timer started on show -> connected to timer counter
# - helps to deffer on show logic by 3 event loops
show_timer = QtCore.QTimer()
show_timer.setInterval(1)
show_timer.timeout.connect(self._on_show_timer)
errors_dialog_message_timer = QtCore.QTimer()
errors_dialog_message_timer.setInterval(100)
errors_dialog_message_timer.timeout.connect(
@ -329,7 +335,6 @@ class PublisherWindow(QtWidgets.QDialog):
# forin init
self._reset_on_first_show = reset_on_show
self._reset_on_show = True
self._restart_timer = None
self._publish_frame_visible = None
self._error_messages_to_show = collections.deque()
@ -337,6 +342,9 @@ class PublisherWindow(QtWidgets.QDialog):
self._set_publish_visibility(False)
self._show_timer = show_timer
self._show_counter = 0
@property
def controller(self):
return self._controller
@ -347,17 +355,7 @@ class PublisherWindow(QtWidgets.QDialog):
self._first_show = False
self._on_first_show()
if not self._reset_on_show:
return
self._reset_on_show = False
# Detach showing - give OS chance to draw the window
timer = QtCore.QTimer()
timer.setSingleShot(True)
timer.setInterval(1)
timer.timeout.connect(self._on_show_restart_timer)
self._restart_timer = timer
timer.start()
self._show_timer.start()
def resizeEvent(self, event):
super(PublisherWindow, self).resizeEvent(event)
@ -374,11 +372,21 @@ class PublisherWindow(QtWidgets.QDialog):
self.setStyleSheet(style.load_stylesheet())
self._reset_on_show = self._reset_on_first_show
def _on_show_restart_timer(self):
"""Callback for '_restart_timer' timer."""
def _on_show_timer(self):
# Add 1 to counter until hits 2
if self._show_counter < 3:
self._show_counter += 1
return
self._restart_timer = None
self.reset()
# Stop the timer
self._show_timer.stop()
# Reset counter when done for next show event
self._show_counter = 0
# Reset if requested
if self._reset_on_show:
self._reset_on_show = False
self.reset()
def closeEvent(self, event):
self.save_changes()

View file

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring Pype version."""
__version__ = "3.14.7-nightly.1"
__version__ = "3.14.7-nightly.2"