Skip to content

Commit

Permalink
[cuesubmit] Add tooltip to display available command tokens. (#1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
KernAttila authored Aug 9, 2023
1 parent 6703e07 commit c1f335d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ public RunFrame prepareRqdRunFrame(VirtualProc proc, DispatchFrame frame) {
.replaceAll("#JOB#", frame.jobName)
.replaceAll("#FRAMESPEC#", frameSpec)
.replaceAll("#FRAME#", frame.name));
/* The special command tokens above (#ZFRAME# and others) are provided to the user in cuesubmit.
* see: cuesubmit/cuesubmit/Constants.py
* Update the Constant.py file when updating tokens here, they will appear in the cuesubmit tooltip popup.
*/

frame.uid.ifPresent(builder::setUid);

Expand Down
13 changes: 13 additions & 0 deletions cuesubmit/cuesubmit/Constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@
BLENDER_RENDER_CMD = config.get('BLENDER_RENDER_CMD', 'blender')
FRAME_TOKEN = config.get('FRAME_TOKEN', '#IFRAME#')

# Tokens are replaced by cuebot during dispatch with their computed value.
# see: cuebot/src/main/java/com/imageworks/spcue/dispatcher/DispatchSupportService.java
# Update this file when updating tokens in cuebot, they will appear in the cuesubmit tooltip popup.
COMMAND_TOKENS = {'#ZFRAME#': 'Current frame with a padding of 4',
'#IFRAME#': 'Current frame',
'#FRAME_START#': 'First frame of chunk',
'#FRAME_END#': 'Last frame of chunk',
'#FRAME_CHUNK#': 'Chunk size',
'#FRAMESPEC#': 'Full frame range',
'#LAYER#': 'Name of the Layer',
'#JOB#': 'Name of the Job',
'#FRAME#': 'Name of the Frame'
}
BLENDER_FORMATS = ['', 'AVIJPEG', 'AVIRAW', 'BMP', 'CINEON', 'DPX', 'EXR', 'HDR', 'IRIS', 'IRIZ',
'JP2', 'JPEG', 'MPEG', 'MULTILAYER', 'PNG', 'RAWTGA', 'TGA', 'TIFF']
BLENDER_OUTPUT_OPTIONS_URL = \
Expand Down
8 changes: 4 additions & 4 deletions cuesubmit/cuesubmit/ui/Command.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from PySide2 import QtCore, QtWidgets

from cuesubmit.ui import Widgets
from cuesubmit import Constants


class CueCommandWidget(Widgets.CueHelpWidget):
Expand Down Expand Up @@ -69,11 +70,10 @@ def __init__(self, *args, **kwargs):
self.commandBox.setAccessibleName('commandBox')
self.horizontalLine = Widgets.CueHLine()
self.setFixedHeight(120)
tokensToolTip = '\n'.join([' {0} -- {1}'.format(token, info)
for token, info in Constants.COMMAND_TOKENS.items()])
self.commandBox.setToolTip('Enter the command to be run. Valid replacement tokens are:\n'
' #IFRAME# -- frame number\n'
' #LAYER# -- layer name\n'
' #JOB# -- job name\n'
' #FRAME# -- frame name')
+ tokensToolTip)
self.setupUi()

def setupUi(self):
Expand Down

0 comments on commit c1f335d

Please sign in to comment.