예제 #1
0
def __main__(*args):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    global passInformationDict
    global qualityOptionDict

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit KeyShot Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('KeyShot'))

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

    scriptDialog.AddTabPage("Job Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator1",
                                  "SeparatorControl",
                                  "Job Description",
                                  0,
                                  0,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "NameLabel", "LabelControl", "Job Name", 1, 0,
        "The name of your job. This is optional, and if left blank, it will default to 'Untitled'.",
        False)
    scriptDialog.AddControlToGrid("NameBox", "TextControl", "Untitled", 1, 1)

    scriptDialog.AddControlToGrid(
        "CommentLabel", "LabelControl", "Comment", 2, 0,
        "A simple description of your job. This is optional and can be left blank.",
        False)
    scriptDialog.AddControlToGrid("CommentBox", "TextControl", "", 2, 1)

    scriptDialog.AddControlToGrid(
        "DepartmentLabel", "LabelControl", "Department", 3, 0,
        "The department you belong to. This is optional and can be left blank.",
        False)
    scriptDialog.AddControlToGrid("DepartmentBox", "TextControl", "", 3, 1)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator2",
                                  "SeparatorControl",
                                  "Job Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "PoolLabel", "LabelControl", "Pool", 1, 0,
        "The pool that your job will be submitted to.", False)
    scriptDialog.AddControlToGrid("PoolBox", "PoolComboControl", "none", 1, 1)

    scriptDialog.AddControlToGrid(
        "SecondaryPoolLabel", "LabelControl", "Secondary Pool", 2, 0,
        "The secondary pool lets you specify a Pool to use if the primary Pool does not have any available Slaves.",
        False)
    scriptDialog.AddControlToGrid("SecondaryPoolBox",
                                  "SecondaryPoolComboControl", "", 2, 1)

    scriptDialog.AddControlToGrid(
        "GroupLabel", "LabelControl", "Group", 3, 0,
        "The group that your job will be submitted to.", False)
    scriptDialog.AddControlToGrid("GroupBox", "GroupComboControl", "none", 3,
                                  1)

    scriptDialog.AddControlToGrid(
        "PriorityLabel", "LabelControl", "Priority", 4, 0,
        "A job can have a numeric priority ranging from 0 to 100, where 0 is the lowest priority and 100 is the highest priority.",
        False)
    scriptDialog.AddRangeControlToGrid(
        "PriorityBox", "RangeControl",
        RepositoryUtils.GetMaximumPriority() / 2, 0,
        RepositoryUtils.GetMaximumPriority(), 0, 1, 4, 1)

    scriptDialog.AddControlToGrid(
        "TaskTimeoutLabel", "LabelControl", "Task Timeout", 5, 0,
        "The number of minutes a slave has to render a task for this job before it requeues it. Specify 0 for no limit.",
        False)
    scriptDialog.AddRangeControlToGrid("TaskTimeoutBox", "RangeControl", 0, 0,
                                       1000000, 0, 1, 5, 1)
    scriptDialog.AddSelectionControlToGrid(
        "AutoTimeoutBox",
        "CheckBoxControl",
        False,
        "Enable Auto Task Timeout",
        5,
        2,
        "If the Auto Task Timeout is properly configured in the Repository Options, then enabling this will allow a task timeout to be automatically calculated based on the render times of previous frames for the job. ",
        colSpan=2)

    scriptDialog.AddControlToGrid(
        "ConcurrentTasksLabel", "LabelControl", "Concurrent Tasks", 6, 0,
        "The number of tasks that can render concurrently on a single slave. This is useful if the rendering application only uses one thread to render and your slaves have multiple CPUs.",
        False)
    scriptDialog.AddRangeControlToGrid("ConcurrentTasksBox", "RangeControl", 1,
                                       1, 16, 0, 1, 6, 1)
    scriptDialog.AddSelectionControlToGrid(
        "LimitConcurrentTasksBox",
        "CheckBoxControl",
        True,
        "Limit Tasks To Slave's Task Limit",
        6,
        2,
        "If you limit the tasks to a slave's task limit, then by default, the slave won't dequeue more tasks then it has CPUs. This task limit can be overridden for individual slaves by an administrator.",
        colSpan=2)

    scriptDialog.AddControlToGrid("MachineLimitLabel", "LabelControl",
                                  "Machine Limit", 7, 0, "", False)
    scriptDialog.AddRangeControlToGrid("MachineLimitBox", "RangeControl", 0, 0,
                                       1000000, 0, 1, 7, 1)
    scriptDialog.AddSelectionControlToGrid("IsBlacklistBox",
                                           "CheckBoxControl",
                                           False,
                                           "Machine List Is A Blacklist",
                                           7,
                                           2,
                                           "",
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "MachineListLabel", "LabelControl", "Machine List", 8, 0,
        "Use the Machine Limit to specify the maximum number of machines that can render your job at one time. Specify 0 for no limit.",
        False)
    scriptDialog.AddControlToGrid("MachineListBox",
                                  "MachineListControl",
                                  "",
                                  8,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("LimitGroupLabel", "LabelControl", "Limits",
                                  9, 0, "The Limits that your job requires.",
                                  False)
    scriptDialog.AddControlToGrid("LimitGroupBox",
                                  "LimitGroupControl",
                                  "",
                                  9,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "DependencyLabel", "LabelControl", "Dependencies", 10, 0,
        "Specify existing jobs that this job will be dependent on. This job will not start until the specified dependencies finish rendering. ",
        False)
    scriptDialog.AddControlToGrid("DependencyBox",
                                  "DependencyControl",
                                  "",
                                  10,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "OnJobCompleteLabel", "LabelControl", "On Job Complete", 11, 0,
        "If desired, you can automatically archive or delete the job when it completes. ",
        False)
    scriptDialog.AddControlToGrid("OnJobCompleteBox", "OnJobCompleteControl",
                                  "Nothing", 11, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSuspendedBox",
        "CheckBoxControl",
        False,
        "Submit Job As Suspended",
        11,
        2,
        "If enabled, the job will submit in the suspended state. This is useful if you don't want the job to start rendering right away. Just resume it from the Monitor when you want it to render. ",
        colSpan=2)

    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "KeyShot Options",
                                  12,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "KeyShot File",
                                  13, 0,
                                  "The KeyShot project file to be rendered.",
                                  False)
    scriptDialog.AddSelectionControlToGrid("SceneBox",
                                           "FileBrowserControl",
                                           "",
                                           "All Files (*)",
                                           13,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version",
                                  14, 0,
                                  "The KeyShot application version to use.",
                                  False)
    scriptDialog.AddComboControlToGrid("VersionBox", "ComboControl", "8",
                                       ("6", "7", "8"), 14, 1)

    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox",
        "CheckBoxControl",
        False,
        "Submit KeyShot Project File",
        14,
        2,
        "If this option is enabled, the project file will be submitted with the job, and then copied locally to the slave machine during rendering.",
        colSpan=2)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output File", 15, 0,
        "The filename of the image(s) to be rendered.", False)
    outputBox = scriptDialog.AddSelectionControlToGrid(
        "OutputBox",
        "FileSaverControl",
        "",
        "JPEG (*.jpg *.jpeg);;TIFF (*.tif *.tiff);;EXR (*.exr);;PNG (*.png);;All files (*)",
        15,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  16, 0, "The list of frames to render.",
                                  False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", "", 16, 1)
    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 16, 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, 16, 3)

    scriptDialog.AddControlToGrid("RenderWidthLabel", "LabelControl",
                                  "Render Width", 17, 0,
                                  "The width of the images rendered.", False)
    scriptDialog.AddRangeControlToGrid("RenderWidthBox", "RangeControl", 1920,
                                       1, 1000000, 0, 1, 17, 1)
    scriptDialog.AddControlToGrid("RenderHeightLabel", "LabelControl",
                                  "Render Height", 17, 2,
                                  "The height of the images rendered.", False)
    scriptDialog.AddRangeControlToGrid("RenderHeightBox", "RangeControl", 1080,
                                       1, 1000000, 0, 1, 17, 3)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Additional Options")
    scriptDialog.AddGrid()

    scriptDialog.AddSelectionControlToGrid(
        "RenderLayersBox", "CheckBoxControl", False,
        "Include All Render Layers", 0, 0,
        "If this option is enabled, all render layers will be rendered separately."
    )
    scriptDialog.AddSelectionControlToGrid(
        "IncludeAlphaBox", "CheckBoxControl", False,
        "Include Alpha (Transparency)", 0, 1,
        "If this option is enabled, the final image will include alpha.")

    scriptDialog.AddControlToGrid("Separator1",
                                  "SeparatorControl",
                                  "Render Pass Options",
                                  1,
                                  0,
                                  colSpan=2)

    overrideRenderPassesBox = scriptDialog.AddSelectionControlToGrid(
        "overrideRenderPassesBox", "CheckBoxControl", False,
        "Override Render Passes", 2, 0,
        "If this option is enabled, the output pass settings in the scene will be overridden."
    )
    overrideRenderPassesBox.ValueModified.connect(OverrideRenderPassesChanged)

    for passBox, passInfo in passInformationDict.iteritems():
        scriptDialog.AddSelectionControlToGrid(
            passBox, "CheckBoxControl", False, passInfo[1], passInfo[2],
            passInfo[3], ("If this option is enabled, the %s will be output." %
                          passInfo[1].lower()))

    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator2",
                                  "SeparatorControl",
                                  "Render Quality Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("QualityTypeLabel", "LabelControl",
                                  "Quality to Render By", 1, 0,
                                  "The type of quality to render by.", False)
    qualityTypeBox = scriptDialog.AddComboControlToGrid(
        "QualityTypeBox", "ComboControl", "", qualityTypeOptions, 1, 1)
    qualityTypeBox.ValueModified.connect(QualityTypeChanged)

    scriptDialog.AddControlToGrid("AdvancedSamplesSeparator",
                                  "SeparatorControl",
                                  "Advanced Options",
                                  2,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("AdvancedMaxSamplesLabel", "LabelControl",
                                  "Maximum Samples", 3, 0,
                                  "Maximum number of samples to render.",
                                  False)
    scriptDialog.AddRangeControlToGrid("AdvancedMaxSamplesBox", "RangeControl",
                                       16, 4, 256, 0, 1, 3, 1)
    scriptDialog.AddControlToGrid(
        "GlobalIlluminationLabel", "LabelControl", "Global Illumination", 3, 2,
        "This will control the quality of all indirect light. If Global Illumination is turned on.",
        False)
    scriptDialog.AddRangeControlToGrid("GlobalIlluminationBox", "RangeControl",
                                       1, 1, 5, 3, 1, 3, 3)

    scriptDialog.AddControlToGrid(
        "RayBouncesLabel", "LabelControl", "Ray Bounces", 4, 0,
        "Number of times light is reflected/refracted as it passes through a scene.",
        False)
    scriptDialog.AddRangeControlToGrid("RayBouncesBox", "RangeControl", 6, 0,
                                       64, 0, 1, 4, 1)
    scriptDialog.AddControlToGrid(
        "PixelBlurLabel", "LabelControl", "Pixel Blur", 4, 2,
        "Number of times light is reflected/refracted as it passes through a scene.",
        False)
    scriptDialog.AddRangeControlToGrid("PixelBlurBox", "RangeControl", 1.5, 1,
                                       3, 3, 1, 4, 3)

    scriptDialog.AddControlToGrid(
        "AntiAliasingLabel", "LabelControl", "Anti Aliasing", 5, 0,
        "Anti aliasing is a method for smoothing out jagged edges that are created by pixels.",
        False)
    scriptDialog.AddRangeControlToGrid("AntiAliasingBox", "RangeControl", 1, 1,
                                       8, 0, 1, 5, 1)
    scriptDialog.AddControlToGrid(
        "DepthOfFieldLabel", "LabelControl", "Depth of Field", 5, 2,
        "This will control the quality of depth of field if it is enabled in the camera tab.",
        False)
    scriptDialog.AddRangeControlToGrid("DepthOfFieldBox", "RangeControl", 3, 1,
                                       10, 0, 1, 5, 3)

    scriptDialog.AddControlToGrid(
        "ShadowLabel", "LabelControl", "Shadow Quality", 6, 0,
        "Shadow quality will control the shadow quality for ground shadows.",
        False)
    scriptDialog.AddRangeControlToGrid("ShadowBox", "RangeControl", 1, 1, 10,
                                       3, 1, 6, 1)
    scriptDialog.AddControlToGrid(
        "CausticsLabel", "LabelControl", "Caustics", 6, 2,
        "Increasing this value will improve the samples and quality of the caustics.",
        False)
    scriptDialog.AddRangeControlToGrid("CausticsBox", "RangeControl", 1, 1, 10,
                                       3, 1, 6, 3)

    scriptDialog.AddSelectionControlToGrid("SharpShadowsBox",
                                           "CheckBoxControl",
                                           False,
                                           "Sharp Shadows",
                                           7,
                                           0,
                                           "",
                                           colSpan=2)
    scriptDialog.AddSelectionControlToGrid("SharperTextureFilteringBox",
                                           "CheckBoxControl",
                                           False,
                                           "Sharper Texture Filtering",
                                           7,
                                           2,
                                           "",
                                           colSpan=2)
    scriptDialog.AddSelectionControlToGrid("GlobalIlluminationCacheBox",
                                           "CheckBoxControl",
                                           False,
                                           "Global Illumiation Cache",
                                           8,
                                           0,
                                           "",
                                           colSpan=2)

    scriptDialog.AddControlToGrid("TimeSeparator",
                                  "SeparatorControl",
                                  "Maximum Time Options",
                                  9,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "MaxTimeLabel", "LabelControl", "Maximum Time (s)", 10, 0,
        "Maximum time spent rendering (in seconds).", False)
    scriptDialog.AddRangeControlToGrid("MaxTimeBox", "RangeControl", 30, 1,
                                       86400, 2, 1, 10, 1)

    scriptDialog.AddControlToGrid("SamplesSeparator",
                                  "SeparatorControl",
                                  "Maximum Samples Options",
                                  11,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("ProgressiveMaxSamplesLabel", "LabelControl",
                                  " Maximum Samples", 12, 0,
                                  "Maximum number of samples to render.",
                                  False)
    scriptDialog.AddRangeControlToGrid("ProgressiveMaxSamplesBox",
                                       "RangeControl", 16, 1, 256, 0, 1, 12, 1)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "KeyShotMonitor",
                                          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 = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox",
                "ChunkSizeBox", "SubmitSceneBox", "VersionBox")
    settings += tuple(passInformationDict.keys())
    settings += tuple(qualityOptionDict.keys())
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    OverrideRenderPassesChanged(None)
    QualityTypeChanged(None)

    appSubmission = False
    if len(args) > 0:
        appSubmission = True

        if args[0] == "":
            scriptDialog.ShowMessageBox(
                "The KeyShot scene must be saved before it can be submitted to Deadline.",
                "Error")
            return

        scriptDialog.SetValue("SceneBox", args[0])
        scriptDialog.SetValue("VersionBox", args[1])
        scriptDialog.SetValue("FramesBox", "0-" + args[2])
        renderOptions = {}

        try:
            with open(args[3], "r") as optionsFile:
                renderOptions = json.load(optionsFile)
        except:
            pass

        scriptDialog.SetValue(
            "RenderLayersBox",
            renderOptions.get("output_render_layers",
                              scriptDialog.GetValue("RenderLayersBox")))
        scriptDialog.SetValue(
            "IncludeAlphaBox",
            renderOptions.get("output_alpha_channel",
                              scriptDialog.GetValue("IncludeAlphaBox")))

        for passBox, passInfo in passInformationDict.iteritems():
            scriptDialog.SetValue(
                passBox,
                renderOptions.get(passInfo[0], scriptDialog.GetValue(passBox)))

        if renderOptions.get("__VERSION", 0) < 4:
            maxTimeParam = renderOptions.get("progressive_max_time", 0.0)
            advancedSamplesParam = renderOptions.get("advanced_samples", 16)
            maxSamplesParam = renderOptions.get("progressive_max_samples", 0)

            if maxTimeParam == 0 and advancedSamplesParam == 0:
                scriptDialog.SetValue("QualityTypeBox", "Maximum Samples")
            elif maxTimeParam == 0 and advancedSamplesParam != 0:
                scriptDialog.SetValue("QualityTypeBox", "Advanced Control")
            else:
                scriptDialog.SetValue("QualityTypeBox", "Maximum Time")
        else:
            renderMode = renderOptions.get("render_mode", 0)

            scriptDialog.SetValue("QualityTypeBox",
                                  qualityTypeOptions[renderMode])

        for qualityBox, qualityOptions in qualityOptionDict.iteritems():
            scriptDialog.SetValue(
                qualityBox,
                renderOptions.get(qualityOptions[0],
                                  scriptDialog.GetValue(qualityBox)))

    scriptDialog.ShowDialog(True)
예제 #2
0
def __main__(*args):
    global scriptDialog
    global settings
    global presetSettings
    global startup
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit Fusion Quicktime Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('Fusion'))

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

    scriptDialog.AddTabPage("Job Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("JobOptionsSeparator",
                                  "SeparatorControl",
                                  "Job Description",
                                  0,
                                  0,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "NameLabel", "LabelControl", "Job Name", 1, 0,
        "The name of your job. This is optional, and if left blank, it will default to 'Untitled'.",
        False)
    scriptDialog.AddControlToGrid("NameBox", "TextControl", "Untitled", 1, 1)

    scriptDialog.AddControlToGrid(
        "CommentLabel", "LabelControl", "Comment", 2, 0,
        "A simple description of your job. This is optional and can be left blank.",
        False)
    scriptDialog.AddControlToGrid("CommentBox", "TextControl", "", 2, 1)

    scriptDialog.AddControlToGrid(
        "DepartmentLabel", "LabelControl", "Department", 3, 0,
        "The department you belong to. This is optional and can be left blank.",
        False)
    scriptDialog.AddControlToGrid("DepartmentBox", "TextControl", "", 3, 1)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator2",
                                  "SeparatorControl",
                                  "Job Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "PoolLabel", "LabelControl", "Pool", 1, 0,
        "The pool that your job will be submitted to.", False)
    scriptDialog.AddControlToGrid("PoolBox", "PoolComboControl", "none", 1, 1)

    scriptDialog.AddControlToGrid(
        "SecondaryPoolLabel", "LabelControl", "Secondary Pool", 2, 0,
        "The secondary pool lets you specify a Pool to use if the primary Pool does not have any available Slaves.",
        False)
    scriptDialog.AddControlToGrid("SecondaryPoolBox",
                                  "SecondaryPoolComboControl", "", 2, 1)

    scriptDialog.AddControlToGrid(
        "GroupLabel", "LabelControl", "Group", 3, 0,
        "The group that your job will be submitted to.", False)
    scriptDialog.AddControlToGrid("GroupBox", "GroupComboControl", "none", 3,
                                  1)

    scriptDialog.AddControlToGrid(
        "PriorityLabel", "LabelControl", "Priority", 4, 0,
        "A job can have a numeric priority ranging from 0 to 100, where 0 is the lowest priority and 100 is the highest priority.",
        False)
    scriptDialog.AddRangeControlToGrid(
        "PriorityBox", "RangeControl",
        RepositoryUtils.GetMaximumPriority() / 2, 0,
        RepositoryUtils.GetMaximumPriority(), 0, 1, 4, 1)

    scriptDialog.AddControlToGrid(
        "TaskTimeoutLabel", "LabelControl", "Task Timeout", 5, 0,
        "The number of minutes a slave has to render a task for this job before it requeues it. Specify 0 for no limit.",
        False)
    scriptDialog.AddRangeControlToGrid("TaskTimeoutBox", "RangeControl", 0, 0,
                                       1000000, 0, 1, 5, 1)
    scriptDialog.AddSelectionControlToGrid(
        "IsBlacklistBox", "CheckBoxControl", False,
        "Machine List Is A Blacklist", 5, 2,
        "You can force the job to render on specific machines by using a whitelist, or you can avoid specific machines by using a blacklist."
    )

    scriptDialog.AddControlToGrid(
        "MachineListLabel", "LabelControl", "Machine List", 6, 0,
        "The whitelisted or blacklisted list of machines.", False)
    scriptDialog.AddControlToGrid("MachineListBox",
                                  "MachineListControl",
                                  "",
                                  6,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid("LimitGroupLabel", "LabelControl", "Limits",
                                  7, 0, "The Limits that your job requires.",
                                  False)
    scriptDialog.AddControlToGrid("LimitGroupBox",
                                  "LimitGroupControl",
                                  "",
                                  7,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "DependencyLabel", "LabelControl", "Dependencies", 8, 0,
        "Specify existing jobs that this job will be dependent on. This job will not start until the specified dependencies finish rendering.",
        False)
    scriptDialog.AddControlToGrid("DependencyBox",
                                  "DependencyControl",
                                  "",
                                  8,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "OnJobCompleteLabel", "LabelControl", "On Job Complete", 9, 0,
        "If desired, you can automatically archive or delete the job when it completes.",
        False)
    scriptDialog.AddControlToGrid("OnJobCompleteBox", "OnJobCompleteControl",
                                  "Nothing", 9, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSuspendedBox", "CheckBoxControl", False,
        "Submit Job As Suspended", 9, 2,
        "If enabled, the job will submit in the suspended state. This is useful if you don't want the job to start rendering right away. Just resume it from the Monitor when you want it to render."
    )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("SeparatorFusionOptions",
                                  "SeparatorControl",
                                  "Fusion Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "VersionLabel", "LabelControl", "Fusion Version", 1, 0,
        "Select the version of Fusion to generate the Quicktime with.", False)
    versionBox = scriptDialog.AddComboControlToGrid("VersionBox",
                                                    "ComboControl", "7",
                                                    ("5", "6", "7", "8"), 1, 1)
    versionBox.ValueModified.connect(VersionModified)
    scriptDialog.AddControlToGrid("BuildLabel", "LabelControl", "Build", 1, 2,
                                  "", False)
    scriptDialog.AddComboControlToGrid("BuildBox", "ComboControl", "None",
                                       ("None", "32bit", "64bit"), 1, 3)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Input / Output Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "InputLabel", "LabelControl", "Input Images", 1, 0,
        "The frames you would like to generate the Quicktime from. If a sequence of frames exist in the same folder, Deadline will automatically collect the range of the frames and will set the Frame Range field accordingly.",
        False)
    inputBox = scriptDialog.AddSelectionControlToGrid("InputBox",
                                                      "FileBrowserControl",
                                                      "",
                                                      "All Files (*)",
                                                      1,
                                                      1,
                                                      colSpan=3)
    inputBox.ValueModified.connect(InputImagesModified)

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

    scriptDialog.AddControlToGrid("FrameRateLabel", "LabelControl",
                                  "Frame Rate", 4, 0,
                                  "The frame rate of the Quicktime.", False)
    scriptDialog.AddRangeControlToGrid("FrameRateBox", "RangeControl", 24.00,
                                       0.01, 100.00, 2, 1.00, 4, 1)
    isOverrideBox = scriptDialog.AddSelectionControlToGrid(
        "IsOverrideBox", "CheckBoxControl", False, "Override Start", 4, 2,
        "Allows the starting frame in the Quicktime to be overridden.", False)
    isOverrideBox.ValueModified.connect(IsOverrideModified)
    scriptDialog.AddRangeControlToGrid("OverrideBox", "RangeControl", 0,
                                       -1000000, 1000000, 0, 1, 4, 3)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output Movie File", 5, 0,
        "The name of the Quicktime to be generated.", False)
    scriptDialog.AddSelectionControlToGrid("OutputBox",
                                           "FileSaverControl",
                                           "",
                                           "Quicktime Movies (*.mov)",
                                           5,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "CodecLabel", "LabelControl", "Codec", 6, 0,
        "The codec format to use for the Quicktime.", False)
    scriptDialog.AddComboControlToGrid("CodecBox", "ComboControl", "None_raw",
                                       GetCodecs(), 6, 1)
    scriptDialog.AddControlToGrid(
        "MissingFramesLabel", "LabelControl", "On Missing Frames", 6, 2,
        "What the generator will do when a frame is missing or is unable to load.",
        False)
    scriptDialog.AddComboControlToGrid(
        "MissingFramesBox", "ComboControl", "Output Black",
        ("Fail", "Hold Previous", "Output Black", "Wait"), 6, 3)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Quicktime Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("SeparatorQTSettings",
                                  "SeparatorControl",
                                  "Quicktime Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "BackgroundLabel", "LabelControl", "BG Plate (Optional)", 1, 0,
        "Specify an optinal background plate. The Quicktime will render using the selected file as the background.",
        False)
    scriptDialog.AddSelectionControlToGrid("BackgroundBox",
                                           "FileBrowserControl",
                                           "",
                                           "All Files (*)",
                                           1,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "TemplateLabel", "LabelControl", "Template (Optional)", 2, 0,
        "Specify an optional Fusion comp to use as a template.", False)
    scriptDialog.AddSelectionControlToGrid("TemplateBox",
                                           "FileBrowserControl",
                                           "",
                                           "Fusion Files (*.comp)",
                                           2,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "ArtistLabel", "LabelControl", "Artist Name", 3, 0,
        "The name of the artist who created the render. If left blank, the job's user will be used.",
        False)
    scriptDialog.AddControlToGrid("ArtistBox", "TextControl", "", 3, 1)
    scriptDialog.AddSelectionControlToGrid(
        "CurveCorrectionBox",
        "CheckBoxControl",
        False,
        "Curve Correction (If Template Is Specified)",
        3,
        2,
        "Select to turn on the color curves tool (available when using templates only).",
        colSpan=2)

    scriptDialog.AddControlToGrid("QualityLabel", "LabelControl", "Quality %",
                                  4, 0, "The quality of the Quicktime.", False)
    scriptDialog.AddRangeControlToGrid("QualityBox", "RangeControl", 75, 0,
                                       100, 0, 1, 4, 1)
    scriptDialog.AddControlToGrid(
        "ProxyLabel", "LabelControl", "Proxy", 4, 2,
        "The ratio of pixels to render (for example, if set to 4, one out of every four pixels will be rendered).",
        False)
    scriptDialog.AddRangeControlToGrid("ProxyBox", "RangeControl", 1, 1, 8, 0,
                                       1, 4, 3)

    scriptDialog.AddControlToGrid("GammaLabel", "LabelControl", "Gamma", 5, 0,
                                  "The gamma level of the Quicktime.", False)
    scriptDialog.AddRangeControlToGrid("GammaBox", "RangeControl", 1.80000,
                                       0.20000, 5.00000, 5, 0.20000, 5, 1)
    scriptDialog.AddControlToGrid(
        "ExpCompLabel", "LabelControl", "Exposure Comp.", 5, 2,
        "The 'stops' value used to calculate the gain parameter of the Brightness/Contrast tool. The gain parameter is calculated by using the value pow(2,stops).",
        False)
    scriptDialog.AddRangeControlToGrid("ExpCompBox", "RangeControl", 0.00000,
                                       -3.00000, 3.00000, 5, 0.50000, 5, 3)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

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

    scriptDialog.EndTabControl()

    scriptDialog.AddGrid()
    loadPresetButton = scriptDialog.AddControlToGrid("LoadPresetButton",
                                                     "ButtonControl",
                                                     "Load Preset",
                                                     0,
                                                     0,
                                                     expand=False)
    loadPresetButton.ValueModified.connect(LoadPresetButtonPressed)
    savePresetButton = scriptDialog.AddControlToGrid("SavePresetButton",
                                                     "ButtonControl",
                                                     "Save Preset",
                                                     0,
                                                     1,
                                                     expand=False)
    savePresetButton.ValueModified.connect(SavePresetButtonPressed)

    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 3)

    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 4,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                5,
                                                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 = ("CategoryBox", "DepartmentBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "LimitGroupBox", "OnJobCompleteBox",
                "MachineListBox", "SubmitSuspendedBox", "IsBlacklistBox",
                "InputBox", "VersionBox", "BuildBox", "FrameRateBox",
                "BackgroundBox", "TemplateBox", "ArtistBox",
                "CurveCorrectionBox", "CodecBox", "MissingFramesBox",
                "QualityBox", "ProxyBox", "GammaBox", "ExpCompBox",
                "IsOverrideBox", "OverrideBox")
    presetSettings = ("VersionBox", "BuildBox", "FrameRateBox",
                      "BackgroundBox", "TemplateBox", "ArtistBox",
                      "CurveCorrectionBox", "CodecBox", "MissingFramesBox",
                      "QualityBox", "ProxyBox", "GammaBox", "ExpCompBox",
                      "IsOverrideBox", "OverrideBox")

    #Should be not from but for testing
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.SetItems("CodecBox", GetCodecs())
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)

    if scriptDialog.GetValue("ArtistBox").strip() == "":
        scriptDialog.SetValue("ArtistBox", ClientUtils.GetDeadlineUser())

    if len(args) > 0:
        scriptDialog.SetValue("InputBox", args[0])

    InputImagesModified()
    IsOverrideModified()

    startup = False

    scriptDialog.ShowDialog(len(args) > 0)
예제 #3
0
def __main__(*args):
    global scriptDialog
    global settings

    dialogWidth = 450
    dialogHeight = 0

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetSize(dialogWidth, dialogHeight)
    scriptDialog.SetTitle("Choose Machines to Connect to with RDC")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "SlavesLabel", "LabelControl", "Machine Name(s)", 0, 0,
        "Specify which machines to connect to. Use a comma to separate multiple machine names.",
        False)
    scriptDialog.AddControlToGrid("SlavesBox", "TextControl", "", 0, 1)

    noSettingsBox = scriptDialog.AddRadioControlToGrid(
        "NoSettingsBox", "RadioControl", True, "No Settings", "RadioGroup", 1,
        0,
        "When this option is chosen, no existing RDP settings are used to connect.",
        False)
    noSettingsBox.ValueModified.connect(settingsChanged)

    useSettingsFileBox = scriptDialog.AddRadioControlToGrid(
        "UseSettingsFileBox", "RadioControl", False, "Settings File",
        "RadioGroup", 2, 0,
        "When this option is chosen, the specified RDP config file is used to connect.",
        False)
    useSettingsFileBox.ValueModified.connect(settingsChanged)
    scriptDialog.AddSelectionControlToGrid(
        "SettingsFileBox", "FileBrowserControl", "",
        "RDP Files (*.rdp);;All Files (*.*)", 2, 1)

    useSettingsFolderBox = scriptDialog.AddRadioControlToGrid(
        "UseSettingsDirBox", "RadioControl", False, "Settings Folder",
        "RadioGroup", 3, 0,
        "When this option is enabled, existing RDP config files in this folder are used to connect. If the machine does not have an RDP config file, you'll have the option to save one before connecting.",
        False)
    useSettingsFolderBox.ValueModified.connect(settingsChanged)
    scriptDialog.AddSelectionControlToGrid("SettingsDirBox",
                                           "FolderBrowserControl", "", "", 3,
                                           1)

    scriptDialog.AddSelectionControlToGrid(
        "HideWindowBox",
        "CheckBoxControl",
        False,
        "Hide this window if running from a right-click Scripts menu",
        4,
        0,
        "If enabled, this window will be hidden if run from a right-click menu in the Monitor. You can always run it from the main Scripts menu to see this window.",
        colSpan=2)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("DummyLabel1", 0, 0)
    startButton = scriptDialog.AddControlToGrid("SelectButton",
                                                "ButtonControl",
                                                "OK",
                                                0,
                                                1,
                                                expand=False)
    startButton.ValueModified.connect(connectWithRDC)
    closeButton = scriptDialog.AddControlToGrid("CancelButton",
                                                "ButtonControl",
                                                "Cancel",
                                                0,
                                                2,
                                                expand=False)
    closeButton.ValueModified.connect(cancelButtonPressed)
    scriptDialog.EndGrid()

    settings = ("SlavesBox", "NoSettingsBox", "UseSettingsFileBox",
                "SettingsFileBox", "UseSettingsDirBox", "SettingsDirBox",
                "HideWindowBox")
    scriptDialog.LoadSettings(getSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, getSettingsFilename())

    settingsChanged()

    showWindow = True
    if len(args) > 0:
        scriptDialog.SetValue("SlavesBox", args[0])

        if scriptDialog.GetValue("HideWindowBox"):
            showWindow = False

    if showWindow:
        scriptDialog.ShowDialog(True)
    else:
        autoConnect = True

        # Check if there are any issues accessing the settings file or folder.
        if scriptDialog.GetValue("UseSettingsFileBox"):
            settingsFile = scriptDialog.GetValue("SettingsFileBox")
            if not File.Exists(settingsFile):
                scriptDialog.ShowMessageBox(
                    "The specified settings file '%s' does not exist." %
                    settingsFile, "Error")
                autoConnect = False
        elif scriptDialog.GetValue("UseSettingsDirBox"):
            settingsDir = scriptDialog.GetValue("SettingsDirBox")
            if not Directory.Exists(settingsDir):
                scriptDialog.ShowMessageBox(
                    "The specified settings folder '%s' does not exist." %
                    settingsDir, "Error")
                autoConnect = False

        # If errors prevent auto-connect from working, just display the window.
        if autoConnect:
            connectWithRDC()
        else:
            scriptDialog.ShowDialog(True)
예제 #4
0
def __main__(*args):
    global scriptDialog
    global settings

    dialogWidth = 450
    dialogHeight = 0

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Choose Machines to Connect to with ARD")
    scriptDialog.SetSize(dialogWidth, dialogHeight)
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "SlavesLabel", "LabelControl", "Machine IP Address(s)", 0, 0,
        "Specify which machines to connect to. Use a comma to separate multiple machine names.",
        False)
    scriptDialog.AddControlToGrid("SlavesBox", "TextControl", "", 0, 1)

    scriptDialog.AddSelectionControlToGrid(
        "HideWindowBox",
        "CheckBoxControl",
        False,
        "Hide this window if running from a right-click Scripts menu",
        1,
        0,
        "If enabled, this window will be hidden if run from a right-click menu in the Monitor. You can always run it from the main Scripts menu to see this window.",
        colSpan=2)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("DummyLabel1", 0, 0)
    startButton = scriptDialog.AddControlToGrid("SelectButton",
                                                "ButtonControl",
                                                "OK",
                                                0,
                                                1,
                                                expand=False)
    startButton.ValueModified.connect(connectWithARD)
    closeButton = scriptDialog.AddControlToGrid("CancelButton",
                                                "ButtonControl",
                                                "Cancel",
                                                0,
                                                2,
                                                expand=False)
    closeButton.ValueModified.connect(cancelButtonPressed)
    scriptDialog.EndGrid()

    settings = ("SlavesBox", "HideWindowBox")
    scriptDialog.LoadSettings(getSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, getSettingsFilename())

    showWindow = True
    if len(args) > 0:
        scriptDialog.SetValue("SlavesBox", args[0])

        if scriptDialog.GetValue("HideWindowBox"):
            showWindow = False

    if showWindow:
        scriptDialog.ShowDialog(True)
    else:
        connectWithARD()
def __main__(*args):
    global scriptDialog
    global settings

    dialogWidth = 450
    dialogHeight = 0

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetSize(dialogWidth, dialogHeight)
    scriptDialog.SetTitle("Choose Machines to Connect to with VNC")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "SlavesLabel", "LabelControl", "Machine Name(s)", 0, 0,
        "Specify which machines to connect to. Use a comma to separate multiple machine names.",
        False)
    scriptDialog.AddControlToGrid("SlavesBox",
                                  "TextControl",
                                  "",
                                  0,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid("ExeLabel", "LabelControl", "VNC Viewer", 1,
                                  0, "The VNC viewer executable to use.",
                                  False)
    scriptDialog.AddSelectionControlToGrid("ExeBox",
                                           "FileBrowserControl",
                                           "",
                                           "All Files (*)",
                                           1,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid("PasswordLabel", "LabelControl", "Password",
                                  2, 0, "The VNC password.", False)
    scriptDialog.AddControlToGrid("PasswordBox",
                                  "PasswordControl",
                                  "",
                                  2,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid("PortLabel", "LabelControl", "VNC Port", 3,
                                  0, "The VNC port.", False)
    scriptDialog.AddRangeControlToGrid("PortBox",
                                       "RangeControl",
                                       5900,
                                       1,
                                       65536,
                                       0,
                                       1,
                                       3,
                                       1,
                                       expand=False)
    scriptDialog.AddSelectionControlToGrid(
        "RememberPasswordBox", "CheckBoxControl", False, "Remember Password",
        3, 2, "Enable to remember your password between sessions.")

    scriptDialog.AddSelectionControlToGrid(
        "HideWindowBox",
        "CheckBoxControl",
        False,
        "Hide this window if running from a right-click Scripts menu",
        4,
        0,
        "If enabled, this window will be hidden if run from a right-click menu in the Monitor. You can always run it from the main Scripts menu to see this window.",
        colSpan=3)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("DummyLabel1", 0, 0)
    startButton = scriptDialog.AddControlToGrid("SelectButton",
                                                "ButtonControl",
                                                "OK",
                                                0,
                                                1,
                                                expand=False)
    startButton.ValueModified.connect(connectWithVNC)
    closeButton = scriptDialog.AddControlToGrid("CancelButton",
                                                "ButtonControl",
                                                "Cancel",
                                                0,
                                                2,
                                                expand=False)
    closeButton.ValueModified.connect(cancelButtonPressed)
    scriptDialog.EndGrid()

    settings = ("SlavesBox", "PortBox", "ExeBox", "RememberPasswordBox",
                "PasswordBox", "HideWindowBox")
    scriptDialog.LoadSettings(getSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, getSettingsFilename())

    if not scriptDialog.GetValue("RememberPasswordBox"):
        scriptDialog.SetValue("PasswordBox", "")

    showWindow = True
    if len(args) > 0:
        scriptDialog.SetValue("SlavesBox", args[0])

        if scriptDialog.GetValue("HideWindowBox"):
            showWindow = False

    if showWindow:
        scriptDialog.ShowDialog(True)
    else:
        connectWithVNC()
예제 #6
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)
def __main__( *args ):
    global scriptDialog
    global settings
    global defaultLocation
    global outputBox
    global sceneBox
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

    defaultLocation = ""
    
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit Maya Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'MayaBatch' ) )
    
    scriptDialog.AddTabControl("Tabs", 0, 0)
    
    scriptDialog.AddTabPage("Job Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator1", "SeparatorControl", "Job Description", 0, 0, colSpan=2 )
    
    scriptDialog.AddControlToGrid( "NameLabel", "LabelControl", "Job Name", 1, 0, "The name of your job. This is optional, and if left blank, it will default to 'Untitled'.", False )
    scriptDialog.AddControlToGrid( "NameBox", "TextControl", "Untitled", 1, 1 )

    scriptDialog.AddControlToGrid( "CommentLabel", "LabelControl", "Comment", 2, 0, "A simple description of your job. This is optional and can be left blank.", False )
    scriptDialog.AddControlToGrid( "CommentBox", "TextControl", "", 2, 1 )

    scriptDialog.AddControlToGrid( "DepartmentLabel", "LabelControl", "Department", 3, 0, "The department you belong to. This is optional and can be left blank.", False )
    scriptDialog.AddControlToGrid( "DepartmentBox", "TextControl", "", 3, 1 )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator2", "SeparatorControl", "Job Options", 0, 0, colSpan=3 )

    scriptDialog.AddControlToGrid( "PoolLabel", "LabelControl", "Pool", 1, 0, "The pool that your job will be submitted to.", False )
    scriptDialog.AddControlToGrid( "PoolBox", "PoolComboControl", "none", 1, 1 )

    scriptDialog.AddControlToGrid( "SecondaryPoolLabel", "LabelControl", "Secondary Pool", 2, 0, "The secondary pool lets you specify a Pool to use if the primary Pool does not have any available Slaves.", False )
    scriptDialog.AddControlToGrid( "SecondaryPoolBox", "SecondaryPoolComboControl", "", 2, 1 )

    scriptDialog.AddControlToGrid( "GroupLabel", "LabelControl", "Group", 3, 0, "The group that your job will be submitted to.", False )
    scriptDialog.AddControlToGrid( "GroupBox", "GroupComboControl", "none", 3, 1 )

    scriptDialog.AddControlToGrid( "PriorityLabel", "LabelControl", "Priority", 4, 0, "A job can have a numeric priority ranging from 0 to 100, where 0 is the lowest priority and 100 is the highest priority.", False )
    scriptDialog.AddRangeControlToGrid( "PriorityBox", "RangeControl", RepositoryUtils.GetMaximumPriority() / 2, 0, RepositoryUtils.GetMaximumPriority(), 0, 1, 4, 1 )

    scriptDialog.AddControlToGrid( "TaskTimeoutLabel", "LabelControl", "Task Timeout", 5, 0, "The number of minutes a slave has to render a task for this job before it requeues it. Specify 0 for no limit.", False )
    scriptDialog.AddRangeControlToGrid( "TaskTimeoutBox", "RangeControl", 0, 0, 1000000, 0, 1, 5, 1 )
    scriptDialog.AddSelectionControlToGrid( "AutoTimeoutBox", "CheckBoxControl", False, "Enable Auto Task Timeout", 5, 2, "If the Auto Task Timeout is properly configured in the Repository Options, then enabling this will allow a task timeout to be automatically calculated based on the render times of previous frames for the job." )

    scriptDialog.AddControlToGrid( "ConcurrentTasksLabel", "LabelControl", "Concurrent Tasks", 6, 0, "The number of tasks that can render concurrently on a single slave. This is useful if the rendering application only uses one thread to render and your slaves have multiple CPUs.", False )
    scriptDialog.AddRangeControlToGrid( "ConcurrentTasksBox", "RangeControl", 1, 1, 16, 0, 1, 6, 1 )
    scriptDialog.AddSelectionControlToGrid( "LimitConcurrentTasksBox", "CheckBoxControl", True, "Limit Tasks To Slave's Task Limit", 6, 2, "If you limit the tasks to a slave's task limit, then by default, the slave won't dequeue more tasks then it has CPUs. This task limit can be overridden for individual slaves by an administrator." )

    scriptDialog.AddControlToGrid( "MachineLimitLabel", "LabelControl", "Machine Limit", 7, 0, "", False )
    scriptDialog.AddRangeControlToGrid( "MachineLimitBox", "RangeControl", 0, 0, 1000000, 0, 1, 7, 1 )
    scriptDialog.AddSelectionControlToGrid( "IsBlacklistBox", "CheckBoxControl", False, "Machine List Is A Blacklist", 7, 2, "" )

    scriptDialog.AddControlToGrid( "MachineListLabel", "LabelControl", "Machine List", 8, 0, "Use the Machine Limit to specify the maximum number of machines that can render your job at one time. Specify 0 for no limit.", False )
    scriptDialog.AddControlToGrid( "MachineListBox", "MachineListControl", "", 8, 1, colSpan=2 )

    scriptDialog.AddControlToGrid( "LimitGroupLabel", "LabelControl", "Limits", 9, 0, "The Limits that your job requires.", False )
    scriptDialog.AddControlToGrid( "LimitGroupBox", "LimitGroupControl", "", 9, 1, colSpan=2 )

    scriptDialog.AddControlToGrid( "DependencyLabel", "LabelControl", "Dependencies", 10, 0, "Specify existing jobs that this job will be dependent on. This job will not start until the specified dependencies finish rendering.", False )
    scriptDialog.AddControlToGrid( "DependencyBox", "DependencyControl", "", 10, 1, colSpan=2 )

    scriptDialog.AddControlToGrid( "OnJobCompleteLabel", "LabelControl", "On Job Complete", 11, 0, "If desired, you can automatically archive or delete the job when it completes.", False )
    scriptDialog.AddControlToGrid( "OnJobCompleteBox", "OnJobCompleteControl", "Nothing", 11, 1 )
    scriptDialog.AddSelectionControlToGrid( "SubmitSuspendedBox", "CheckBoxControl", False, "Submit Job As Suspended", 11, 2, "If enabled, the job will submit in the suspended state. This is useful if you don't want the job to start rendering right away. Just resume it from the Monitor when you want it to render." )
    scriptDialog.EndGrid()

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

    scriptDialog.AddControlToGrid("ProjectLabel","LabelControl","Project Directory", 1, 0, "The Maya project folder (this should be a shared folder on the network).", False)
    projBox = scriptDialog.AddSelectionControlToGrid("ProjectBox","FolderBrowserControl","","", 1, 1, colSpan=3)
    projBox.ValueModified.connect(SetDefaultLocation)
    defaultLocation = scriptDialog.GetValue( "ProjectBox" );

    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "Maya File", 2, 0, "The scene file to be rendered.", False )
    sceneBox = scriptDialog.AddSelectionControlToGrid( "SceneBox", "MultiFileBrowserControl", "", "Maya Files (*.ma *.mb)", 2, 1, colSpan=3, browserLocation=defaultLocation )

    scriptDialog.AddControlToGrid("OutputLabel","LabelControl","Output Folder",3, 0, "The folder where your output will be dumped (this should be a shared folder on the network).", False)
    outputBox = scriptDialog.AddSelectionControlToGrid("OutputBox","FolderBrowserControl", "","", 3, 1, colSpan=3, browserLocation=defaultLocation)

    scriptDialog.AddControlToGrid( "FramesLabel", "LabelControl", "Frame List", 4, 0, "The list of frames to render.", False )
    scriptDialog.AddControlToGrid( "FramesBox", "TextControl", "", 4, 1 )
    scriptDialog.AddSelectionControlToGrid( "SubmitSceneBox", "CheckBoxControl", False, "Submit Maya Scene File", 4, 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.", colSpan=2 )

    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( "RendererLabel", "LabelControl", "Renderer", 5, 2, "The Maya renderer to use. If you select 'File', the renderer defined in the scene file will be used, but renderer specific options will not be set by Deadline.", False )
    rendererBox = scriptDialog.AddComboControlToGrid( "RendererBox", "ComboControl", "File", ("File","3delight","Arnold","FinalRender","Gelato","Maxwell","MayaKrakatoa","MayaHardware","MayaHardware2","MayaSoftware","MayaVector","MentalRay","OctaneRender","Redshift","Renderman","RendermanRIS","Renderman22","Turtle","Vray","Iray"), 5, 3 )
    rendererBox.ValueModified.connect( RendererChanged )

    scriptDialog.AddControlToGrid( "VersionLabel", "LabelControl", "Version", 6, 0, "The version of Maya to render with.", False )
    versionBox = scriptDialog.AddComboControlToGrid( "VersionBox", "ComboControl", "2019", ("2010","2011","2011.5","2012","2012.5","2013","2013.5","2014","2014.5","2015","2015.5","2016","2016.5","2017","2017.5","2018","2019"), 6, 1 )
    versionBox.ValueModified.connect( VersionChanged )
    scriptDialog.AddControlToGrid( "BuildLabel", "LabelControl", "Build To Force", 6, 2, "You can force 32 or 64 bit rendering with this option.", False )
    scriptDialog.AddComboControlToGrid( "BuildBox", "ComboControl", "None", ( "None", "32bit", "64bit" ), 6, 3 )
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage( "Advanced Options" )

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator5", "SeparatorControl", "Advanced Maya Options", 0, 0, colSpan=3 )

    scriptDialog.AddControlToGrid( "CpusLabel", "LabelControl", "Threads", 1, 0, "The number of threads to use for rendering.", False )
    scriptDialog.AddRangeControlToGrid( "CpusBox", "RangeControl", 0, 0, 256, 0, 1, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "LocalRenderingBox", "CheckBoxControl", False, "Enable Local Rendering", 1, 2, "If enabled, the frames will be rendered locally, and then copied to their final network location." )

    scriptDialog.AddControlToGrid( "FrameNumberOffsetLabel", "LabelControl", "Frame Number Offset", 2, 0, "Uses Maya's frame renumbering option to offset the frames that are rendered.", False )
    scriptDialog.AddRangeControlToGrid( "FrameNumberOffsetBox", "RangeControl", 0, -100000, 100000, 0, 1, 2, 1 )
    scriptDialog.AddSelectionControlToGrid( "StrictErrorCheckingBox", "CheckBoxControl", True, "Strict Error Checking", 2, 2, "Enable this option to have Deadline fail Maya jobs when Maya prints out any 'error' or 'warning' messages. If disabled, Deadline will only fail on messages that it knows are fatal." )

    mayaBatchBox = scriptDialog.AddSelectionControlToGrid( "MayaBatchBox", "CheckBoxControl", True, "Use MayaBatch Plugin", 3, 0, "This uses the MayaBatch plugin. It keeps the scene loaded in memory between frames, which reduces the overhead of rendering the job.", False )
    mayaBatchBox.ValueModified.connect(MayaBatchChanged)
    scriptDialog.AddSelectionControlToGrid( "Ignore211Box", "CheckBoxControl", False, "Ignore Error Code 211", 3, 1, "This allows a MayaCmd task to finish successfully even if Maya returns the non-zero error code 211. Sometimes Maya will return this error code even after successfully saving the rendered images.", False )
    scriptDialog.AddSelectionControlToGrid( "SkipExistingBox", "CheckBoxControl", False, "Skip Existing Frames", 3, 2, "If enabled, Maya will skip rendering existing frames. Only supported for Maya Softwate, Maya Hardware, Maya Vector, and Mentay Ray." )

    scriptDialog.AddControlToGrid( "StartupScriptLabel", "LabelControl", "Startup Script", 4, 0, "Maya will source the specified script file on startup.", False )
    scriptDialog.AddSelectionControlToGrid( "StartupScriptBox", "FileBrowserControl", "", "Melscript Files (*.mel);;Python Files (*.py);;All Files (*)", 4, 1, colSpan=2 )
    
    overrideSizeBox = scriptDialog.AddSelectionControlToGrid( "OverrideSizeBox", "CheckBoxControl", False, "Override Resolution", 5, 0, "Enable this option to override the Width and Height (respectively) of the rendered images.", colSpan=1)
    scriptDialog.AddRangeControlToGrid( "WidthSizeRange", "RangeControl", 0, 0, 1000000, 0, 1, 5, 1)
    scriptDialog.AddRangeControlToGrid( "HeightSizeRange", "RangeControl", 0, 0, 1000000, 0, 1, 5, 2)
    overrideSizeBox.ValueModified.connect(OverrideSizeChanged)
    OverrideSizeChanged()
    
    scaleBox = scriptDialog.AddSelectionControlToGrid( "ScaleBox", "CheckBoxControl", False, "Scale Resolution", 6, 0, "Enable this option to scale the size of the rendered images to the specified percentage.", colSpan=1)
    scriptDialog.AddRangeControlToGrid( "ScaleRange", "RangeControl", 100, 0.01, 1000, 2, 1, 6, 1)
    scaleBox.ValueModified.connect(ScaleChanged)
    ScaleChanged()

    scriptDialog.AddSelectionControlToGrid( "FileUsesLegacyRenderLayersBox", "CheckBoxControl", False, "File Uses Legacy Render Layers", 6, 2, "As of Maya 2016.5, Autodesk has added a new render layer system (render setup) that is incompatible with the older version (legacy). This value specifies which render layers system this file uses." )
    
    scriptDialog.AddSelectionControlToGrid( "RenderSetupIncludeLightsBox", "CheckBoxControl", True, "Include all lights in each Render Layer", 7, 0, "If enabled, all lights in the scene will automatically be added to every render setup.", colSpan=2 )
    
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator4", "SeparatorControl", "Command Line Options", 0, 0, colSpan=2 )

    scriptDialog.AddControlToGrid( "CommandLineLabel", "LabelControl", "Additional Arguments", 1, 0, "Specify additional command line arguments you would like to pass to the renderer.", False )
    scriptDialog.AddControlToGrid( "CommandLineBox", "TextControl", "", 1, 1 )

    scriptDialog.AddSelectionControlToGrid( "UseCommandLineBox", "CheckBoxControl", False, "Use Only Additional Command Line Arguments", 2, 0, "Enable this option to only use the command line arguments specified above when rendering.", colSpan=2 )

    scriptDialog.AddControlToGrid( "Separator7", "SeparatorControl", "Script Job Options", 3, 0, colSpan=2 )
    scriptDialog.AddControlToGrid( "ScriptJobLabel1", "LabelControl", "Script Jobs use the MayaBatch plugin, and do not force a particular render.", 4, 0, colSpan=2 )
    scriptJobBox = scriptDialog.AddSelectionControlToGrid( "ScriptJobBox", "CheckBoxControl", False, "Submit A Maya Script Job (melscript or python)", 5, 0, "Enable this option to submit a custom melscript or python script job. This script will be applied to the scene file that is specified.", colSpan=2 )
    scriptJobBox.ValueModified.connect(ScriptJobChanged)

    scriptDialog.AddControlToGrid( "ScriptFileLabel", "LabelControl", "Script File", 6, 0, "The script file to use.", False )
    scriptDialog.AddSelectionControlToGrid( "ScriptFileBox", "FileBrowserControl", "", "Maya Script Files (*.mel *.py)", 6, 1 )

    scriptDialog.AddControlToGrid( "ScriptJobLabel2", "LabelControl", "All other options on this tab page are ignored, except for the Strict Error Checking option.", 7, 0, colSpan=2 )
    
    scriptDialog.EndGrid()
    
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage( "Renderer Options" )
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "ArnoldSeparator", "SeparatorControl", "Arnold Options", 0, 0, colSpan=3 )

    scriptDialog.AddControlToGrid( "MayaToArnoldVersionLabel", "LabelControl", "Maya To Arnold Major Version", 1, 0, "Specify the version number of the Maya To Arnold plugin that will be used.", False )
    scriptDialog.AddComboControlToGrid( "MayaToArnoldVersionBox", "ComboControl", "2", ("1","2","3"), 1, 1 )

    scriptDialog.AddControlToGrid( "ArnoldVerboseLabel", "LabelControl", "Arnold Verbosity", 2, 0, "Set the verbosity level for Arnold renders. Note that verbosity levels are different depending on the Maya To Arnold version.", False )
    scriptDialog.AddComboControlToGrid( "ArnoldVerboseBox", "ComboControl", "1", ("0","1","2", "3"), 2, 1 )
    scriptDialog.AddHorizontalSpacerToGrid("ROHSpacer1", 2, 2)

    scriptDialog.AddControlToGrid( "MentalRaySeparator", "SeparatorControl", "Mental Ray Options", 3, 0, colSpan=3 )

    scriptDialog.AddControlToGrid( "MentalRayVerboseLabel", "LabelControl", "Mental Ray Verbosity", 4, 0, "Set the verbosity level for Mental Ray renders.", False )
    scriptDialog.AddComboControlToGrid( "MentalRayVerboseBox", "ComboControl", "Progress Messages", ("No Messages","Fatal Messages Only","Error Messages","Warning Messages","Info Messages","Progress Messages","Detailed Messages (Debug)"), 4, 1 )

    autoMemoryLimitBox = scriptDialog.AddSelectionControlToGrid( "AutoMemoryLimitBox", "CheckBoxControl", True, "Auto Memory Limit", 5, 0, "If enabled, Mental Ray will automatically detect the optimal memory limit when rendering.", False )
    autoMemoryLimitBox.ValueModified.connect(AutoMemoryLimitChanged)

    scriptDialog.AddControlToGrid( "MemoryLimitLabel", "LabelControl", "Memory Limit (in MB)", 6, 0, "Soft limit (in MB) for the memory used by Mental Ray (specify 0 for unlimited memory).", False )
    scriptDialog.AddRangeControlToGrid( "MemoryLimitBox", "RangeControl", 0, 0, 100000, 0, 1, 6, 1 )

    scriptDialog.AddControlToGrid( "VRaySeparator", "SeparatorControl", "VRay Options", 7, 0, colSpan=3 )

    vrayAutoMemoryBox = scriptDialog.AddSelectionControlToGrid( "VRayAutoMemoryBox", "CheckBoxControl", False, "Auto Memory Limit Detection (Requires the MayaBatch Plugin)", 8, 0, "If enabled, Deadline will automatically detect the dynamic memory limit for VRay prior to rendering.", colSpan=2 )
    vrayAutoMemoryBox.ValueModified.connect(VRayAutoMemoryChanged)

    scriptDialog.AddControlToGrid( "VRayMemoryLimitLabel", "LabelControl", "Memory Buffer (in MB)", 9, 0, "Deadline subtracts this value from the system's unused memory to determine the dynamic memory limit for VRay.", False )
    scriptDialog.AddRangeControlToGrid( "VRayMemoryLimitBox", "RangeControl", 500, 0, 100000, 0, 1, 9, 1 )
    
    scriptDialog.AddControlToGrid( "IRaySeparator", "SeparatorControl", "IRay Options", 10, 0, colSpan=3 )
    
    irayUseCPUsBox = scriptDialog.AddSelectionControlToGrid( "IRayUseCPUsBox", "CheckBoxControl", True, "Render Using CPUs", 11, 0, "If enabled, CPUs will be used to render the scene in addition to GPUs." )
    irayUseCPUsBox.ValueModified.connect(IRayUseCPUsChanged)
    scriptDialog.AddControlToGrid( "IRayCPULoadLabel", "LabelControl", "CPU Load", 11, 1, "The maximum load on the CPU for each task.", False )
    scriptDialog.AddRangeControlToGrid( "IRayCPULoadBox", "RangeControl", 1.0, 4.0, 8, 1, 0.1, 11, 2 )
    
    scriptDialog.AddControlToGrid( "IRayMaxSamplesLabel", "LabelControl", "Max Samples", 12, 0, "The Maximum number of samples per frame.", False )
    scriptDialog.AddRangeControlToGrid( "IRayMaxSamplesBox", "RangeControl", 1, 1, 4096, 0, 1, 12, 1 )
    
    scriptDialog.AddControlToGrid( "GPUSeparator", "SeparatorControl", "GPU Options", 13, 0, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "GPUsPerTaskLabel", "LabelControl", "GPUs Per Task", 14, 0, "The number of GPUs to use per task. If set to 0, the default number of GPUs will be used, unless 'Select GPU Devices' Id's have been defined.", False )
    GPUsPerTaskBox = scriptDialog.AddRangeControlToGrid( "GPUsPerTaskBox", "RangeControl", 0, 0, 16, 0, 1, 14, 1 )
    GPUsPerTaskBox.ValueModified.connect(GPUsPerTaskChanged)

    scriptDialog.AddControlToGrid( "GPUsSelectDevicesLabel", "LabelControl", "Select GPU Devices", 15, 0, "A comma separated list of the GPU devices to use specified by device Id. 'GPUs Per Task' will be ignored.", False )
    GPUsSelectDevicesBox = scriptDialog.AddControlToGrid( "GPUsSelectDevicesBox", "TextControl", "", 15, 1 )
    GPUsSelectDevicesBox.ValueModified.connect(GPUsSelectDevicesChanged)
    
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "MayaMonitor", 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 = ( "DepartmentBox","CategoryBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","MachineLimitBox","IsBlacklistBox","MachineListBox","LimitGroupBox","SceneBox","FramesBox","ChunkSizeBox","VersionBox","BuildBox","ProjectBox", "OutputBox", "RendererBox", "SubmitSceneBox", "MayaBatchBox","LocalRenderingBox","CpusBox","StrictErrorCheckingBox","StartupScriptBox","OverrideSizeBox","WidthSizeRange","HeightSizeRange","FileUsesLegacyRenderLayersBox","CommandLineBox","UseCommandLineBox","RenderSetupIncludeLightsBox" )
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    GPUsPerTaskChanged()
    GPUsSelectDevicesChanged()
    IRayUseCPUsChanged()
    VersionChanged()
    RendererChanged()
    MayaBatchChanged()
    AutoMemoryLimitChanged()
    VRayAutoMemoryChanged()
    ScriptJobChanged()
    
    scriptDialog.ShowDialog( False )
예제 #8
0
def __main__():
    global scriptDialog
    global portNumberInfoLabel
    global settings

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Setup Nuke Frame Server Slaves With Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('NukeFrameServer'))

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator1",
                                  "SeparatorControl",
                                  "Job Description",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "NameLabel", "LabelControl", "Job Name", 1, 0,
        "The name of your job. This is optional, and if left blank, it will default to 'Untitled'.",
        False)
    scriptDialog.AddControlToGrid("NameBox",
                                  "TextControl",
                                  "Untitled",
                                  1,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "CommentLabel", "LabelControl", "Comment", 2, 0,
        "A simple description of your job. This is optional and can be left blank.",
        False)
    scriptDialog.AddControlToGrid("CommentBox",
                                  "TextControl",
                                  "",
                                  2,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "DepartmentLabel", "LabelControl", "Department", 3, 0,
        "The department you belong to. This is optional and can be left blank.",
        False)
    scriptDialog.AddControlToGrid("DepartmentBox",
                                  "TextControl",
                                  "",
                                  3,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid("Separator2",
                                  "SeparatorControl",
                                  "Job Options",
                                  4,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "PoolLabel", "LabelControl", "Pool", 5, 0,
        "The pool that your job will be submitted to.", False)
    scriptDialog.AddControlToGrid("PoolBox", "PoolComboControl", "none", 5, 1)

    scriptDialog.AddControlToGrid(
        "SecondaryPoolLabel", "LabelControl", "Secondary Pool", 6, 0,
        "The secondary pool lets you specify a Pool to use if the primary Pool does not have any available Slaves.",
        False)
    scriptDialog.AddControlToGrid("SecondaryPoolBox",
                                  "SecondaryPoolComboControl", "", 6, 1)

    scriptDialog.AddControlToGrid(
        "GroupLabel", "LabelControl", "Group", 7, 0,
        "The group that your job will be submitted to.", False)
    scriptDialog.AddControlToGrid("GroupBox", "GroupComboControl", "none", 7,
                                  1)

    scriptDialog.AddControlToGrid(
        "PriorityLabel", "LabelControl", "Priority", 8, 0,
        "A job can have a numeric priority ranging from 0 to 100, where 0 is the lowest priority and 100 is the highest priority.",
        False)
    scriptDialog.AddRangeControlToGrid(
        "PriorityBox", "RangeControl",
        RepositoryUtils.GetMaximumPriority() / 2, 0,
        RepositoryUtils.GetMaximumPriority(), 0, 1, 8, 1)

    scriptDialog.AddControlToGrid(
        "TaskTimeoutLabel", "LabelControl", "Task Timeout", 9, 0,
        "The number of minutes a slave has to render a task for this job before it Completes it. Specify 0 for no limit.",
        False)
    scriptDialog.AddRangeControlToGrid("TaskTimeoutBox", "RangeControl", 0, 0,
                                       1000000, 0, 1, 9, 1)

    scriptDialog.AddControlToGrid("LimitGroupLabel", "LabelControl", "Limits",
                                  10, 0, "The Limits that your job requires.",
                                  False)
    scriptDialog.AddControlToGrid("LimitGroupBox",
                                  "LimitGroupControl",
                                  "",
                                  10,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "MachineListLabel", "LabelControl", "Machine List", 11, 0,
        "The whitelisted or blacklisted list of machines.", False)
    scriptDialog.AddControlToGrid("MachineListBox",
                                  "MachineListControl",
                                  "",
                                  11,
                                  1,
                                  colSpan=2)

    scriptDialog.AddSelectionControlToGrid(
        "IsBlacklistBox", "CheckBoxControl", False,
        "Machine List Is A Blacklist", 12, 1,
        "You can force the job to render on specific machines by using a whitelist, or you can avoid specific machines by using a blacklist."
    )
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSuspendedBox", "CheckBoxControl", False,
        "Submit Job As Suspended", 12, 2,
        "If enabled, the job will submit in the suspended state. This is useful if you don't want the job to start rendering right away. Just resume it from the Monitor when you want it to render."
    )

    scriptDialog.AddSelectionControlToGrid(
        "IsInterruptible", "CheckBoxControl", False, "Job Is Interruptible",
        13, 1,
        "If enabled, this job can be interrupted by a higher priority job during rendering. Note that if a slave moves to a higher priority job, it will not be able to join this render again."
    )

    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Nuke Studio Frame Server Options",
                                  14,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "MaximumServersLabel", "LabelControl", "Maximum Servers", 15, 0,
        "The maximum number of Frame Server machines to reserve for distributed rendering.",
        False)
    scriptDialog.AddRangeControlToGrid("MaximumServersBox", "RangeControl", 10,
                                       1, 100, 0, 1, 15, 1)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version",
                                  16, 0, "The version of the application.",
                                  False)
    scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "11.3",
        ("9.0", "10.0", "10.5", "11.0", "11.1", "11.2", "11.3"), 16, 1)

    scriptDialog.AddControlToGrid(
        "HostNameLabel", "LabelControl", "Host", 17, 0,
        "IP Address or the Host Name of the workstation that will start the render.",
        False)
    scriptDialog.AddControlToGrid("HostNameBox",
                                  "TextControl",
                                  "",
                                  17,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid("PortNumberLabel", "LabelControl",
                                  "Port Number", 18, 0,
                                  "The TCP port to use. Defaults to 5560.",
                                  False)
    scriptDialog.AddRangeControlToGrid("PortNumberBox", "RangeControl", 5560,
                                       1024, 65535, 0, 1, 18, 1)

    scriptDialog.AddControlToGrid(
        "WorkerLabel", "LabelControl", "Worker Count", 19, 0,
        "The number of workers to start on each machine.", False)
    scriptDialog.AddRangeControlToGrid("WorkerBox", "RangeControl", 2, 1, 100,
                                       0, 1, 19, 1)

    scriptDialog.AddControlToGrid(
        "WorkerThreadLabel", "LabelControl", "Worker Threads", 20, 0,
        "The number of threads to start for each worker.", False)
    scriptDialog.AddRangeControlToGrid("WorkerThreadBox", "RangeControl", 1, 1,
                                       256, 0, 1, 20, 1)

    scriptDialog.AddControlToGrid(
        "WorkerMemLabel", "LabelControl", "Worker Memory", 21, 0,
        "The amount of memory to reserve for each worker machine.", False)
    scriptDialog.AddRangeControlToGrid("WorkerMemBox", "RangeControl", 1024,
                                       256, 65536, 0, 1, 21, 1)

    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 1)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 2,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                3,
                                                expand=False)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "TaskTimeoutBox", "MachineLimitBox",
                "IsBlacklistBox", "MachineListBox", "LimitGroupBox",
                "MaximumServersBox", "VersionBox", "PortNumberBox",
                "IsInterruptible", "HostNameBox", "WorkerBox",
                "WorkerThreadBox", "WorkerMemBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    if scriptDialog.GetValue("HostNameBox") == "":
        scriptDialog.SetValue("HostNameBox", socket.getfqdn())

    scriptDialog.ShowDialog(False)
예제 #9
0
def __main__():
    global AFTER_EFFECTS_VERSIONS
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    
    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle("Submit After Effects Job To Deadline")
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'AfterEffects' ) )

    scriptDialog.AddTabControl("Tabs", 0, 0)
    
    scriptDialog.AddTabPage("Job Options")
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator1", "SeparatorControl", "Job Description", 0, 0 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "NameLabel", "LabelControl", "Job Name", 0, 0, "The name of your job. This is optional, and if left blank, it will default to 'Untitled'.", False )
    scriptDialog.AddControlToGrid( "NameBox", "TextControl", "Untitled", 0, 1 )

    scriptDialog.AddControlToGrid( "CommentLabel", "LabelControl", "Comment", 1, 0, "A simple description of your job. This is optional and can be left blank.", False )
    scriptDialog.AddControlToGrid( "CommentBox", "TextControl", "", 1, 1 )

    scriptDialog.AddControlToGrid( "DepartmentLabel", "LabelControl", "Department", 2, 0, "The department you belong to. This is optional and can be left blank.", False )
    scriptDialog.AddControlToGrid( "DepartmentBox", "TextControl", "", 2, 1 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator2", "SeparatorControl", "Job Options", 0, 0 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "PoolLabel", "LabelControl", "Pool", 0, 0, "The pool that your job will be submitted to.", False )
    scriptDialog.AddControlToGrid( "PoolBox", "PoolComboControl", "none", 0, 1 )

    scriptDialog.AddControlToGrid( "SecondaryPoolLabel", "LabelControl", "Secondary Pool", 1, 0, "The secondary pool lets you specify a Pool to use if the primary Pool does not have any available Slaves.", False )
    scriptDialog.AddControlToGrid( "SecondaryPoolBox", "SecondaryPoolComboControl", "", 1, 1 )

    scriptDialog.AddControlToGrid( "GroupLabel", "LabelControl", "Group", 2, 0, "The group that your job will be submitted to.", False )
    scriptDialog.AddControlToGrid( "GroupBox", "GroupComboControl", "none", 2, 1 )

    scriptDialog.AddControlToGrid( "PriorityLabel", "LabelControl", "Priority", 3, 0, "A job can have a numeric priority ranging from 0 to 100, where 0 is the lowest priority and 100 is the highest priority.", False )
    scriptDialog.AddRangeControlToGrid( "PriorityBox", "RangeControl", RepositoryUtils.GetMaximumPriority() / 2, 0, RepositoryUtils.GetMaximumPriority(), 0, 1, 3, 1 )

    scriptDialog.AddControlToGrid( "TaskTimeoutLabel", "LabelControl", "Task Timeout", 4, 0, "The number of minutes a slave has to render a task for this job before it requeues it. Specify 0 for no limit.", False )
    scriptDialog.AddRangeControlToGrid( "TaskTimeoutBox", "RangeControl", 0, 0, 1000000, 0, 1, 4, 1 )
    scriptDialog.AddSelectionControlToGrid( "AutoTimeoutBox", "CheckBoxControl", False, "Enable Auto Task Timeout", 4, 2, "If the Auto Task Timeout is properly configured in the Repository Options, then enabling this will allow a task timeout to be automatically calculated based on the render times of previous frames for the job. " )

    scriptDialog.AddControlToGrid( "ConcurrentTasksLabel", "LabelControl", "Concurrent Tasks", 5, 0, "The number of tasks that can render concurrently on a single slave. This is useful if the rendering application only uses one thread to render and your slaves have multiple CPUs.", False )
    scriptDialog.AddRangeControlToGrid( "ConcurrentTasksBox", "RangeControl", 1, 1, 16, 0, 1, 5, 1 )
    scriptDialog.AddSelectionControlToGrid( "LimitConcurrentTasksBox", "CheckBoxControl", True, "Limit Tasks To Slave's Task Limit", 5, 2, "If you limit the tasks to a slave's task limit, then by default, the slave won't dequeue more tasks then it has CPUs. This task limit can be overridden for individual slaves by an administrator." )

    scriptDialog.AddControlToGrid( "MachineLimitLabel", "LabelControl", "Machine Limit", 6, 0, "Use the Machine Limit to specify the maximum number of machines that can render your job at one time. Specify 0 for no limit.", False )
    scriptDialog.AddRangeControlToGrid( "MachineLimitBox", "RangeControl", 0, 0, 1000000, 0, 1, 6, 1 )
    scriptDialog.AddSelectionControlToGrid( "IsBlacklistBox", "CheckBoxControl", False, "Machine List Is A Blacklist", 6, 2, "You can force the job to render on specific machines by using a whitelist, or you can avoid specific machines by using a blacklist." )

    scriptDialog.AddControlToGrid( "MachineListLabel", "LabelControl", "Machine List", 7, 0, "The whitelisted or blacklisted list of machines.", False )
    scriptDialog.AddControlToGrid( "MachineListBox", "MachineListControl", "", 7, 1, colSpan=2 )

    scriptDialog.AddControlToGrid( "LimitGroupLabel", "LabelControl", "Limit Groups", 8, 0, "The Limits that your job requires.", False )
    scriptDialog.AddControlToGrid( "LimitGroupBox", "LimitGroupControl", "", 8, 1, colSpan=2 )

    scriptDialog.AddControlToGrid( "DependencyLabel", "LabelControl", "Dependencies", 9, 0, "Specify existing jobs that this job will be dependent on. This job will not start until the specified dependencies finish rendering.", False )
    scriptDialog.AddControlToGrid( "DependencyBox", "DependencyControl", "", 9, 1, colSpan=2 )

    scriptDialog.AddControlToGrid( "OnJobCompleteLabel", "LabelControl", "On Job Complete", 10, 0, "If desired, you can automatically archive or delete the job when it completes.", False )
    scriptDialog.AddControlToGrid( "OnJobCompleteBox", "OnJobCompleteControl", "Nothing", 10, 1 )
    scriptDialog.AddSelectionControlToGrid( "SubmitSuspendedBox", "CheckBoxControl", False, "Submit Job As Suspended", 10, 2, "If enabled, the job will submit in the suspended state. This is useful if you don't want the job to start rendering right away. Just resume it from the Monitor when you want it to render." )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator3", "SeparatorControl", "After Effects Options", 0, 0 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "After Effects File", 0, 0, "The project file to render.", False )
    scriptDialog.AddSelectionControlToGrid( "SceneBox", "FileBrowserControl", "", "After Effects Files (*.aep *.aepx)", 0, 1, colSpan=2 )

    scriptDialog.AddControlToGrid("CompLabel", "LabelControl", "Composition", 1, 0, "The composition in the project file to render. If left blank, the entire render queue will be rendered as a single task.", False)
    
    compBox = scriptDialog.AddControlToGrid("CompBox", "TextControl", "", 1, 1, colSpan=2 )
    compBox.ValueModified.connect(CompChanged)
    
    scriptDialog.AddControlToGrid("OutputLabel","LabelControl","Output (optional)", 2, 0, "Override the output path for the composition. This is optional, and can be left blank.", False)
    scriptDialog.AddSelectionControlToGrid("OutputBox","FileSaverControl","", "All Files (*)",2, 1, colSpan=2 )

    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( "MultiProcess", "CheckBoxControl", False, "Use Multi-Process Rendering", 4, 2, "Enable to use multiple processes to render multiple frames simultaneously." )

    scriptDialog.AddControlToGrid( "VersionLabel", "LabelControl", "Version", 5, 0 , "The version of After Effects to render with.", False )
    versionBox = scriptDialog.AddComboControlToGrid( "VersionBox", "ComboControl", next(reversed(AFTER_EFFECTS_VERSIONS)), AFTER_EFFECTS_VERSIONS.keys(), 5, 1 )
    versionBox.ValueModified.connect(VersionChanged)

    scriptDialog.AddSelectionControlToGrid( "SubmitSceneBox", "CheckBoxControl", False, "Submit Project File", 5, 2, "If this option is enabled, the project file you want to render will be submitted with the job, and then copied locally to the slave machine during rendering." )
    scriptDialog.EndGrid()
    
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage( "Advanced Options" )
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator9", "SeparatorControl", "Multi-Machine Rendering", 0, 0, colSpan=4 )
    scriptDialog.AddControlToGrid( "MultiMachineLabel", "LabelControl", "Note that \"Skip existing frames\" must be enabled for each comp", 1, 0, colSpan=3)
    
    multiMachineCheckBox = scriptDialog.AddSelectionControlToGrid("MultiMachineBox", "CheckBoxControl", False, "Enable Multi-Machine Rendering", 2, 0, "This mode submits a special job where each task represents the full frame range. The slaves will all work on the same frame range, but because 'Skip existing frames' is enabled for the comps, they will skip frames that other slaves are already rendering.")
    multiMachineCheckBox.ValueModified.connect(MultiMachineChanged)

    scriptDialog.AddControlToGrid( "MultiMachineTasksLabel", "LabelControl", "Number Of Machines", 3, 0, "The number of slaves that can work on this job at the same time. Each slave gets a task, which represents the full frame range, and they will work together until all frames are complete.", False )
    scriptDialog.AddRangeControlToGrid("MultiMachineTasksBox", "RangeControl", 10, 1, 9999, 0, 1, 3, 1 )
    
    scriptDialog.AddControlToGrid( "Separator5", "SeparatorControl", "Memory Management Options", 4, 0, colSpan=4 )

    memManageCheckBox = scriptDialog.AddSelectionControlToGrid("MemoryManagement", "CheckBoxControl", False, "Enable Memory Mangement", 5, 0, "Whether or not to use the memory management options. ", colSpan=3)
    memManageCheckBox.ValueModified.connect(MemoryManageChanged)

    scriptDialog.AddControlToGrid( "ImageCacheLabel", "LabelControl", "Image Cache %", 6, 0, "The maximum amount of memory after effects will use to cache frames. ", False )
    scriptDialog.AddRangeControlToGrid("ImageCachePercentage", "RangeControl", 100, 20, 100, 0, 1, 6, 1 )

    scriptDialog.AddControlToGrid( "MaxMemoryLabel", "LabelControl", "Max Memory %", 7, 0, "The maximum amount of memory After Effects can use overall. ", False )
    scriptDialog.AddRangeControlToGrid("MaxMemoryPercentage", "RangeControl", 100, 20, 100, 0, 1, 7, 1)
    
    scriptDialog.AddControlToGrid( "Separator6", "SeparatorControl", "Miscellaneous Options", 8, 0, colSpan=4 )
    scriptDialog.AddSelectionControlToGrid( "MissingLayers", "CheckBoxControl", False, "Ignore Missing Layer Dependencies", 9, 0, "If enabled, Deadline will ignore errors due to missing layer dependencies. ", colSpan=3)
    scriptDialog.AddSelectionControlToGrid( "MissingEffects", "CheckBoxControl", False, "Ignore Missing Effect References", 10, 0, "If enabled, Deadline will ignore errors due to missing effect references. ", colSpan=3)
    scriptDialog.AddSelectionControlToGrid( "MissingFootage", "CheckBoxControl", False, "Continue On Missing Footage", 11, 0, "If enabled, rendering will not stop when missing footage is detected (After Effects CS4 and later). ", colSpan=3)
    scriptDialog.AddSelectionControlToGrid( "FailOnWarnings", "CheckBoxControl", False, "Fail On Warning Messages", 12, 0, "If enabled, Deadline will fail the job whenever After Effects prints out a warning message. ", colSpan=3)
    scriptDialog.AddSelectionControlToGrid( "LocalRendering", "CheckBoxControl", False, "Enable Local Rendering", 13, 0, "If enabled, the frames will be rendered locally, and then copied to their final network location. This requires the Output to be overwritten.", colSpan=3)

    overrideButton = scriptDialog.AddSelectionControlToGrid( "OverrideFailOnExistingAEProcess", "CheckBoxControl", False, "Override Fail On Existing AE Process", 14, 0, "If enabled, the Fail On Existing AE Process Setting will be taken into account.", colSpan=2)
    overrideButton.ValueModified.connect(OverrideButtonPressed)
    scriptDialog.AddSelectionControlToGrid( "FailOnExistingAEProcess", "CheckBoxControl", False, "Fail On Existing AE Process", 14, 2, "If enabled, Deadline will fail the job whilst any After Effects instance is running.")

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "AfterEffectsMonitor", 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()
    
    #might need to add some settings here for the memory management options
    settings = ("DepartmentBox","CategoryBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","MachineLimitBox","IsBlacklistBox","MachineListBox","LimitGroupBox","SceneBox","FramesBox","ChunkSizeBox","VersionBox","ArgsBox","MemoryManagement","ImageCachePercentage", "MaxMemoryPercentage", "CompBox", "MultiProcess", "SubmitSceneBox", "OutputBox", "MissingLayers", "MissingEffects", "MissingFootage", "FailOnWarnings", "LocalRendering", "OverrideFailOnExistingAEProcess", "FailOnExistingAEProcess")
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    CompChanged(None)
    VersionChanged(None)
    MultiMachineChanged(None)
    OverrideButtonPressed(None)
    MemoryManageChanged(None)
    
    #check if memory management is enabled
    if(not bool(scriptDialog.GetValue("MemoryManagement"))):
        scriptDialog.SetEnabled("ImageCachePercentage", False)
        scriptDialog.SetEnabled("MaxMemoryPercentage", False)
    
    scriptDialog.ShowDialog(False)