Icon

    This is the documentation for for an older version of Qube.

    Documentation for the latest release is available here.

    Command Line Usage

    Submission dialogs can be launched from ArtistView's "Submit" pulldown menu or directly from the command line.  When launched from the command line, the UI can be populated with values based on command line options. This is the method employed by our in-app submission UIs.

    Basic usage

    Next to the executable for qubeArtistView exists an executable called qubeSubmission[_console.exe].  Based on the OS, the default path is:

    • Windows:C:\Program Files\pfx\qube\qubeArtistView\qubeSubmission_console.exe
    • OS X:/Applications/pfx/qube/qubeArtistView.app/Contents/MacOS/qubeSubmission
    • Linux: /usr/local/pfx/qube/qubeArtistView/qubeSubmission


    Windows only

    Icon

    On Windows' terminal or in batch files, qubeSubmission_console.exe must be used so that the app is run in the foreground, and the standard out/err messages are properly output to the terminal.

     

    To launch an empty submission dialog, you must let the executable know which submission dialog to display.  This is done through the --submitType command line option:

    You can query the executable for a list of available submitTypes. Before jumping into the query, let's look at qubeSubmission's help screen by running qubeSubmission --help...

    Overview of command line options

    QubeSubmission's help screen can be seen by running qubeSubmission --help.

    Getting a list of available submission dialogs

    To launch a submission dialog from the command line, one must know the submission type.  A list of submission types can be seen as follows:

    To launch a submission UI, use the submission UI's "name" as the argument to --submitType.  For example, to launch an empty "Cinema 4D Cross-Platform BatchRender" submission dialog, you would run:

    Pre-populating a submission dialog with values

    Values can be pre-populated into any field via command line options. When bringing up a pre-populated submission dialog, submitType will be encoded into the key-value pairs, therefore --submitType need not be used. qubeSubmission accepts key-value pairs through the following options:

    • --submitDict: string representation of a Python dictionary
    • --submitPkl: path to a temporary Python pickle file. Note that the file will be deleted after successful submission
    • --submitJSON: path to a temporary JSON file. Note that the file will be deleted after successful submission
    • --submitDictFile: path to a temporary text file that contains the string representation of a python dictionary. Note that the file will be deleted after successful submission

    Note that any of the above options can be used multiple times in the same command.  Doing so would present a submission dialog for each --submit*.

    Finding the keys

    To determine which keys apply to which fields in which submission types, use the --fields option:

    "Field Arg" should be used as the key when available. If there is no field arg, then "Field Name" is used. The value given, then, will be used to populate the field in the UI (assuming that the value has not been mandated by preferences) that matches the field arg or field name.

    For example, to launch a maya_jobtype submission dialog, pre-populated with a frame range of 1-100, a retry count of 5, a scene file of /path/to/scenefile.mb, and to explicitly set the renderer to Mental Ray, you would use the key/value pairs:

    Note that for the last setting, 'defaultRenderGlobals.currentRenderer', we are using the field arg rather than the field name.  When a field arg is available, it must be used; but if it is not, as is the case with 'retrywork', 'range', and 'scenefile', then the field name is used.

    Note that 'retrywork' is the only item in the root of the dictionary, while 'range', 'scenefile', and 'defaultRenderGlobals.currentRenderer' are in the dictionary's 'package'. To determine which keys go into the root and which go into 'package', look at the "Destination" column in the output of fields.  If the destination is "job," then the associated key is used in the root of the dictionary.  If the destination is "job.package," then the associated key is used in the dictionary's 'package'.  When in doubt, use the dictionary's package.

    Using key/value pairs on the command line

    Now that we know which key/value pairs to use, and where they should be within the submission dictionary, we need to get that dictionary to the submission UI. This can be done using one of the following command-line option arguments:

    • submitDict: as a string representation of a Python dictionary
    • submitPkl: as a Python dictionary pickled to a file
    • submitJSON: as a JSON dictionary saved to a file
    • submitDictFile: as the string representation of a Python dictionary written to a text file

    In the following examples, we will be using a maya_jobtype submission dialog with the name, instances(cpus), frame range, and scene file fields populated from the command line.

    submitDict Example

    submitDict uses the string representation of a Python dictionary directly on the command line.  One must be mindful of quotes - being a command line argument, the dictionary must be a single, quoted string, so any quotes within the string must be escaped.  This can become especially difficult when the command is being generated by a program (i.e. Maya) where both the quotes and the quotes' escape characters must be escaped.

    Note that we're using two different types of quotes - double quotes for the argument and single quotes within the argument.  Were we to use the same quotes throughout, we would need to escape those within the argument:

    submitDictFile example

    For applications that do not provide a Python or JSON interface but can write text, there exists a submitDictFile option which will evaluate the contents of a passed in file as Python dictionary. One might find this advantageous over --submitDict being that there won't be the same quoting issues due to the fact that there is no command-line evaluation. In this example, we'll use Python to create the text file, but any application that can write text to a file would suffice.

    submitPkl example

    Assuming one can launch the submission dialog from a Python interpreter, submitPkl is a more powerful/useful option.

    submitJSON example

    For applications that do not provide a python interface and/or applications that can write JSON, there exists a submitJSON option which will ingest JSON files. In this example, we'll use Python to create the JSON file, but any application that can write JSON would suffice

    Icon

    See Creating Custom Submission Scripts for instructions on how to create your own, custom submission dialogs which can then be called as described above.

    • No labels