Skip to content

Commit

Permalink
Update publish scripts to add stamp and correct entity linkage
Browse files Browse the repository at this point in the history
  • Loading branch information
wgergely committed Nov 1, 2023
1 parent 2b6ea48 commit dd8a2e9
Show file tree
Hide file tree
Showing 8 changed files with 268 additions and 179 deletions.
2 changes: 0 additions & 2 deletions bookmarks/common/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@
'publish': (
'publish/archive_existing',
'publish/template',
'publish/task',
'publish/copy_path',
'publish/reveal',
'publish/teams_notification',
),
}

Expand Down
28 changes: 22 additions & 6 deletions bookmarks/external/akaconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from .. import common
from .. import database
from .. import log
from ..editor import base


Expand Down Expand Up @@ -288,8 +287,8 @@ class AkaConvertWidget(base.BasePropertyEditor):
#: UI layout definition
sections = {
0: {
'name': 'Convert Image Sequence',
'icon': 'convert',
'name': 'AkaConvert',
'icon': 'studioaka',
'color': common.color(common.color_dark_background),
'groups': {
0: {
Expand Down Expand Up @@ -429,7 +428,7 @@ def save_changes(self):

self.process = QtCore.QProcess(parent=self)
self.process.readyReadStandardOutput.connect(self.read_output)
self.process.finished.connect(self.on_finished)
self.process.finished.connect(self.convert_process_finished)

self.process.setProgram(get_convert_script_path())
self.process.setArguments(args)
Expand All @@ -443,8 +442,24 @@ def read_output(self):
data = self.process.readAllStandardOutput().data().decode('utf-8')

for line in data.splitlines():
if 'Movie saved to' in line:

# Get the path to the output video
video_path = line.split('Movie saved to')[-1].strip().strip('"')

if not QtCore.QFileInfo(video_path).exists():
print(f'Could not find the output video: {video_path}')
else:
# Show the video in the files tab
common.signals.fileAdded.emit(video_path)

# Push to RV
if self.akaconvert_pushtorv_editor.isChecked():
from ..external import rv
rv.execute_rvpush_command(video_path, rv.PushAndClear)

if 'Finished' in line:
self.on_finished(0, QtCore.QProcess.NormalExit)
self.convert_process_finished(0, QtCore.QProcess.NormalExit)
return

if line.startswith('[AkaConvert Error]'):
Expand All @@ -460,7 +475,7 @@ def read_output(self):
'Converting...', body=current_progress_line.replace('[AkaConvert Info]', ''), message_type=None,
buttons=[], disable_animation=True, )

def on_finished(self, exit_code, exit_status):
def convert_process_finished(self, exit_code, exit_status):
# I don't know why, but the process doesn't terminate itself and will
# keep running in the background. So we need to terminate it manually I guess!
if exit_code != 0:
Expand All @@ -472,6 +487,7 @@ def on_finished(self, exit_code, exit_status):
common.show_message(
'Finished.', f'Conversion has finished successfully.'
)

raise RuntimeError('Finished.')

def sizeHint(self):
Expand Down
6 changes: 5 additions & 1 deletion bookmarks/external/rv.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def execute_rvpush_command(source, command):
process1.waitForFinished(7000)

# Wait 3 seconds for the process
QtCore.QThread.msleep(3000)
QtCore.QThread.msleep(2000)

# Format the command
cmd = command.format(
Expand All @@ -82,3 +82,7 @@ def execute_rvpush_command(source, command):
process2.setProcessEnvironment(env)
process2.start(cmd)
process2.waitForFinished(7000)

errors = process2.readAllStandardError().data().decode('utf-8')
if errors:
raise RuntimeError(errors)
17 changes: 13 additions & 4 deletions bookmarks/items/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,9 @@ def clickable_rectangle_event(self, event):
if shift_modifier:
# If the filter is empty we'll add a positive filter
if not filter_texts:
self.model().set_filter_text(f'"/{_text}"')
if '#' not in _text:
_text = f'"/{_text}"'
self.model().set_filter_text(_text)
self.repaint(self.rect())
return

Expand All @@ -1885,15 +1887,20 @@ def clickable_rectangle_event(self, event):
self.repaint(self.rect())
return
# If the filter has items we'll append
self.model().set_filter_text(f'{filter_text} "/{_text}"')
if '#' not in _text:
_text = f'"/{_text}"'
self.model().set_filter_text(f'{filter_text} {_text}')

self.repaint(self.rect())
return

# Alt or control modifiers toggle a negative filter
if alt_modifier or control_modifier:
# If the filter is empty we'll add a negative filter
if not filter_texts:
self.model().set_filter_text(f'--"/{_text}"')
if '#' not in _text:
_text = f'"/{_text}"'
self.model().set_filter_text(f'--{_text}')
self.repaint(self.rect())
return

Expand All @@ -1902,7 +1909,9 @@ def clickable_rectangle_event(self, event):
if _text in filter_text_element:
del filter_texts[idx]

filter_texts.append(f'--"/{_text}"')
if '#' not in _text:
_text = f'"/{_text}"'
filter_texts.append(f'--{_text}')

# add negative filter
self.model().set_filter_text(' '.join(filter_texts))
Expand Down
6 changes: 4 additions & 2 deletions bookmarks/maya/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,11 @@ def save_warning(*args):
return

if workspace_info.path().lower() not in scene_file.filePath().lower():
p = workspace_info.path()
common.show_message(
f'Looks like you are saving "{scene_file.fileName()}" outside the current project\n\n',
body=f'The current project is:\n "{workspace_info.path()}"',
f'Scene is not in the current project.',
body=f'Look like "{scene_file.fileName()}" is being saved to another project:\n"{p}"\n\n'
f'You can safely ignore this message, it\'s just a friendly reminder.',
message_type=None,
disable_animation=True
)
Expand Down
Loading

0 comments on commit dd8a2e9

Please sign in to comment.