def __main__(*args):
    global scriptDialog
    global settings
    global defaultLocation
    global outputBox
    global sceneBox
    global jobOptions_dialog

    defaultLocation = ""

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit Command Line Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('CommandLine'))

    jobOptions_dialog = JobOptionsUI.JobOptionsDialog(
        parentAppName="CommandLineMonitor")

    scriptDialog.AddScriptControl("JobOptionsDialog", jobOptions_dialog, "")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Command Line Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("JobTypeLabel", "LabelControl", "Job Type",
                                  1, 0, "Choose a normal or maintenance job.",
                                  False)
    jobTypeBox = scriptDialog.AddComboControlToGrid("JobTypeBox",
                                                    "ComboControl", "Normal",
                                                    ("Normal", "Maintenance"),
                                                    1, 1)
    jobTypeBox.ValueModified.connect(jobTypeChanged)
    singleFramesBox = scriptDialog.AddSelectionControlToGrid(
        "SingleFramesOnlyBox", "CheckBoxControl", False, "Single Frames Only",
        1, 2,
        "If enabled, the CommandLine plugin will only render one frame at a time even if a single task contains a chunk of frames."
    )
    singleFramesBox.ValueModified.connect(singleFramesChanged)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  2, 0,
                                  "The list of frames for the normal job.",
                                  False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", "", 2, 1)
    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 2, 2,
        "This is the number of frames that will be rendered at a time for each job task.",
        False)
    scriptDialog.AddRangeControlToGrid("ChunkSizeBox", "RangeControl", 1, 1,
                                       1000000, 0, 1, 2, 3)

    scriptDialog.AddControlToGrid("StartFrameLabel", "LabelControl",
                                  "Start Frame", 3, 0,
                                  "The first frame for the maintenance job.",
                                  False)
    scriptDialog.AddRangeControlToGrid("StartFrameBox", "RangeControl", 0,
                                       -1000000, 1000000, 0, 1, 3, 1)
    scriptDialog.AddControlToGrid("EndFrameLabel", "LabelControl", "End Frame",
                                  3, 2,
                                  "The last frame for the maintenance job.",
                                  False)
    scriptDialog.AddRangeControlToGrid("EndFrameBox", "RangeControl", 0,
                                       -1000000, 1000000, 0, 1, 3, 3)

    scriptDialog.AddControlToGrid("ExecutableLabel", "LabelControl",
                                  "Executable", 4, 0,
                                  "The Executable to use for rendering.",
                                  False)
    scriptDialog.AddSelectionControlToGrid("ExecBox",
                                           "FileBrowserControl",
                                           "",
                                           "All Files (*)",
                                           4,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "ArgsLabel", "LabelControl", "Arguments (optional)", 5, 0,
        "The command line arguments to be submitted.")
    scriptDialog.AddControlToGrid("ArgsBox",
                                  "TextControl",
                                  "",
                                  5,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "SpacerLabel", "LabelControl", "Argument Tags", 6, 0,
        "Use these buttons to add tags to the arguments.", False)
    startFButton = scriptDialog.AddControlToGrid(
        "StartFButton", "ButtonControl", "Start Frame Tag", 6, 1,
        'Adds a Start Frame tag to the arguments.')
    endFButton = scriptDialog.AddControlToGrid(
        "EndFButton", "ButtonControl", "End Frame Tag", 6, 2,
        'Adds an End Frame tag to the arguments.')
    quoteButton = scriptDialog.AddControlToGrid(
        "QuoteButton", "ButtonControl", "Quote Tag", 6, 3,
        'Adds a Quote tag to the arguments.')

    scriptDialog.AddControlToGrid(
        "FramePaddingLabel", "LabelControl", "Frame Tag Padding", 7, 0,
        "Controls the amount of frame padding for the Start Frame and End Frame tags.",
        False)
    scriptDialog.AddRangeControlToGrid("FramePaddingBox", "RangeControl", 0, 0,
                                       10, 0, 1, 7, 1)
    shellExecute = scriptDialog.AddSelectionControlToGrid(
        "ShellExecuteBox", "CheckBoxControl", False, "Execute In Shell", 7, 2,
        "If enabled, the specified argument(s) will be executed through the current shell."
    )
    shellExecute.ValueModified.connect(ShellExecuteButtonPressed)
    scriptDialog.AddComboControlToGrid(
        "ShellToUseBox", "ComboControl", "default",
        ["default", "bash", "csh", "ksh", "sh", "tcsh", "zsh", "cmd"], 7, 3)

    scriptDialog.AddControlToGrid(
        "StartupLabel", "LabelControl", "Start Up Folder (optional)", 8, 0,
        "The directory that the command line will start up in.", False)
    scriptDialog.AddSelectionControlToGrid("StartupBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           8,
                                           1,
                                           colSpan=3,
                                           browserLocation=defaultLocation)
    startFButton.ValueModified.connect(startFPressed)
    endFButton.ValueModified.connect(endFPressed)
    quoteButton.ValueModified.connect(quotePressed)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 0)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 1,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)

    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                2,
                                                expand=False)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    closeButton.ValueModified.connect(jobOptions_dialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ("FramesBox", "ChunkSizeBox", "ExecBox", "ArgsBox",
                "StartupBox", "ShellExecuteBox", "ShellToUseBox",
                "SingleFramesOnlyBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    jobTypeChanged(None)
    ShellExecuteButtonPressed(None)

    scriptDialog.ShowDialog(True)
def __main__(*args):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    global jobOptions_dialog

    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle("Submit Anime Studio/Moho Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('AnimeStudio'))

    scriptDialog.AddTabControl("Tabs", 0, 0)

    scriptDialog.AddTabPage("Job Options")

    jobOptions_dialog = JobOptionsUI.JobOptionsDialog()

    scriptDialog.AddScriptControl(jobOptions_dialog)

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Anime Studio/Moho Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl",
                                  "Anime Studio/Moho File", 1, 0,
                                  "The scene file to be rendered.", False)
    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Anime Studio/Moho Files (*.anme *.anime *.animeproj *.moho *.mohoproj);;All Files (*)",
        1,
        1,
        colSpan=2)
    sceneBox.ValueModified.connect(SceneBoxChanged)

    scriptDialog.AddControlToGrid("OutputLabel", "LabelControl", "Output File",
                                  2, 0, "The output path to render to.", False)
    outputBox = scriptDialog.AddSelectionControlToGrid(
        "OutputBox",
        "FileSaverControl",
        "",
        "JPEG (*.jpg);;BMP (*.bmp);;Targa (*.tga);;PNG (*.png);;PSD (*.psd);;MP4 (*.mp4);;iPhone/iPad Movie (*.m4v);;AVI (*.avi);;QuickTime Movie (*.mov);;Flash (*.swf);;Animated GIF (*.gif)",
        2,
        1,
        colSpan=2)
    outputBox.ValueModified.connect(OutputBoxChanged)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  3, 0, "The list of frames to render.", False)
    scriptDialog.AddControlToGrid("FramesBox",
                                  "TextControl",
                                  "",
                                  3,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 4, 0,
        "This is the number of frames that will be rendered at a time for each job task. ",
        False)
    scriptDialog.AddRangeControlToGrid("ChunkSizeBox", "RangeControl", 1, 1,
                                       1000000, 0, 1, 4, 1)
    scriptDialog.AddSelectionControlToGrid(
        "FormatSuffixBox", "CheckBoxControl", False, "Add Format Suffix", 4, 2,
        "If this option is enabled, the format name will be appended to the file name of the output path. Version 9.5 and later."
    )

    scriptDialog.AddControlToGrid(
        "VersionLabel", "LabelControl", "Version", 5, 0,
        "The version of Anime Studio (Moho) to render with.", False)
    versionBox = scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "10",
        ("8", "9", "9.5", "10", "11", "12"), 5, 1)
    versionBox.ValueModified.connect(VersionChanged)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", False,
        "Submit Anime Studio/Moho Scene File With Job", 5, 2,
        "If this option is enabled, the scene file will be submitted with the job, and then copied locally to the slave machine during rendering."
    )

    scriptDialog.AddControlToGrid(
        "LayerCompLabel", "LabelControl", "Layer Comp", 6, 0,
        "Render a specific layer comp, or select All to render all layer comps to separate files.",
        False)
    layerCompBox = scriptDialog.AddComboControlToGrid("LayerCompBox",
                                                      "ComboControl", "",
                                                      ("", "All"), 6, 1)
    layerCompBox.ValueModified.connect(LayerCompChanged)

    enableFasterParsingBox = scriptDialog.AddSelectionControlToGrid(
        "EnableFasterParsingBox", "CheckBoxControl", False,
        "Enable Faster Scene File Parsing", 6, 2,
        "If this option is enabled, a faster, but experimental, method is used to parse the scene file."
    )

    addLayerCompSuffixBox = scriptDialog.AddSelectionControlToGrid(
        "AddLayerCompSuffixBox", "CheckBoxControl", False,
        "Add Layer Comp Suffix", 7, 2,
        "If this option is enabled, adds a layer comp suffix to the rendered file name(s)."
    )
    createFolderForLayerCompsBox = scriptDialog.AddSelectionControlToGrid(
        "CreateFolderForLayerCompsBox", "CheckBoxControl", False,
        "Create Folder for Layer Comps", 8, 2,
        "If this option is enabled, the rendered file(s) will be created in a subfolder of the output path. The subfolder's name will be the layer comp name."
    )

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Additional Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator6",
                                  "SeparatorControl",
                                  "Rendering Options",
                                  0,
                                  0,
                                  colSpan=2)

    scriptDialog.AddSelectionControlToGrid(
        "AntialiasedBox", "CheckBoxControl", True, "Antialiased Edges", 1, 0,
        "Normally, Anime Studio/Moho renders your shapes with smoothed edges. Uncheck this box to turn this feature off."
    )
    scriptDialog.AddSelectionControlToGrid(
        "ReducedParticlesBox", "CheckBoxControl", False, "Reduced Particles",
        1, 1,
        "Some particle effects require hundreds of particles to achieve their effect. Check this box to render fewer particles. The effect may not look as good, but will render much faster if all you need is a preview."
    )

    scriptDialog.AddSelectionControlToGrid(
        "ShapeEffectsBox", "CheckBoxControl", True, "Apply Shape Effects", 2,
        0,
        "If this box is unchecked, Anime Studio/Moho will skip shape effects like shading, texture fills, and gradients."
    )
    scriptDialog.AddSelectionControlToGrid(
        "ExtraSmoothBox", "CheckBoxControl", True, "Extra-smooth Images", 2, 1,
        "Renders image layers with a higher quality level. Exporting takes longer with this option on."
    )

    scriptDialog.AddSelectionControlToGrid(
        "LayerEffectsBox", "CheckBoxControl", True, "Apply Layer Effects", 3,
        0,
        "If this box is unchecked, Anime Studio/Moho will skip layer effects like layer shadows and layer transparency."
    )
    scriptDialog.AddSelectionControlToGrid(
        "NtscSafeColorsBox", "CheckBoxControl", False, "Use NTSC-safe Colors",
        3, 1,
        "Automatically limits colors to be NTSC safe. This is only an approximation - you should still do some testing to make sure your animation looks good on a TV monitor."
    )

    scriptDialog.AddSelectionControlToGrid(
        "HalfSizeBox", "CheckBoxControl", False, "Render At Half Dimensions",
        4, 0,
        "Check this box to render a smaller version of your movie. This makes rendering faster if you just want a quick preview, and is useful for making smaller movies for the web."
    )
    scriptDialog.AddSelectionControlToGrid(
        "NoPremultiplyBox", "CheckBoxControl", False,
        "Do Not Premultiply Alpha Channel", 4, 1,
        "Useful if you plan to composite your Anime Studio/Moho animation with other elements in a video editing program."
    )

    scriptDialog.AddSelectionControlToGrid(
        "HalfFrameRateBox", "CheckBoxControl", False,
        "Render At Half Frame Rate", 5, 0,
        "Check this box to skip every other frame in the animation. This makes rendering faster, and results in smaller movie files."
    )
    #scriptDialog.AddSelectionControlToGrid("MultiThreadedBox","CheckBoxControl",True,"Enable Multi-threaded Rendering", 5, 1, "Enable multithreaded rendering.")
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("QTSeparator",
                                  "SeparatorControl",
                                  "QT Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "VideoCodecLabel", "LabelControl", "Video Codec (Optional)", 1, 0,
        "The video codec (leave blank to not specify one). Version 10 and later.",
        False)
    scriptDialog.AddControlToGrid("VideoCodecBox",
                                  "TextControl",
                                  "",
                                  1,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "QualityLabel", "LabelControl", "Quality", 2, 0,
        "The quality of the export. Version 10 and later. 0 = Minimum, 1 = Low, 2 = Normal, 3 = High, 4 = Max, 5 = Lossless",
        False)
    scriptDialog.AddComboControlToGrid("QualityBox",
                                       "ComboControl",
                                       "3", ("0", "1", "2", "3", "4", "5"),
                                       2,
                                       1,
                                       expand=False)

    scriptDialog.AddControlToGrid(
        "DepthLabel", "LabelControl", "Depth", 3, 0,
        "The pixel depth of the export. Version 10 and later.", False)
    scriptDialog.AddComboControlToGrid("DepthBox",
                                       "ComboControl",
                                       "24", ("24", "32"),
                                       3,
                                       1,
                                       expand=False)

    scriptDialog.AddControlToGrid("M4VSeparator",
                                  "SeparatorControl",
                                  "iPhone/iPad Movie Options",
                                  4,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("M4VLabel", "LabelControl", "Format", 5, 0,
                                  "The available formats for m4v movies.",
                                  False)
    scriptDialog.AddComboControlToGrid(
        "M4VBox",
        "ComboControl",
        "iPhone Movie (480x320)",
        ("iPhone Movie (480x320)", "iPhone 4 Movie (960x640)",
         "iPhone 5 Movie (1136x640)", "iPad Movie (1024x768)",
         "iPad HD Movie (1280x1024)"),
        5,
        1,
        expand=False)

    scriptDialog.AddControlToGrid("AVISeparator",
                                  "SeparatorControl",
                                  "AVI Options",
                                  6,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("AVILabel", "LabelControl", "Format", 7, 0,
                                  "The available formats for avi movies.",
                                  False)
    scriptDialog.AddComboControlToGrid(
        "AVIBox",
        "ComboControl",
        "AVI Movie",
        ("AVI Movie", "AVI Movie (DV) (720x480)", "AVI Movie (Uncompressed)"),
        7,
        1,
        expand=False)

    scriptDialog.AddControlToGrid("SWFSeparator",
                                  "SeparatorControl",
                                  "SWF Options",
                                  8,
                                  0,
                                  colSpan=3)
    scriptDialog.AddSelectionControlToGrid(
        "VariableLineWidthsBox", "CheckBoxControl", False,
        "Variable Line Widths", 9, 0, "Exports variable line widths to SWF.")
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "AnimeStudioMonitor",
                                          DraftRequested,
                                          ProjectManagementOptions,
                                          failOnNoTabs=False)

    scriptDialog.EndTabControl()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 0)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 1,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                2,
                                                expand=False)
    # Make sure all the project management connections are closed properly
    closeButton.ValueModified.connect(
        integration_dialog.CloseProjectManagementConnections)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ("SceneBox", "FramesBox", "ChunkSizeBox", "VersionBox",
                "OutputBox", "SubmitSceneBox", "AntialiasedBox",
                "ShapeEffectsBox", "LayerEffectsBox", "HalfSizeBox",
                "HalfFrameRateBox", "ReducedParticlesBox", "ExtraSmoothBox",
                "NtscSafeColorsBox", "NoPremultiplyBox",
                "VariableLineWidthsBox", "VideoCodecBox", "QualityBox",
                "DepthBox", "FormatSuffixBox", "M4VBox", "AVIBox",
                "MultiThreadedBox", "EnableFasterParsingBox")
    settings.extend(jobOptions_dialog.getSettingsNames())
    print(jobOptions_dialog.getSettingsNames())
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    SceneBoxChanged(None)
    OutputBoxChanged(None)
    VersionChanged(None)

    scriptDialog.ShowDialog(False)
Пример #3
0
def __main__(*args):
    global scriptDialog
    global settings
    global CommandBox
    global jobOptions_dialog

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit Command Script Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('CommandScript'))

    jobOptions_dialog = JobOptionsUI.JobOptionsDialog(
        parentAppName="CommandScriptMonitor")

    scriptDialog.AddScriptControl("JobOptionsDialog", jobOptions_dialog, "")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Command Script Options",
                                  0,
                                  0,
                                  colSpan=6)

    scriptDialog.AddControlToGrid(
        "CommandsLabel",
        "LabelControl",
        "Commands to Execute: 0",
        1,
        0,
        "Specify a list of commands to execute, one commmand per line.",
        colSpan=6)

    InsertFileButton = scriptDialog.AddControlToGrid(
        "InsertFileButton", "ButtonControl", "Insert File Path", 2, 0,
        "Insert a file path at the current cursor location.", False)
    InsertFileButton.ValueModified.connect(InsertFilePressed)

    InsertFolderButton = scriptDialog.AddControlToGrid(
        "InsertFolderButton", "ButtonControl", "Insert Folder Path", 2, 1,
        "Insert a folder path at the current cursor location.", False)
    InsertFolderButton.ValueModified.connect(InsertFolderPressed)

    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 2, 2)

    LoadButton = scriptDialog.AddControlToGrid(
        "LoadButton",
        "ButtonControl",
        "Load",
        row=2,
        column=3,
        tooltip="Load a list of commands from a file.",
        expand=False)
    LoadButton.ValueModified.connect(LoadPressed)

    SaveButton = scriptDialog.AddControlToGrid(
        "SaveButton",
        "ButtonControl",
        "Save",
        row=2,
        column=4,
        tooltip="Save the current list of commands to a file.",
        expand=False)
    SaveButton.ValueModified.connect(SavePressed)

    ClearButton = scriptDialog.AddControlToGrid(
        "ClearButton",
        "ButtonControl",
        "Clear",
        row=2,
        column=5,
        tooltip="Clear the current list of commands.",
        expand=False)
    ClearButton.ValueModified.connect(ClearPressed)
    scriptDialog.EndGrid()
    scriptDialog.AddGrid()
    CommandBox = scriptDialog.AddControlToGrid("CommandsBox",
                                               "MultiLineTextControl",
                                               "",
                                               0,
                                               0,
                                               colSpan=4)
    CommandBox.ValueModified.connect(CommandsChanged)

    scriptDialog.AddControlToGrid(
        "StartupLabel", "LabelControl", "Startup Directory", 1, 0,
        "The directory where each command will startup (optional).", False)
    scriptDialog.AddSelectionControlToGrid("StartupBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           1,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Commands Per Task", 2, 0,
        "This is the number of commands that will be rendered at a time for each job task.",
        False)
    scriptDialog.AddRangeControlToGrid("ChunkSizeBox",
                                       "RangeControl",
                                       1,
                                       1,
                                       1000000,
                                       0,
                                       1,
                                       2,
                                       1,
                                       expand=False)
    shellExecute = scriptDialog.AddSelectionControlToGrid(
        "ShellExecuteBox", "CheckBoxControl", False, "Execute In Shell", 2, 2,
        "If enabled, the specified command(s) will be executed through the current shell."
    )
    shellExecute.ValueModified.connect(ShellExecuteButtonPressed)
    scriptDialog.AddComboControlToGrid(
        "ShellToUseBox", "ComboControl", "default",
        ["default", "bash", "csh", "ksh", "sh", "tcsh", "zsh", "cmd"], 2, 3)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer2", 0, 0)

    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 1,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)

    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                2,
                                                expand=False)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    closeButton.ValueModified.connect(jobOptions_dialog.closeEvent)

    scriptDialog.EndGrid()

    settings = ("ChunkSizeBox", "StartupBox", "ShellExecuteBox",
                "ShellToUseBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    CommandsChanged(None)
    ShellExecuteButtonPressed(None)

    scriptDialog.ShowDialog(True)
Пример #4
0
def __main__(*args):
    global scriptDialog
    global settings
    global jobOptionsDialog
    global frameList
    global framesPerTask
    global submittedFromMonitor
    global imageRender
    global outputFile
    global rndFileName

    submittedFromMonitor = not bool(args)

    if not submittedFromMonitor:
        rndFileName = args[0]
        rndName = args[1]
        frameRange = args[2]
        # there's no way to detect an image render if submitted through the monitor, so initialize it here
        # videos will say Movie.dev and Mistika files will say Xfs.dev
        imageRender = args[3] == "Disk.dev"
        outputFile = args[4]

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit Mistika VR Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon("MistikaVR"))

    jobOptionsDialog = JobOptionsUI.JobOptionsDialog(
        parentAppName="MistikaVRMonitor")

    scriptDialog.AddScriptControl("JobOptionsDialog", jobOptionsDialog, "")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator1",
                                  "SeparatorControl",
                                  "Mistika VR Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "Mistika File",
                                  1, 0, "The Mistika file to be rendered.",
                                  False)
    scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Mistika Render Files (*.rnd);;All Files (*)",
        1,
        1,
        colSpan=3)

    imageBox = scriptDialog.AddSelectionControlToGrid(
        "ImageBox", "CheckBoxControl", False, "Image Render", 2, 1,
        "Check this box if the selected .rnd file corresponds to an image sequence render."
    )
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox",
        "CheckBoxControl",
        False,
        "Submit Mistika File With The Job",
        2,
        2,
        "If this option is enabled, the Mistika render file will be submitted with the job, and then copied locally to the Slave machine during rendering.",
        colSpan=2)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  3, 0, "The list of frames to render.", False)
    framesBox = scriptDialog.AddControlToGrid("FramesBox", "TextControl", "",
                                              3, 1)
    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 3, 2,
        "This is the number of frames that will be rendered at a time for each job task.",
        False)
    chunkSizeBox = scriptDialog.AddRangeControlToGrid("ChunkSizeBox",
                                                      "RangeControl", 1, 1,
                                                      1000000, 0, 1, 3, 3)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 0)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 1,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)

    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                2,
                                                expand=False)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    closeButton.ValueModified.connect(jobOptionsDialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ("FramesBox", "SubmitSceneBox", "ChunkSizeBox", "ImageBox",
                "SceneBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    frameList = scriptDialog.GetValue("FramesBox")
    framesPerTask = scriptDialog.GetValue("ChunkSizeBox")

    # if submitting through Mistika VR then populate some fields
    if not submittedFromMonitor:
        jobOptionsDialog.SetValue("NameBox", rndName)
        scriptDialog.SetValue("SceneBox", rndFileName)
        scriptDialog.SetEnabled("ImageBox", False)

        if imageRender:
            scriptDialog.SetValue("ImageBox", True)
            # do this so the integrated submitter will have the frame range specified in Mistika when it appears
            frameList = frameRange
        else:
            scriptDialog.SetValue("ImageBox", False)

    ImageBoxChanged()

    # set the callbacks here so they don't get triggered when filling in the values initially
    imageBox.ValueModified.connect(ImageBoxChanged)
    framesBox.ValueModified.connect(FramesBoxChanged)
    chunkSizeBox.ValueModified.connect(ChunkSizeBoxChanged)

    scriptDialog.ShowDialog(True)
Пример #5
0
def __main__(*args):
    global scriptDialog
    global settings
    global jobOptions_dialog

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit Python Script To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('Python'))

    jobOptions_dialog = JobOptionsUI.JobOptionsDialog(
        parentAppName="PythonMonitor")

    scriptDialog.AddScriptControl("JobOptionsDialog", jobOptions_dialog, "")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Python Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("JobTypeLabel", "LabelControl", "Job Type",
                                  1, 0, "Choose a normal or maintenance job.",
                                  False)
    jobTypeBox = scriptDialog.AddComboControlToGrid("JobTypeBox",
                                                    "ComboControl", "Normal",
                                                    ("Normal", "Maintenance"),
                                                    1, 1)
    jobTypeBox.ValueModified.connect(jobTypeChanged)
    singleFramesBox = scriptDialog.AddSelectionControlToGrid(
        "SingleFramesOnlyBox", "CheckBoxControl", False, "Single Frames Only",
        1, 2,
        "If enabled, the Python plugin will only render one frame at a time even if a single task contains a chunk of frames."
    )
    singleFramesBox.ValueModified.connect(singleFramesChanged)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  2, 0,
                                  "The list of frames for the normal job.",
                                  False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", "", 2, 1)
    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 2, 2,
        "This is the number of frames that will be rendered at a time for each job task.",
        False)
    scriptDialog.AddRangeControlToGrid("ChunkSizeBox", "RangeControl", 1, 1,
                                       1000000, 0, 1, 2, 3)

    scriptDialog.AddControlToGrid("StartFrameLabel", "LabelControl",
                                  "Start Frame", 3, 0,
                                  "The first frame for the maintenance job.",
                                  False)
    scriptDialog.AddRangeControlToGrid("StartFrameBox", "RangeControl", 0,
                                       -1000000, 1000000, 0, 1, 3, 1)
    scriptDialog.AddControlToGrid("EndFrameLabel", "LabelControl", "End Frame",
                                  3, 2,
                                  "The last frame for the maintenance job.",
                                  False)
    scriptDialog.AddRangeControlToGrid("EndFrameBox", "RangeControl", 0,
                                       -1000000, 1000000, 0, 1, 3, 3)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl",
                                  "Python Script File", 4, 0,
                                  "The script file to be executed.", False)
    scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Python Files (*.py);;All Files (*)",
        4,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid(
        "ArgsLabel", "LabelControl", "Arguments", 5, 0,
        "The arguments to pass to the script. If no arguments are required, leave this blank.",
        False)
    scriptDialog.AddControlToGrid("ArgsBox",
                                  "TextControl",
                                  "",
                                  5,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "SpacerLabel", "LabelControl", "Argument Tags", 6, 0,
        "Use these buttons to add tags to the arguments.", False)
    startFButton = scriptDialog.AddControlToGrid(
        "StartFButton", "ButtonControl", "Start Frame Tag", 6, 1,
        'Adds a Start Frame tag to the arguments.')
    endFButton = scriptDialog.AddControlToGrid(
        "EndFButton", "ButtonControl", "End Frame Tag", 6, 2,
        'Adds an End Frame tag to the arguments.')
    quoteButton = scriptDialog.AddControlToGrid(
        "QuoteButton", "ButtonControl", "Quote Tag", 6, 3,
        'Adds a Quote tag to the arguments.')
    startFButton.ValueModified.connect(startFPressed)
    endFButton.ValueModified.connect(endFPressed)
    quoteButton.ValueModified.connect(quotePressed)

    scriptDialog.AddControlToGrid(
        "FramePaddingLabel", "LabelControl", "Frame Tag Padding", 7, 0,
        "Controls the amount of frame padding for the Start Frame and End Frame tags.",
        False)
    scriptDialog.AddRangeControlToGrid("FramePaddingBox", "RangeControl", 0, 0,
                                       10, 0, 1, 7, 1)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 8,
                                  0, "The version of Python to use.", False)
    scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "2.7",
        ("2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4",
         "3.5", "3.6", "3.7"), 8, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", True, "Submit Script File", 8, 2,
        "If this option is enabled, the script file will be submitted with the job, and then copied locally to the Slave machine during execution."
    )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 0)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 1,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)

    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                2,
                                                expand=False)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    closeButton.ValueModified.connect(jobOptions_dialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ("SceneBox", "ArgsBox", "VersionBox", "SubmitSceneBox",
                "FramesBox", "ChunkSizeBox", "SingleFramesOnlyBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    jobTypeChanged(None)

    scriptDialog.ShowDialog(False)
Пример #6
0
def __main__( *args ):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    global jobOptions_dialog
    
    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle( "Submit Unreal Engine Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( "UnrealEngine" ) )
    
    scriptDialog.AddTabControl( "Tabs", 0, 0 )
    
    scriptDialog.AddTabPage( "Job Options" )
    
    jobOptions_dialog = JobOptionsUI.JobOptionsDialog( parentAppName = "UnrealEngineMonitor" )
    
    scriptDialog.AddScriptControl( "JobOptionsDialog", jobOptions_dialog, "" )
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator1", "SeparatorControl", "Unreal Engine Options", 0, 0, colSpan=4 )

    scriptDialog.AddControlToGrid( "ProjectLabel", "LabelControl", "Project File", 1, 0, "The project to be rendered.", False )
    scriptDialog.AddSelectionControlToGrid( "ProjectBox", "FileBrowserControl", "", "Unreal Project Files (*.uproject);;All Files (*)", 1, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "MapLabel", "LabelControl", "Game Map", 2, 0, "The path to the map that will be loaded for the render.", False )
    scriptDialog.AddControlToGrid( "MapBox", "TextControl", "", 2, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "LevelSequenceLabel", "LabelControl", "Level Sequence", 3, 0, "The path to the level sequence that will be rendered out. eg. /Game/PathToSequence/SequenceName", False )
    scriptDialog.AddControlToGrid( "LevelSequenceBox", "TextControl", "", 3, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "FramesLabel", "LabelControl", "Frame List", 4, 0, "The list of frames to render.", False )
    scriptDialog.AddControlToGrid( "FramesBox", "TextControl", "", 4, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "ChunkSizeLabel", "LabelControl", "Frames Per Task", 5, 0, "This is the number of frames that will be rendered at a time for each job task.", False )
    scriptDialog.AddRangeControlToGrid( "ChunkSizeBox", "RangeControl", 1, 1, 1000000, 0, 1, 5, 1 )
    
    scriptDialog.AddControlToGrid( "VersionLabel", "LabelControl", "Version", 5, 2 , "The version of Unreal Engine to render with.", False)
    versionBox = scriptDialog.AddComboControlToGrid( "VersionBox", "ComboControl", "4", ( "4", ), 5, 3 )
    
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage("Output Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator2", "SeparatorControl", "Output Options", 0, 0, colSpan=4 )
    
    scriptDialog.AddControlToGrid( "OutputDirLabel", "LabelControl", "Output Directory", 1, 0,  "Destination folder for rendered images. Defaults to Project/Saved/Screenshots if left blank.", False )
    scriptDialog.AddSelectionControlToGrid( "OutputDirBox", "FolderBrowserControl", "", "", 1, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "OutputNameLabel", "LabelControl", "Output File Naming", 2, 0, "Sets the naming format for the output files. Defaults to project.{frame}. Available Tokens {fps}, {frame}, {width}, {height}, {world}, {quality}, {material}", False )
    scriptDialog.AddControlToGrid( "OutputNameBox", "TextControl", "", 2, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "OutputFormatLabel", "LabelControl", "Output Format", 3, 0, "The format for the output filename.", False)
    formatBox = scriptDialog.AddComboControlToGrid( "OutputFormatBox", "ComboControl", "PNG", ("JPG","BMP","PNG","AVI","CustomRenderPasses"), 3, 1 )
    formatBox.ValueModified.connect( OutputFormatModified )
    
    overrideResolutionBox = scriptDialog.AddSelectionControlToGrid( "OverrideResolutionBox", "CheckBoxControl", False, "Override Resolution", 4, 0, "Enable to override render resolution.", True )
    overrideResolutionBox.ValueModified.connect(OverrideResolutionChanged)
    
    scriptDialog.AddControlToGrid( "WidthLabel", "LabelControl", "Width", 5, 0, "Sets the output width in pixels." )
    scriptDialog.AddRangeControlToGrid( "WidthBox", "RangeControl", 1920, 1, 32768, 0, 1, 5, 1 )
    
    scriptDialog.AddControlToGrid( "HeightLabel", "LabelControl", "Height", 5, 2, "Sets the output height in pixels." )
    scriptDialog.AddRangeControlToGrid( "HeightBox", "RangeControl", 1080, 1, 32768, 0, 1, 5, 3 )
    
    scriptDialog.AddControlToGrid( "FrameRateLabel", "LabelControl", "Frame Rate", 6, 0, "Sets the frame rate of the output." )
    scriptDialog.AddRangeControlToGrid( "FrameRateBox", "RangeControl", 30, 1, 120, 0, 1, 6, 1 )
    
    scriptDialog.AddControlToGrid( "MovieQualityLabel", "LabelControl", "Render Quality", 6, 2, "Sets the compression quality. Expressed in a percentage." )
    scriptDialog.AddRangeControlToGrid( "MovieQualityBox", "RangeControl", 75, 1, 100, 0, 1, 6, 3 )
        
    scriptDialog.AddControlToGrid( "DelayBeforeLabel", "LabelControl", "Delay Before Warmup", 7, 0, "Number of frames to run the scene before playing the sequence. This will not play out in real-time." )
    scriptDialog.AddRangeControlToGrid( "DelayBeforeBox", "RangeControl", 0, 0, 32768, 0, 1, 7, 1 )
    
    scriptDialog.AddSelectionControlToGrid( "CinematicModeBox", "CheckBoxControl", True, "Cinematic Mode", 7, 2, "Hides Player Character and disables Player Character Movement. Also disables HUD.", True )   
    scriptDialog.AddSelectionControlToGrid( "HideMessagesBox", "CheckBoxControl", True, "Hide Onscreen Messages", 7, 3, "Hides on screen messages like \"Rebuild Lighting\" or \"Pring String\" outputs.", True )
    
    scriptDialog.AddSelectionControlToGrid( "EnableVSyncBox", "CheckBoxControl", True, "Enable VSync", 8, 0, "Enable VSync for batch rendering.", True )
    scriptDialog.AddSelectionControlToGrid( "DisableTextureStreamingBox", "CheckBoxControl", True, "Disable Texture Streaming", 8, 1, "Disable Texture streaming while rendering. Will take longer to render, but worth it for final renders.", True )
    
    scriptDialog.AddControlToGrid( "CustomRenderPassesLabel", "LabelControl", "Custom Render Passes", 9, 0, "" )
    
    renderPasses = ( "AmbientOcclusion", "BaseColor", "CustomDepth", "CustomDepthWorldUnits", "CustomStencil", "FinalImage", "MaterialAO", "Metallic", "Opacity", "PostTonemapHDRColor",
    "Roughness", "SceneColor", "SceneDepth", "SceneDepthWorldUnits", "SeparateTranslucencyA", "SeparateTranslucencyRGB", "ShadingModel", "Specular", "SubsurfaceColor", "WorldNormal" )

    scriptDialog.AddComboControlToGrid( "CustomRenderPassesBox", "MultiSelectListControl", "AmbientOcclusion", renderPasses, 9, 1, colSpan=3 )
    
    captureHDRBox = scriptDialog.AddSelectionControlToGrid( "CaptureHDRBox", "CheckBoxControl", True, "Capture Frames in HDR", 10, 0, "Renders with HDR in the .exr format.", True )  
    captureHDRBox.ValueModified.connect( CaptureHDRChanged )
    
    scriptDialog.AddControlToGrid( "HDRCompressionQualityLabel", "LabelControl", "HDR Compression Quality", 11, 0, "Compression Quality for HDR Frames (0 for no compression, 1 for default compression which can be slow)." )
    scriptDialog.AddRangeControlToGrid( "HDRCompressionQualityBox", "RangeControl", 0, 0, 1, 0, 1, 11, 1 )
    
    scriptDialog.AddControlToGrid( "CaptureGamutLabel", "LabelControl", "Capture Gamut", 11, 2, "" )
    scriptDialog.AddComboControlToGrid( "CaptureGamutBox", "ComboControl", "HCGM_Rec709", ( "HCGM_Rec709", "HCGM_P3DCI", "HCGM_Rec2020", "HCGM_ACES", "HCGM_ACEScg", "HCGM_MAX" ), 11, 3 )
    
    scriptDialog.AddControlToGrid( "PostProcessingLabel", "LabelControl", "Post Processing Material", 12, 0, "Custom Post Processing Material to use for rendering.", False )
    scriptDialog.AddControlToGrid( "PostProcessingBox", "TextControl", "", 12, 1, colSpan=3 )
    
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "UnrealEngineMonitor", DraftRequested, ProjectManagementOptions, failOnNoTabs=False )
    
    scriptDialog.EndTabControl()
    
    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid( "HSpacer1", 0, 0 )
    submitButton = scriptDialog.AddControlToGrid( "SubmitButton", "ButtonControl", "Submit", 0, 1, expand=False )
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid( "CloseButton", "ButtonControl", "Close", 0, 2, expand=False )
    # Make sure all the project management connections are closed properly
    closeButton.ValueModified.connect(integration_dialog.CloseProjectManagementConnections)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    closeButton.ValueModified.connect(jobOptions_dialog.closeEvent)
    scriptDialog.EndGrid()
    
    settings = ( "ProjectBox", "MapBox", "LevelSequenceBox", "FramesBox", "ChunkSizeBox", "VersionBox", "OutputDirBox",
    "OutputNameBox", "OutputFormatBox", "OverrideResolutionBox", "WidthBox", "HeightBox", "FrameRateBox", "MovieQualityBox",
    "DelayBeforeBox", "CinematicModeBox", "HideMessagesBox", "EnableVSyncBox", "DisableTextureStreamingBox", "CustomRenderPassesBox",
    "CaptureHDRBox", "HDRCompressionQualityBox", "CaptureGamutBox", "PostProcessingBox" )
    
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    OverrideResolutionChanged( None )
    OutputFormatModified( None )
    
    scriptDialog.ShowDialog( False )