Exemplo n.º 1
0
def __main__():
    global scriptDialog
    global settings

    scriptDialog = DeadlineScriptDialog()

    selectedJobs = MonitorUtils.GetSelectedJobs()

    totalJobCount = len(selectedJobs)

    jobCount = 0
    for job in selectedJobs:
        if job.JobPlugin == "3dsmax":
            jobCount += 1

    if totalJobCount != jobCount:
        scriptDialog.ShowMessageBox("One or more selected jobs is NOT a 3dsMax job. Only 3dsMax jobs are supported.", "Error")
        return

    scriptDialog.AllowResizingDialog(True)
    scriptDialog.SetSize(600, 100)
    scriptDialog.SetTitle("Add MAXScript(s) to 3dsMax Job")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("PreLoadScriptLabel", "LabelControl", "Run Pre-Load Script", 0, 0, "Run a MAXScript specified in the file browser field BEFORE the 3ds Max scene is loaded for rendering by the Slave.", False)
    scriptDialog.AddSelectionControlToGrid("PreLoadScriptBox", "FileBrowserControl", "", "MAXScript File (*.ms)", 0, 1, colSpan=2)

    scriptDialog.AddControlToGrid("PostLoadScriptLabel", "LabelControl", "Run Post-Load Script", 1, 0, "Run a MAXScript specified in the file browser field AFTER the 3ds Max scene is loaded for rendering by the Slave.", False)
    scriptDialog.AddSelectionControlToGrid("PostLoadScriptBox", "FileBrowserControl", "", "MAXScript File (*.ms)", 1, 1, colSpan=2)

    scriptDialog.AddControlToGrid("PreFrameScriptLabel", "LabelControl", "Run Pre-Frame Script", 2, 0, "Run a MAXScript specified in the file browser field BEFORE the Slave renders a frame.", False)
    scriptDialog.AddSelectionControlToGrid("PreFrameScriptBox", "FileBrowserControl", "", "MAXScript File (*.ms)", 2, 1, colSpan=2)

    scriptDialog.AddControlToGrid("PostFrameScriptLabel", "LabelControl", "Run Post-Frame Script", 3, 0, "Run a MAXScript specified in the file browser field AFTER the Slave renders a frame.", False)
    scriptDialog.AddSelectionControlToGrid("PostFrameScriptBox", "FileBrowserControl", "", "MAXScript File (*.ms)", 3, 1, colSpan=2)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 0)
    applyButton = scriptDialog.AddControlToGrid("ApplyButton", "ButtonControl", "Apply", 0, 1, expand=False)
    applyButton.ValueModified.connect(ApplyButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton", "ButtonControl", "Close", 0, 2, expand=False)
    closeButton.ValueModified.connect(CloseButtonPressed)
    scriptDialog.EndGrid()

    settings = ("PreLoadScriptBox", "PostLoadScriptBox", "PreFrameScriptBox", "PostFrameScriptBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    scriptDialog.ShowDialog(True)
def DialogButtonPressed(*args):
    global scriptDialog

    newDialog = DeadlineScriptDialog()

    newDialog.SetSize(350, 0)
    newDialog.SetTitle("Another Window!")

    newDialog.AddGrid()
    newDialog.AddControlToGrid("Separator1",
                               "SeparatorControl",
                               "Simple Controls",
                               0,
                               0,
                               colSpan=2)

    newDialog.AddControlToGrid("TextLabel",
                               "LabelControl",
                               "Enter Text Here",
                               1,
                               0,
                               expand=False)
    newDialog.AddControlToGrid("TextBox", "TextControl", "Some Text", 1, 1)

    newDialog.AddControlToGrid("ReadOnlyTextLabel",
                               "LabelControl",
                               "Read Only Text",
                               2,
                               0,
                               expand=False)
    newDialog.AddControlToGrid("ReadOnlyTextBox", "ReadOnlyTextControl",
                               "Some Read Only Text", 2, 1)
    newDialog.EndGrid()

    newDialog.ShowDialog(True)
def __main__():
    global scriptDialog

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetSize(450, 68)
    scriptDialog.AllowResizingDialog(False)
    scriptDialog.SetTitle("Start/Stop Service (For Windows Only)")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "NameLabel", "LabelControl", "Service Name", 0, 0,
        "The name of the Windows Service to start or stop.", False)
    scriptDialog.AddControlToGrid("NameBox", "TextControl", "", 0, 1)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("DummyLabel1", 0, 0)
    startButton = scriptDialog.AddControlToGrid("StartButton",
                                                "ButtonControl",
                                                "Start",
                                                0,
                                                1,
                                                expand=False)
    startButton.ValueModified.connect(StartButtonPressed)
    stopButton = scriptDialog.AddControlToGrid("StopButton",
                                               "ButtonControl",
                                               "Stop",
                                               0,
                                               2,
                                               expand=False)
    stopButton.ValueModified.connect(StopButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                3,
                                                expand=False)
    closeButton.ValueModified.connect(CloseButtonPressed)
    scriptDialog.EndGrid()

    scriptDialog.ShowDialog(True)
def __main__():
    global scriptDialog

    maximumPriority = RepositoryUtils.GetMaximumPriority()

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetSize(350, 100)
    scriptDialog.AllowResizingDialog(True)
    scriptDialog.SetTitle("Set/Offset Priority of Selected Jobs")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("AbsLabel", "LabelControl",
                                  "Absolute Priority:", 0, 0,
                                  "The absolute priority for the job.", False)
    scriptDialog.AddRangeControlToGrid("AbsBox", "RangeControl", 0, 0,
                                       maximumPriority, 0, 1, 0, 1)
    absButton = scriptDialog.AddControlToGrid("AbsButton",
                                              "ButtonControl",
                                              "Apply",
                                              0,
                                              2,
                                              expand=False)
    absButton.ValueModified.connect(AbsButtonPressed)

    scriptDialog.AddControlToGrid("OffsetLabel", "LabelControl",
                                  "Priority Offset:", 1, 0,
                                  "The priority offset.", False)
    scriptDialog.AddRangeControlToGrid("OffsetBox", "RangeControl", 0,
                                       -maximumPriority, maximumPriority, 0, 1,
                                       1, 1)
    offsetButton = scriptDialog.AddControlToGrid("OffsetButton",
                                                 "ButtonControl",
                                                 "Apply",
                                                 1,
                                                 2,
                                                 expand=False)
    offsetButton.ValueModified.connect(OffsetButtonPressed)

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

    scriptDialog.ShowDialog(False)
def __main__():
    global scriptDialog
    scriptDialog = DeadlineScriptDialog()

    selectedJobs = MonitorUtils.GetSelectedJobs()

    if len(selectedJobs) > 1:
        scriptDialog.ShowMessageBox( "Only one DBR job can be selected at a time.", "Multiple Jobs Selected" )
        return

    job = selectedJobs[0]
    if Job.JobPlugin not in ( "VraySpawner", "VraySwarm", "3dsmax", "3dsCmd", "CoronaDR", "Modo" ):
        scriptDialog.ShowMessageBox( "Only DBR based jobs should use this script.", "Error" )
        return

    if str( job.JobStatus ) not in ( "Suspended", "Failed", "Completed", "Unknown" ):
        scriptDialog.ShowMessageBox( "Only active DBR jobs can be modified.", "Error" )
        return

    if job.JobPlugin in ( "3dsmax", "3dsCmd", "Modo" ):
        vrayDBRJob = bool( job.GetJobPluginInfoKeyValue( "VRayDBRJob" ) )
        vrayRtDBRJob = bool( job.GetJobPluginInfoKeyValue( "VRayRtDBRJob" ) )
        mentalRayDBRJob = bool( job.GetJobPluginInfoKeyValue( "MentalRayDBRJob" ) )
        modoDBRJob = bool( job.GetJobPluginInfoKeyValue( "ModoDBRJob" ) )
        if not ( vrayDBRJob or vrayRtDBRJob or mentalRayDBRJob or modoDBRJob ):
            scriptDialog.ShowMessageBox( "Only DBR off-load based 3dsmax/3dsCmd/Modo jobs should use this script.", "Error" )
            return

    tasks = RepositoryUtils.GetJobTasks( job, True )
    activeTasksCount = 0
    for task in tasks:
        if IsTaskStatusActive( task.TaskStatus ):
            activeTasksCount += 1

    scriptDialog.AllowResizingDialog( False )
    scriptDialog.SetTitle( "Dynamic DBR Control" )

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "MaxServersLabel", "LabelControl", "Active Servers:", 0, 0 , "This is the maximum number of active Deadline Slaves to be reserved to assist in computing this DBR job.", False )
    scriptDialog.AddRangeControlToGrid( "MaxServersBox", "RangeControl", activeTasksCount, 0, 100, 0, 1, 0, 1 )

    applyButton = scriptDialog.AddControlToGrid( "ApplyButton", "ButtonControl", "Apply", 0, 2, expand=False )
    applyButton.ValueModified.connect(ApplyButtonPressed)
    closeButton = scriptDialog.AddControlToGrid( "CloseButton", "ButtonControl", "Close", 0, 3, expand=False )
    closeButton.ValueModified.connect(CloseButtonPressed)
    scriptDialog.EndGrid()
    
    scriptDialog.ShowDialog( True )
Exemplo n.º 6
0
def __main__():
    global scriptDialog

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.AllowResizingDialog(False)
    scriptDialog.SetTitle("Timeouts")

    scriptDialog.AddGrid()
    scriptDialog.AddSelectionControlToGrid(
        "EnableTimeoutsJobScriptsBox", "CheckBoxControl", False,
        "Enable Timeouts For Pre/Post Job Scripts", 0, 0,
        "If checked, then the timeouts for this job will also affect its pre/post job scripts, if any are defined."
    )
    scriptDialog.AddSelectionControlToGrid(
        "UseFrameTimeoutsBox", "CheckBoxControl", False, "Use Frame Timeouts",
        1, 0,
        "If enabled, timeouts will be calculated based on frames instead of by tasks. The timeouts entered for tasks will be used for each frame in that task."
    )

    applyButton = scriptDialog.AddControlToGrid("ApplyButton",
                                                "ButtonControl",
                                                "Apply",
                                                1,
                                                2,
                                                expand=False)
    applyButton.ValueModified.connect(ApplyButtonPressed)

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

    scriptDialog.EndGrid()

    scriptDialog.ShowDialog(False)
Exemplo n.º 7
0
def __main__(*args):
    global scriptDialog
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

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

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

    scriptDialog.AddTabPage("Job Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("JobDescriptionSeparator",
                                  "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("JobOptionsSeparator",
                                  "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("MochaOptionsSeparator",
                                  "SeparatorControl",
                                  "Mocha Options",
                                  0,
                                  0,
                                  colSpan=4)

    # Mocha specific options
    scriptDialog.AddControlToGrid(
        "VersionLabel", "LabelControl", "Version", 12, 0,
        "The version of Mocha Pro to render/export with.", False)
    versionBox = scriptDialog.AddComboControlToGrid("VersionBox",
                                                    "ComboControl", "5",
                                                    ("5", ), 12, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox",
        "CheckBoxControl",
        False,
        "Submit Mocha Project File With Job",
        12,
        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(
        "SceneLabel", "LabelControl", "Mocha Project File", 13, 0,
        "The Mocha project to be rendered/exported.", False)
    scriptDialog.AddSelectionControlToGrid(
        "SceneBox", "FileBrowserControl", "",
        "Mocha Files (*.mocha);;All Files (*)", 13, 1, "", True, 1, 3)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output Directory", 14, 0,
        "The directory where the render/export output will be written to.",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputBox", "FolderBrowserControl",
                                           "", "", 14, 1, "", True, 1, 3)

    scriptDialog.AddControlToGrid(
        "FrameIndexWidthLabel", "LabelControl", "Frame Index Width", 15, 0,
        "The number of digits allocated for the index portion of the file name. If the number is not large enough to accomodate all output frame indices, it will be ignored and the minimum required number of digits will be used instead.",
        False)
    scriptDialog.AddRangeControlToGrid("FrameIndexWidthBox", "RangeControl", 0,
                                       0, 10, 0, 1, 15, 1)
    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame Range",
                                  15, 2, "Frame range to render/export.",
                                  False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", "", 15, 3, "")

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 16, 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, 16, 1)
    scriptDialog.AddControlToGrid(
        "FrameOffsetLabel", "LabelControl", "Frame Offset", 16, 2,
        "If the project frame range does not start with 0, please specify the offset.",
        False)
    scriptDialog.AddRangeControlToGrid("FrameOffsetBox", "RangeControl", 0, 0,
                                       1000000, 0, 1, 16, 3)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Advanced")
    scriptDialog.AddGrid()

    readExportersLists()

    scriptDialog.AddControlToGrid("JobTypeLabel", "LabelControl", "Job Type",
                                  0, 0, "The type of Mocha job.", False)
    jobTypeBox = scriptDialog.AddComboControlToGrid("JobTypeBox",
                                                    "ComboControl", "Render",
                                                    ("Render", "Export"), 0, 1)
    jobTypeBox.ValueModified.connect(jobTypeChanged)

    scriptDialog.AddControlToGrid("JobSubTypeLabel", "LabelControl",
                                  "Job Sub Type", 0, 2,
                                  "The sub type of Mocha job.", False)
    jobSubTypeBox = scriptDialog.AddComboControlToGrid("JobSubTypeBox",
                                                       "ComboControl", "", [],
                                                       0, 3)
    jobSubTypeBox.ValueModified.connect(jobSubTypeChanged)

    # settings applicable when rendering
    scriptDialog.AddControlToGrid("RenderOptionsSeparator",
                                  "SeparatorControl",
                                  "Render Options",
                                  1,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("FileExtensionLabel", "LabelControl",
                                  "File Extension", 2, 0,
                                  "The output file extension.")
    versionBox = scriptDialog.AddComboControlToGrid("FileExtensionBox",
                                                    "ComboControl", "png",
                                                    fileExtensions, 2, 1)

    scriptDialog.AddControlToGrid(
        "ClipViewIndexLabel", "LabelControl", "Clip View Index", 2, 2,
        "By default, this is zero (0), but if you are working with a multi-view clip, you can set the index here. In stereo mode, Left and Right views are 0 and 1 respectively.",
        False)
    scriptDialog.AddComboControlToGrid("ClipViewIndexBox", "ComboControl", "0",
                                       ("0", "1"), 2, 3)

    scriptDialog.AddControlToGrid(
        "OutputPrefixLabel", "LabelControl", "Output Prefix", 3, 0,
        "The output prefix goes before the frame number in the file name. Not required."
    )
    scriptDialog.AddControlToGrid("OutputPrefixBox", "TextControl", "", 3, 1)

    scriptDialog.AddControlToGrid(
        "OutputSuffixLabel", "LabelControl", "Output Suffix", 3, 2,
        "The output suffix goes after the frame number in the file name. Not required."
    )
    scriptDialog.AddControlToGrid("OutputSuffixBox", "TextControl", "", 3, 3)

    scriptDialog.AddControlToGrid("LayerGroupLabel", "LabelControl", "Layers",
                                  4, 0, "The layers to render.")
    scriptDialog.AddControlToGrid("LayerGroupBox",
                                  "MultiLineTextControl",
                                  "",
                                  4,
                                  1,
                                  layerGroupTooltip,
                                  colSpan=3)

    # settings applicable when exporting
    scriptDialog.AddControlToGrid("ExportOptionsSeparator",
                                  "SeparatorControl",
                                  "Export Options",
                                  5,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "ExporterNameLabel",
        "LabelControl",
        "Exporter Name",
        6,
        0,
        "The name of the exporter. The exporters list can be accessed in <repository>/plugins/Mocha/Exporters.txt.",
    )
    versionBox = scriptDialog.AddComboControlToGrid("ExporterNameBox",
                                                    "ComboControl", "", [], 6,
                                                    1, "", True, 1, 3)
    updateExportersList()

    scriptDialog.AddControlToGrid(
        "FileNameLabel", "LabelControl", "File Name", 7, 0,
        "The exporter output file name. Please include the file extension applicable for the selected exporter."
    )
    scriptDialog.AddControlToGrid("FileNameBox", "TextControl", "", 7, 1, "",
                                  True, 1, 3)

    scriptDialog.AddControlToGrid(
        "ViewsLabel", "LabelControl", "View Names", 8, 0,
        "List of names or abbreviations of views to export (use comma as the delimiter). When in stereo mode, Left(L) will be used by default."
    )
    scriptDialog.AddControlToGrid("ViewsBox", "TextControl", "", 8, 1, "",
                                  True, 1, 3)

    scriptDialog.AddControlToGrid(
        "FrameTimeLabel", "LabelControl", "Frame Time", 9, 0,
        "The frame time argument is used when working with tracking data exporters."
    )
    scriptDialog.AddRangeControlToGrid("FrameTimeBox", "RangeControl", 0.000,
                                       0.000, 10000, 3, 0.001, 9, 1)

    scriptDialog.AddControlToGrid(
        "ColorizeLabel", "LabelControl", "Colorize", 9, 2,
        "Used to export the colored version of the mattes.")
    jobTypeBox = scriptDialog.AddComboControlToGrid("ColorizeBox",
                                                    "ComboControl",
                                                    "Grayscale", colorizeTypes,
                                                    9, 3)

    scriptDialog.AddSelectionControlToGrid(
        "InvertBox", "CheckBoxControl", True, "Invert", 10, 1,
        "Mimes Invert the checkbox in Mocha's Export Tracking Data dialog.")

    scriptDialog.AddSelectionControlToGrid(
        "StabilizeBox", "CheckBoxControl", True, "Stabilize", 10, 2,
        "Mimes the Stabilize checkbox of the Export Tracking Data dialog.")

    scriptDialog.AddSelectionControlToGrid(
        "RemoveLensDistortionBox", "CheckBoxControl", True,
        "Remove Lens Distortion", 10, 3,
        "Mimes the Remove Lens Distortion checkbox of the Export Tracking Data dialog."
    )

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "MochaMonitor",
                                          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()

    updateJobSubTypeList()
    adjustOptionsSelection()

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "VersionBox", "SceneBox",
                "SubmitSceneBox", "OutputBox", "FrameIndexWidthBox",
                "FrameOffsetBox", "FramesBox", "ChunkSizeBox", "JobTypeBox",
                "JobSubTypeBox", "FileExtensionBox", "OutputPrefixBox",
                "OutputSuffixBox", "LayerGroupBox", "ClipViewIndexBox",
                "ExporterNameBox", "FileNameBox", "ViewsBox", "FrameTimeBox",
                "ColorizeBox", "InvertBox", "StabilizeBox",
                "RemoveLensDistortionBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    scriptDialog.ShowDialog(False)
Exemplo n.º 8
0
def __main__():
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

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

    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,
        "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, 7, 1)
    scriptDialog.AddSelectionControlToGrid(
        "IsBlacklistBox", "CheckBoxControl", False,
        "Machine List Is A Blacklist", 7, 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", 8, 0,
        "The whitelisted or blacklisted list of machines.", 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",
                                  "Arion Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "Arion File",
                                  1, 0, "The Arion file to render.", False)
    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Arion Files (*.rcs);;All Files (*)",
        1,
        1,
        colSpan=2)

    scriptDialog.AddControlToGrid(
        "LdrOutputLabel", "LabelControl", "LDR Output File", 2, 0,
        "Override the LDR output path. This is optional, and can be left blank.",
        False)
    scriptDialog.AddSelectionControlToGrid("LdrOutputBox",
                                           "FileSaverControl",
                                           "",
                                           "All Files (*)",
                                           2,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "HdrOutputLabel", "LabelControl", "HDR Output File", 3, 0,
        "Override the HDR output path. This is optional, and can be left blank.",
        False)
    scriptDialog.AddSelectionControlToGrid("HdrOutputBox",
                                           "FileSaverControl",
                                           "",
                                           "All Files (*)",
                                           3,
                                           1,
                                           colSpan=2)

    passesCheckBox = scriptDialog.AddSelectionControlToGrid(
        "EnablePassesBox", "CheckBoxControl", False, "Set Passes", 4, 0,
        "Enable to set the number of passes to use for rendering.", False)
    passesCheckBox.ValueModified.connect(passesCheckBoxChanged)
    scriptDialog.AddRangeControlToGrid("PassesBox",
                                       "RangeControl",
                                       1,
                                       1,
                                       999999,
                                       0,
                                       1,
                                       4,
                                       1,
                                       expand=False)
    scriptDialog.SetEnabled("PassesBox", False)
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 4, 2)

    minutesCheckBox = scriptDialog.AddSelectionControlToGrid(
        "EnableMinutesBox", "CheckBoxControl", False, "Set Minutes", 5, 0,
        "Enable to set the number of minutes to use for rendering.", False)
    minutesCheckBox.ValueModified.connect(minutesCheckBoxChanged)
    scriptDialog.AddRangeControlToGrid("MinutesBox",
                                       "RangeControl",
                                       1,
                                       1,
                                       999999,
                                       0,
                                       1,
                                       5,
                                       1,
                                       expand=False)
    scriptDialog.SetEnabled("MinutesBox", False)

    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 6, 0,
        "The number of render threads to use. Specify 0 to have Arion figure out the optimal number.",
        False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox",
                                       "RangeControl",
                                       0,
                                       0,
                                       256,
                                       0,
                                       1,
                                       6,
                                       1,
                                       expand=False)

    scriptDialog.AddControlToGrid(
        "CmdLabel", "LabelControl", "Command Line Args", 7, 0,
        "Specify additional command line arguments to use for rendering.",
        False)
    scriptDialog.AddControlToGrid("CmdBox", "TextControl", "", 7, 1, colSpan=2)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Channels")
    scriptDialog.AddGrid()
    scriptDialog.AddSelectionControlToGrid(
        "MainBox", "CheckBoxControl", False, "Main", 0, 0,
        "Enable to render the Main channel.")
    scriptDialog.AddSelectionControlToGrid(
        "AlphaBox", "CheckBoxControl", False, "Alpha", 0, 1,
        "Enable to render the Alpha channel.")
    scriptDialog.AddSelectionControlToGrid(
        "AmbientBox", "CheckBoxControl", False, "Ambient", 0, 2,
        "Enable to render the Ambient channel.")
    scriptDialog.AddSelectionControlToGrid(
        "AOBox", "CheckBoxControl", False, "Amb Ocl", 0, 3,
        "Enable to render the Ambient Oclussion channel.")
    scriptDialog.AddSelectionControlToGrid(
        "CoverageBox", "CheckBoxControl", False, "Coverage", 0, 4,
        "Enable to render the Coverage channel.")

    scriptDialog.AddSelectionControlToGrid(
        "DepthBox", "CheckBoxControl", False, "Depth", 1, 0,
        "Enable to render the Depth channel.")
    scriptDialog.AddSelectionControlToGrid(
        "DiffuseBox", "CheckBoxControl", False, "Diffuse", 1, 1,
        "Enable to render the Diffuse channel.")
    scriptDialog.AddSelectionControlToGrid(
        "DirectBox", "CheckBoxControl", False, "Direct", 1, 2,
        "Enable to render the Direct channel.")
    scriptDialog.AddSelectionControlToGrid(
        "FresnelBox", "CheckBoxControl", False, "Fresnel", 1, 3,
        "Enable to render the Fresnel channel.")
    scriptDialog.AddSelectionControlToGrid(
        "GlossyBox", "CheckBoxControl", False, "Glossy", 1, 4,
        "Enable to render the Glossy channel.")

    scriptDialog.AddSelectionControlToGrid(
        "IndirectBox", "CheckBoxControl", False, "Indirect", 2, 0,
        "Enable to render the Indirect channel.")
    scriptDialog.AddSelectionControlToGrid(
        "LightsBox", "CheckBoxControl", False, "Lights", 2, 1,
        "Enable to render the Lights channel.")
    scriptDialog.AddSelectionControlToGrid(
        "LightMixer1Box", "CheckBoxControl", False, "Light Mixer 1", 2, 2,
        "Enable to render the Light Mixer 1 channel.")
    scriptDialog.AddSelectionControlToGrid(
        "LightMixer2Box", "CheckBoxControl", False, "Light Mixer 2", 2, 3,
        "Enable to render the Light Mixer 2 channel.")
    scriptDialog.AddSelectionControlToGrid(
        "LightMixer3Box", "CheckBoxControl", False, "Light Mixer 3", 2, 4,
        "Enable to render the Light Mixer 3 channel.")

    scriptDialog.AddSelectionControlToGrid(
        "LightMixer4Box", "CheckBoxControl", False, "Light Mixer 4", 3, 0,
        "Enable to render the Light Mixer 4 channel.")
    scriptDialog.AddSelectionControlToGrid(
        "LightMixer5Box", "CheckBoxControl", False, "Light Mixer 5", 3, 1,
        "Enable to render the Light Mixer 5 channel.")
    scriptDialog.AddSelectionControlToGrid(
        "LightMixer6Box", "CheckBoxControl", False, "Light Mixer 6", 3, 2,
        "Enable to render the Light Mixer 6 channel.")
    scriptDialog.AddSelectionControlToGrid(
        "LightMixer7Box", "CheckBoxControl", False, "Light Mixer 7", 3, 3,
        "Enable to render the Light Mixer 7 channel.")
    scriptDialog.AddSelectionControlToGrid(
        "LightMixer8Box", "CheckBoxControl", False, "Light Mixer 8", 3, 4,
        "Enable to render the Light Mixer 8 channel.")

    scriptDialog.AddSelectionControlToGrid(
        "MtlIdBox", "CheckBoxControl", False, "MtlId", 4, 0,
        "Enable to render the Material ID channel.")
    scriptDialog.AddSelectionControlToGrid(
        "NormalsBox", "CheckBoxControl", False, "Normals", 4, 1,
        "Enable to render the Normals channel.")
    scriptDialog.AddSelectionControlToGrid(
        "ObjIdBox", "CheckBoxControl", False, "ObjId", 4, 2,
        "Enable to render the Object ID channel.")
    scriptDialog.AddSelectionControlToGrid(
        "ReflectionBox", "CheckBoxControl", False, "Reflection", 4, 3,
        "Enable to render the Reflection channel.")
    scriptDialog.AddSelectionControlToGrid(
        "RefractionBox", "CheckBoxControl", False, "Refraction", 4, 4,
        "Enable to render the Refraction channel.")

    scriptDialog.AddSelectionControlToGrid(
        "RoughnessBox", "CheckBoxControl", False, "Roughness", 5, 0,
        "Enable to render the Roughness channel.")
    scriptDialog.AddSelectionControlToGrid(
        "ShadowsBox", "CheckBoxControl", False, "Shadow", 5, 1,
        "Enable to render the Shadow channel.")
    scriptDialog.AddSelectionControlToGrid(
        "SpecularBox", "CheckBoxControl", False, "Specular", 5, 2,
        "Enable to render the Specular channel.")
    scriptDialog.AddSelectionControlToGrid(
        "SSSBox", "CheckBoxControl", False, "SSS", 5, 3,
        "Enable to render the SSS channel.")
    scriptDialog.AddSelectionControlToGrid(
        "SunBox", "CheckBoxControl", False, "Sun", 5, 4,
        "Enable to render the Sun channel.")
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

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

    scriptDialog.EndTabControl()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer2", 0, 0)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 1,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                2,
                                                expand=False)
    # 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", "LdrOutputBox",
                "HdrOutputBox", "EnablePassesBox", "PassesBox",
                "EnableMinutesBox", "MinutesBox", "ThreadsBox", "MainBox",
                "AlphaBox", "AmbientBox", "AOBox", "CoverageBox", "DepthBox",
                "DiffuseBox", "DirectBox", "FresnelBox", "GlossyBox",
                "IndirectBox", "LightsBox", "LightMixer1Box", "LightMixer2Box",
                "LightMixer3Box", "LightMixer4Box", "LightMixer5Box",
                "LightMixer6Box", "LightMixer7Box", "LightMixer8Box",
                "MtlIdBox", "NormalsBox", "ObjIdBox", "ReflectionBox",
                "RefractionBox", "RoughnessBox", "ShadowsBox", "SpecularBox",
                "SSSBox", "SunBox", "CmdBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    scriptDialog.ShowDialog(False)
Exemplo n.º 9
0
def __main__(*args):
    global scriptDialog
    global empToPrtJobBox
    global settings
    global integration_dialog

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

    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()

    #Naiad Options
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Naiad Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "Naiad File",
                                  1, 0, "The Naiad file to simulate.", False)
    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Naiad Files (*.ni);;All Files (*)",
        1,
        1,
        colSpan=2)
    sceneBox.ValueModified.connect(SceneBoxChanged)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  2, 0, "The list of frames to simulate.",
                                  False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", "", 2, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", False,
        "Submit Naiad File With Job", 2, 2,
        "If this option is enabled, the scene file will be submitted with the job, and then copied locally to the slave machine during rendering."
    )

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 3, 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, 3, 1)

    scriptDialog.EndGrid()

    #Naiad Simulation Options
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator5",
                                  "SeparatorControl",
                                  "Naiad Simulation Job",
                                  0,
                                  0,
                                  colSpan=2)

    simJobBox = scriptDialog.AddSelectionControlToGrid(
        "SimJobBox", "CheckBoxControl", True, "Submit Simulation Job", 1, 0,
        "Enable to submit a Simulation job to Deadline.", False)
    simJobBox.ValueModified.connect(SimJobBoxChanged)
    scriptDialog.AddSelectionControlToGrid(
        "SingleMachineBox", "CheckBoxControl", False,
        "Run Simulation On A Single Machine", 1, 1,
        "If enabled, the simluation job will be submitted as a single task consisting of all frames so that a single machine runs the entire simulation."
    )
    scriptDialog.EndGrid()
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 0, 0,
        "The number of render threads to use. Specify 0 to let Naiad determine the number of threads to use.",
        False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0,
                                       1024, 0, 1, 0, 1)
    scriptDialog.AddSelectionControlToGrid(
        "VerboseBox", "CheckBoxControl", False, "Enable Verbose Logging", 0, 2,
        "Enables verbose logging during the simulation.")
    scriptDialog.EndGrid()

    #Naiad Prt Conversion Options
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "EMP to PRT Conversion Job",
                                  0,
                                  0,
                                  colSpan=2)

    empToPrtJobBox = scriptDialog.AddSelectionControlToGrid(
        "EmpToPrtBox",
        "CheckBoxControl",
        False,
        "Submit EMP to PRT Conversion Job",
        1,
        0,
        "Enable to submit a PRT Conversion job to Deadline.",
        colSpan=2)
    empToPrtJobBox.ValueModified.connect(EmpToPrtJobBoxChanged)

    scriptDialog.AddControlToGrid("EMPBodyLabel", "LabelControl",
                                  "EMP Body Name", 2, 0, "The EMP body name.",
                                  False)
    initBodyNames = ()
    scriptDialog.AddComboControlToGrid("EMPBodyBox", "ComboControl", "",
                                       initBodyNames, 2, 1)

    scriptDialog.AddControlToGrid(
        "EMPFileLabel", "LabelControl", "EMP Body File Name", 3, 0,
        "The path to the EMP files to be converted.", False)
    initBodyFileNames = ()
    scriptDialog.AddComboControlToGrid("EMPBodyFilenameBox", "ComboControl",
                                       "", initBodyFileNames, 3, 1)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "NaiadMonitor",
                                          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)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ("NameBox", "DepartmentBox", "CategoryBox", "PoolBox",
                "SecondaryPoolBox", "GroupBox", "PriorityBox",
                "MachineLimitBox", "IsBlacklistBox", "MachineListBox",
                "LimitGroupBox", "SceneBox", "FramesBox", "SubmitSceneBox",
                "SimJobBox", "EmpToPrtBox", "ThreadsBox", "VerboseBox",
                "SingleMachineBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    if len(args) > 0:
        if args[0] != "":
            scriptDialog.SetValue("SceneBox", args[0])

    SceneBoxChanged(None)
    SimJobBoxChanged(None)
    EmpToPrtJobBoxChanged(None)

    scriptDialog.ShowDialog(False)
Exemplo n.º 10
0
def __main__():
    global scriptDialog
    global settings
    
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit HServer Reserve Job" )
    scriptDialog.SetIcon( RepositoryUtils.GetRepositoryFilePath( "plugins/HServer/HServer.ico", True ) )
    
    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", "HServer Options", 14, 0, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "ReserveCountLabel", "LabelControl", "HServer Count", 15, 0, "The number of tasks/maximum number of slaves to reserve. Default: 1", False )
    scriptDialog.AddRangeControlToGrid( "ReserveCountBox", "RangeControl", 1, 1, 100, 0, 1, 15, 1 )
    
    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)
    scriptDialog.EndGrid()

    settings = ("DepartmentBox","CategoryBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","TaskTimeoutBox","MachineLimitBox","IsBlacklistBox","MachineListBox","LimitGroupBox","SubmitSuspendedBox","IsInterruptible","ReserveCountBox","PortBox","VersionBox")
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )

    scriptDialog.ShowDialog( False )
Exemplo n.º 11
0
def __main__(*args):
    global scriptDialog
    global settings
    global CommandBox
    global jobOptions_dialog

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.EndGrid()

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

    CommandsChanged(None)
    ShellExecuteButtonPressed(None)

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

    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle("Submit 3dsmax Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('3dsmax'))

    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.",
        False)

    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", "Limits",
                                  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",
                                  "3dsmax Options", 0, 0)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "3dsmax File",
                                  0, 0, "The scene file to render.", False)
    scriptDialog.AddSelectionControlToGrid("SceneBox",
                                           "MultiFileBrowserControl",
                                           "",
                                           "3dsmax Files (*.max)",
                                           0,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  1, 0, "The list of frames to render.", False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", "", 1, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", False,
        "Submit Scene File With Job", 1, 2,
        "If this option is enabled, the scene file will be submitted with the job, and then copied locally to the slave machine during rendering."
    )

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 2, 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, 2, 1)
    scriptDialog.AddSelectionControlToGrid(
        "ShowVfbBox", "CheckBoxControl", True, "Show Virtual Frame Buffer", 2,
        2, "Enable the virtual frame buffer during rendering. ")

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 3,
                                  0, "The version of 3ds Max to render with.",
                                  False)
    versionBox = scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "2020",
        ("2014", "2015", "2016", "2017", "2018", "2019", "2020"), 3, 1)
    versionBox.ValueModified.connect(VersionChanged)

    scriptDialog.AddSelectionControlToGrid(
        "IsMaxDesignBox", "CheckBoxControl", False, "Use Design Edition", 3, 2,
        "Enable this if you are rendering with the Design edition of 3ds Max.")

    scriptDialog.AddControlToGrid(
        "BuildLabel", "LabelControl", "Build To Force", 4, 0,
        "You can force 32 or 64 bit rendering with this option.", False)
    scriptDialog.AddComboControlToGrid("BuildBox", "ComboControl", "None",
                                       ("None", "32bit", "64bit"), 4, 1)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Advanced Options")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator1", "SeparatorControl", "Options",
                                  0, 0)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "CameraLabel", "LabelControl", "Camera", 0, 0,
        "The name of the camera to render, or leave blank to render the active viewport",
        False)
    scriptDialog.AddControlToGrid("CameraBox",
                                  "TextControl",
                                  "",
                                  0,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "PluginIniLabel", "LabelControl", "Alternate Plugin.ini", 1, 0,
        "By default, all slaves will launch 3ds Max using the default plugin.ini file found in their 3ds max root folders. You can specify an alternative plugin.ini file here.",
        False)
    scriptDialog.AddSelectionControlToGrid("PluginIniBox",
                                           "FileBrowserControl",
                                           "",
                                           "Plugin Ini Files (*.ini)",
                                           1,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "PreLoadLabel", "LabelControl", "Pre-Load Script", 2, 0,
        "A MAXScript file that is executed before the 3ds Max scene is loaded for rendering by the Slave.",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "PreLoadBox",
        "FileBrowserControl",
        "",
        "MAXScript Files (*.ms);;Encrypted MAXScript Files (*.mse)",
        2,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid(
        "PostLoadLabel", "LabelControl", "Post-Load Script", 3, 0,
        "A MAXScript file that is executed after the 3ds Max scene is loaded for rendering by the Slave.",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "PostLoadBox",
        "FileBrowserControl",
        "",
        "MAXScript Files (*.ms);;Encrypted MAXScript Files (*.mse)",
        3,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid(
        "PreFrameLabel", "LabelControl", "Pre-Frame Script", 4, 0,
        "A MAXScript file that is executed before a frame is rendered by the Slave.",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "PreFrameBox",
        "FileBrowserControl",
        "",
        "MAXScript Files (*.ms);;Encrypted MAXScript Files (*.mse)",
        4,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid(
        "PostFrameLabel", "LabelControl", "Post-Frame Script", 5, 0,
        "A MAXScript file that is executed after a frame is rendered by the Slave.",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "PostFrameBox",
        "FileBrowserControl",
        "",
        "MAXScript Files (*.ms);;Encrypted MAXScript Files (*.mse)",
        5,
        1,
        colSpan=3)

    workstationModeControl = scriptDialog.AddSelectionControlToGrid(
        "WorkstationModeBox", "CheckBoxControl", False,
        "Force Workstation Mode", 6, 0,
        "When checked, 3ds Max will be launched in full Interactive mode and will require a license. ",
        True, 1, 2)
    workstationModeControl.ValueModified.connect(WorkstationModeValueChanged)

    scriptDialog.AddSelectionControlToGrid(
        "SilentModeBox", "CheckBoxControl", False, "Enable Silent Mode", 6, 2,
        "This option is only available when Force Workstation Mode is checked, and should help suppress some popups.",
        True, 1, 2)

    scriptDialog.AddSelectionControlToGrid(
        "IgnoreMissingExternalFilesBox", "CheckBoxControl", True,
        "Ignore Missing External File Errors", 7, 0,
        "Enable this to ignore missing external files (like textures) during rendering.",
        True, 1, 2)
    scriptDialog.AddSelectionControlToGrid(
        "IgnoreMissingUVWsBox", "CheckBoxControl", True,
        "Ignore Missing UVW Errors", 7, 2,
        "Enable this to ignore missing UVWs during rendering.", True, 1, 2)

    scriptDialog.AddSelectionControlToGrid(
        "IgnoreMissingXREFsBox", "CheckBoxControl", True,
        "Ignore Missing XREF Errors", 8, 0,
        "Enable this to ignore missing XREFs during rendering.", True, 1, 2)
    scriptDialog.AddSelectionControlToGrid(
        "IgnoreMissingDLLsBox", "CheckBoxControl", False,
        "Ignore Missing DLL Errors", 8, 2,
        "Enable this to ignore missing dlls (like plugins) during rendering.",
        True, 1, 2)

    scriptDialog.AddSelectionControlToGrid(
        "LocalRenderingBox", "CheckBoxControl", True, "Enable Local Rendering",
        9, 0,
        "If enabled, the frames will be rendered locally, and then copied to their final network location. ",
        True, 1, 2)
    scriptDialog.AddSelectionControlToGrid(
        "DisableMultipassBox", "CheckBoxControl", False,
        "Disable Multipass Effects", 9, 2,
        "Enable this option to skip over multipass effects if they are enabled for the camera to be rendered. ",
        True, 1, 2)

    scriptDialog.AddSelectionControlToGrid(
        "RestartRendererBox", "CheckBoxControl", False,
        "Restart Renderer Between Frames", 10, 0,
        "This option can be used to force Deadline to restart the renderer after each frame to avoid some potential problems in very rare cases. Normally, you should leave this option unchecked. ",
        True, 1, 2)
    scriptDialog.AddSelectionControlToGrid(
        "RemovePaddingBox", "CheckBoxControl", False,
        "Remove Filename Padding", 10, 2,
        "If checked, the output filename will be (for example) 'output.tga' instead of 'output0000.tga'. This feature should only be used when rendering single frames.",
        True, 1, 2)

    gammaBox = scriptDialog.AddSelectionControlToGrid(
        "GammaCorrectionBox", "CheckBoxControl", False, "Gamma Correction", 11,
        0, "Enable to apply gamma correction during rendering. ", True, 1, 2)
    gammaBox.ValueModified.connect(GammaChanged)

    scriptDialog.AddControlToGrid("GammaInputLabel", "LabelControl",
                                  "Input Gamma", 12, 0,
                                  "The gamma input value.", False)
    scriptDialog.AddRangeControlToGrid("GammaInputBox", "RangeControl", 1.0,
                                       0.01, 5.0, 2, 0.1, 12, 1)
    scriptDialog.AddControlToGrid("GammaOutputLabel", "LabelControl",
                                  "Output Gamma", 12, 2,
                                  "The gamma output value.", False)
    scriptDialog.AddRangeControlToGrid("GammaOutputBox", "RangeControl", 1.0,
                                       0.01, 5.0, 2, 0.1, 12, 3)

    overrideLanguageControl = scriptDialog.AddSelectionControlToGrid(
        "OverrideLanguageBox", "CheckBoxControl", False, "Override Language",
        13, 0,
        "Choose the language of Max to render with, or just use the default.")
    overrideLanguageControl.ValueModified.connect(OverrideLanguageValueChanged)
    scriptDialog.AddComboControlToGrid(
        "LanguageBox", "ComboControl", "Default",
        ["Default", "CHS", "DEU", "ENU", "FRA", "JPN", "KOR"], 13, 1)
    scriptDialog.AddSelectionControlToGrid(
        "OneCpuPerTaskBox", "CheckBoxControl", False, "One Cpu Per Task", 13,
        2,
        "When checked, each task a slave renders will only use one cpu. This can be useful if you are rendering a single threaded job, and you have set Concurrent Tasks to a value greater than 1."
    )

    scriptDialog.AddControlToGrid(
        "PathConfigLabel", "LabelControl", "Alternate Path File", 14, 0,
        "Allows you to specify an alternate path file in the MXP format that the slaves can use to find bitmaps that are not found on the primary map paths.",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "PathConfigBox", "FileBrowserControl", "",
        "Path Configuration Files (*.mxp);;All Files (*)", 14, 1, "", True, 1,
        3)

    scriptDialog.AddSelectionControlToGrid(
        "MergePathConfigBox", "CheckBoxControl", False, "Merge Path File", 15,
        0,
        "If enabled, the path config file will be merged with the existing path configuration, instead of overwriting it."
    )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator7", "SeparatorControl",
                                  "VRay DBR and Mental Ray Satellite", 0, 0)
    scriptDialog.AddControlToGrid(
        "DBRLabel", "LabelControl",
        "Offloads a DBR or Satellite render to Deadline. This requires the VRay DBR or\nMental Ray Satellite rendering option to be enabled in your 3ds Max scene settings.\nIt also requires that the vray_dr.cfg, vrayrt_dr.cfg or max.rayhosts files be writable\non the render nodes. See the 3ds Max documentation for more information.",
        1, 0)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "DBRModeLabel",
        "LabelControl",
        "Mode",
        0,
        0,
        "Select VRay DBR or Mental Ray Satellite mode, or leave disabled to do a normal render.",
        False,
        colSpan=4)
    dbrModeBox = scriptDialog.AddComboControlToGrid(
        "DBRModeBox",
        "ComboControl",
        "Disabled",
        ("Disabled", "Mental Ray Satellite", "VRay DBR", "VRay RT DBR"),
        0,
        1,
        expand=True)
    dbrModeBox.ValueModified.connect(DBRModeChanged)

    scriptDialog.AddControlToGrid(
        "DBRServersLabel", "LabelControl", "Number of Slaves", 0, 2,
        "The number of Slaves to reserve for VRay DBR or Mental Ray Satellite rendering.",
        False)
    scriptDialog.AddRangeControlToGrid("DBRServersBox",
                                       "RangeControl",
                                       5,
                                       1,
                                       100,
                                       0,
                                       1,
                                       0,
                                       3,
                                       expand=True)

    scriptDialog.AddControlToGrid("GPUSeparator",
                                  "SeparatorControl",
                                  "GPU Options",
                                  1,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "GPUsPerTaskLabel", "LabelControl", "GPUs Per Task", 2, 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, 2, 1)
    GPUsPerTaskBox.ValueModified.connect(GPUsPerTaskChanged)

    scriptDialog.AddControlToGrid(
        "GPUsSelectDevicesLabel", "LabelControl", "Select GPU Devices", 2, 2,
        "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", "", 2, 3)
    GPUsSelectDevicesBox.ValueModified.connect(GPUsSelectDevicesChanged)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "3dsMaxMonitor",
                                          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", "PluginIniBox",
                "PathConfigBox", "MergePathConfigBox", "PreLoadBox",
                "PostLoadBox", "PreFrameBox", "PostFrameBox", "SubmitSceneBox",
                "LocalRenderingBox", "IsMaxDesignBox", "OneCpuPerTaskBox",
                "OverrideLanguageBox", "LanguageBox", "GammaCorrectionBox",
                "GammaInputBox", "GammaOutputBox", "DBRModeBox",
                "DBRServersBox")

    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    GammaChanged()
    VersionChanged()
    OverrideLanguageValueChanged()
    WorkstationModeValueChanged()
    PopulateLanguageDropDowns()
    GPUsPerTaskChanged()
    GPUsSelectDevicesChanged()
    DBRModeChanged()

    scriptDialog.ShowDialog(False)
Exemplo n.º 13
0
def __main__(*args):
    global scriptDialog
    global settings
    global startup

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

    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",
                                  "V-Ray Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "SceneLabel", "LabelControl", "V-Ray Image File", 1, 0,
        "The V-Ray Image file(s) to be converted. If you are submitting a sequence of files, you only need to select one vrimg file from the sequence. ",
        False)
    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "V-Ray Image Files (*.vrimg);;All Files (*)",
        1,
        1,
        colSpan=2)
    sceneBox.ValueModified.connect(SceneBoxChanged)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output File (Optional)", 2, 0,
        "Optionally override the output file name (do not specify padding). If left blank, the output name will be the same as the input name (with the exr extension).",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputBox",
                                           "FileSaverControl",
                                           "",
                                           "OpenEXR (*.exr)",
                                           2,
                                           1,
                                           colSpan=2)

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

    scriptDialog.AddTabPage("Advanced Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "Advanced Options",
                                  0,
                                  0,
                                  colSpan=3)

    setChannelBox = scriptDialog.AddSelectionControlToGrid(
        "SetChannelBox", "CheckBoxControl", False, "Specify Channel", 4, 0,
        "Enable this option to read the specified channel from the vrimg file and write it as the RGB channel in the output file.",
        False)
    setChannelBox.ValueModified.connect(SetChannelBoxModified)
    scriptDialog.AddControlToGrid("ChannelBox", "TextControl", "", 4, 1)
    scriptDialog.AddSelectionControlToGrid(
        "LongChanNamesBox", "CheckBoxControl", False, "Long Channel Names", 4,
        2,
        "Enable channel names with more than 31 characters. Produced .exr file will NOT be compatible with OpenEXR 1.x if a long channel name is present."
    )

    setGammaBox = scriptDialog.AddSelectionControlToGrid(
        "SetGammaBox", "CheckBoxControl", False, "Set Gamma", 5, 0,
        "Enable this option to apply the specified gamma correction to the RGB colors before writing to the exr file.",
        False)
    setGammaBox.ValueModified.connect(SetGammaBoxModified)
    scriptDialog.AddRangeControlToGrid("GammaBox", "RangeControl", 1.8, 0.2,
                                       5.0, 6, 0.2, 5, 1)
    scriptDialog.AddSelectionControlToGrid(
        "DataWindowBox", "CheckBoxControl", True, "Crop EXR Data Window", 5, 2,
        "Tries to find the valid data window from the .vrimg file. This requires that the file can be read in one pass. The non-zero pixels in the alpha channel are used to determine the data window."
    )

    setBufferSizeBox = scriptDialog.AddSelectionControlToGrid(
        "SetBufferSizeBox", "CheckBoxControl", False, "Set Buffer Size (MB)",
        6, 0,
        "Enable this option to set the maximum allocated buffer size per channel in megabytes. If the image does not fit into the max buffer size, it is converted in several passes.",
        False)
    setBufferSizeBox.ValueModified.connect(SetBufferSizeBoxModified)
    scriptDialog.AddRangeControlToGrid("BufferSizeBox", "RangeControl", 1, 10,
                                       1000000, 0, 1, 6, 1)
    scriptDialog.AddSelectionControlToGrid(
        "HalfBox", "CheckBoxControl", False, "Store EXR Data as 16-bit (Half)",
        6, 2,
        "Enable this option to store the data in the .exr file as 16-bit floating point numbers instead of 32-bit floating point numbers."
    )

    setCompressionBox = scriptDialog.AddSelectionControlToGrid(
        "SetCompressionBox", "CheckBoxControl", False, "Set Compression", 7, 0,
        "", False)
    setCompressionBox.ValueModified.connect(SetCompressionBoxModified)
    scriptDialog.AddComboControlToGrid(
        "CompressionBox", "ComboControl", "zip",
        ("none", "piz", "pxr24", "zip", "zips"), 7, 1,
        "Enable this option to set the compression type. The Zip method is used by default.",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "SeparateFilesBox", "CheckBoxControl", False, "Separate Files", 7, 2,
        "Writes each channel into a separate .exr file.")

    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 8, 0,
        "The number of computation threads. Specify 0 to use the number of processors available.",
        False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 8, 1)
    scriptDialog.AddSelectionControlToGrid(
        "MultiPartBox", "CheckBoxControl", False, "Multi Part", 8, 2,
        "Writes each channel into a separate OpenEXR2 'part'.")

    scriptDialog.AddSelectionControlToGrid(
        "SRGBBox",
        "CheckBoxControl",
        False,
        "Convert RGB Data to the sRGB Color Space",
        9,
        0,
        "Enable this option to converts the RGB data from the vrimg file to the sRGB color space (instead of linear RGB space) before writing to the exr file.",
        colSpan=2)
    scriptDialog.AddSelectionControlToGrid(
        "DeleteInputBox", "CheckBoxControl", False,
        "Delete Input vrimg Files After Conversion", 9, 2,
        "Enable this option to delete the input vrimg file after the conversion has finished.",
        False)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    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)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    #Application Box must be listed before version box or else the application changed event will change the version
    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox",
                "SetChannelBox", "ChannelBox", "SetGammaBox", "GammaBox",
                "HalfBox", "SetBufferSizeBox", "BufferSizeBox", "SRGBBox",
                "SetCompressionBox", "CompressionBox", "DeleteInputBox",
                "DataWindowBox", "MultiPartBox", "ThreadsBox",
                "SeparateFilesBox", "LongChanNamesBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

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

    SceneBoxChanged(None)
    SetChannelBoxModified(None)
    SetGammaBoxModified(None)
    SetBufferSizeBoxModified(None)
    SetCompressionBoxModified(None)

    startup = False

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

    scriptDialog = DeadlineScriptDialog()

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

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

    scriptDialog.AddTabPage("Job Options")

    jobOptions_dialog = JobOptionsUI.JobOptionsDialog()

    scriptDialog.AddScriptControl(jobOptions_dialog)

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

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

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

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

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

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

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

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

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

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.EndTabControl()

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

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

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

    scriptDialog.ShowDialog(False)
Exemplo n.º 15
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)
def __main__():
    global scriptDialog
    global settings

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

    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(
        "IsBlacklistBox", "CheckBoxControl", False,
        "Machine List Is A Blacklist", 5, 2,
        "Use the Machine Limit to specify the maximum number of machines that can render your job at one time. Specify 0 for no limit."
    )

    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("Separator3",
                                  "SeparatorControl",
                                  "Luxrender Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "LXS File", 1,
                                  0, "The file to be rendered.", False)
    scriptDialog.AddSelectionControlToGrid("SceneBox",
                                           "MultiFileBrowserControl",
                                           "",
                                           "LXS Files (*.lxs);;All Files (*)",
                                           1,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 2, 0,
        "The number of threads to use. Specify 0 to use the same number of threads as there are CPUs. ",
        False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 2, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", False, "Submit LXS File", 2, 2,
        "If this option is enabled, the scene file will be submitted with the job, and then copied locally to the slave machine during rendering."
    )
    scriptDialog.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)
    scriptDialog.EndGrid()

    #Application Box must be listed before version box or else the application changed event will change the version
    settings = ("DepartmentBox", "PoolBox", "SecondaryPoolBox", "GroupBox",
                "PriorityBox", "IsBlacklistBox", "MachineListBox",
                "LimitGroupBox", "SceneBox", "ThreadsBox", "SubmitSceneBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

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

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Setup Adobe Media Encoder With Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('MediaEncoder'))

    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("Separator4",
                                  "SeparatorControl",
                                  "Media Encoder Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "DirFileChooserLabel", "LabelControl", "Selection Method", 1, 0,
        "Choose the selection method by file or by directory.", False)
    DirFileChooserRC1 = scriptDialog.AddRadioControlToGrid(
        "DirChooser", "RadioControl", False, "Select by Directory",
        "SelectMethodRadioCtrl", 1, 1,
        "Choose a root directory to scan for all supported files.")
    DirFileChooserRC1.ValueModified.connect(DirFileChooserChanged)
    DirFileChooserRC2 = scriptDialog.AddRadioControlToGrid(
        "FileChooser", "RadioControl", True, "Select by File",
        "SelectMethodRadioCtrl", 1, 2, "Choose by individual file selection.")
    DirFileChooserRC2.ValueModified.connect(DirFileChooserChanged)

    scriptDialog.AddControlToGrid(
        "FileExtLabel", "LabelControl", "File Extension(s)", 2, 0,
        "A comma separated list of file extension(s) to search for supported file formats for batch submission, ie: aepx,mov,mp4. Image file sequences are NOT supported.",
        False)
    scriptDialog.AddControlToGrid("FileExtBox", "TextControl",
                                  "mov,mp4,aep,aepx,prproj", 2, 1)
    scriptDialog.SetEnabled("FileExtLabel", False)
    scriptDialog.SetEnabled("FileExtBox", False)

    scriptDialog.AddSelectionControlToGrid(
        "SubDirectoriesBox", "CheckBoxControl", True,
        "Process Sub-Directories", 2, 2,
        "Optionally choose to scan sub-directories as well for supported files."
    )
    scriptDialog.SetEnabled("SubDirectoriesBox", False)

    scriptDialog.AddControlToGrid(
        "AmeInputDirectoryLabel", "LabelControl", "Input Directory", 3, 0,
        "Choose a root directory to scan for all supported video files.",
        False)
    scriptDialog.AddSelectionControlToGrid("AmeInputDirectoryBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           3,
                                           1,
                                           colSpan=2)
    scriptDialog.SetEnabled("AmeInputDirectoryLabel", False)
    scriptDialog.SetEnabled("AmeInputDirectoryBox", False)

    scriptDialog.AddControlToGrid(
        "AmeOutputDirectoryLabel", "LabelControl", "Output Directory", 4, 0,
        "Choose a root directory to output the generated media file(s).",
        False)
    scriptDialog.AddSelectionControlToGrid("AmeOutputDirectoryBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           4,
                                           1,
                                           colSpan=2)
    scriptDialog.SetEnabled("AmeOutputDirectoryLabel", False)
    scriptDialog.SetEnabled("AmeOutputDirectoryBox", False)

    scriptDialog.AddControlToGrid(
        "InputLabel", "LabelControl", "Input File", 5, 0,
        "The path to the media file to be encoded. This can be any video file format supported by AME.",
        False)
    scriptDialog.AddSelectionControlToGrid("InputBox",
                                           "FileBrowserControl",
                                           "",
                                           "All Files (*)",
                                           5,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output File", 6, 0,
        "The name of the media file to be generated.", False)
    scriptDialog.AddSelectionControlToGrid("OutputBox",
                                           "FileSaverControl",
                                           "",
                                           "All Files (*)",
                                           6,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "PresetLabel", "LabelControl", "Preset File", 7, 0,
        "The preset file to use. This file determines what to do with the input, and can be exported from Media Encoder presets.",
        False)
    scriptDialog.AddSelectionControlToGrid("PresetBox",
                                           "FileBrowserControl",
                                           "",
                                           "AME Preset File (*.epr)",
                                           7,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "VersionLabel", "LabelControl", "Version", 8, 0,
        "The version of Media Encoder to encode with.", False)
    scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "CC2017",
        ("CC2014", "CC2015", "CC2017", "CC2018"), 8, 1)

    scriptDialog.AddSelectionControlToGrid(
        "OverwriteCheckBox", "CheckBoxControl", True,
        "Overwrite Output If Present", 9, 1,
        "If enabled, AME will overwrite any file located at the output location with the new output."
    )
    scriptDialog.AddSelectionControlToGrid(
        "SubmitEPRCheckBox", "CheckBoxControl", False,
        "Submit Preset File With Job", 9, 2,
        "If enabled, the preset file will be uploaded to the Deadline Repository along with the Job (useful if your .epr file is local)."
    )
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

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

    scriptDialog.EndTabControl()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 0)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 2,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                3,
                                                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",
                "VersionBox", "FileExtBox", "AmeInputDirectoryBox",
                "AmeOutputDirectoryBox", "InputBox", "OutputBox", "PresetBox",
                "OverwriteCheckBox", "SubmitEPRCheckBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

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

    scriptDialog.ShowDialog(False)
def CreateDraftScriptDialog():
    global scriptDialog
    global ProjectManagementOptions
    global integration_dialog

    global settings
    global shotgunPath
    global startup
    global versionID
    global deadlineJobID

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

    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,
                                       expand=False)
    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("DraftOptionsSeparator",
                                  "SeparatorControl",
                                  "Draft Options",
                                  0,
                                  0,
                                  colSpan=6)

    scriptDialog.AddControlToGrid(
        "InputLabel", "LabelControl", "Input File", 2, 0,
        "The input file(s) on which to apply the Draft script.", False)
    inputBox = scriptDialog.AddSelectionControlToGrid(
        "InputBox",
        "MultiFileBrowserControl",
        "",
        "All Files (*)",
        2,
        1,
        colSpan=5)
    inputBox.ValueModified.connect(InputImagesModified)

    scriptDialog.AddControlToGrid(
        "OutputDirectoryLabel", "LabelControl", "Output Folder Name", 3, 0,
        "The output folder in which the Draft script should put output files.  Can be absolute, or relative to input folder.",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputDirectoryBox",
                                           "FolderBrowserControl",
                                           "Draft",
                                           "",
                                           3,
                                           1,
                                           colSpan=5)

    scriptDialog.AddControlToGrid(
        "OutputFileLabel", "LabelControl", "Output File Name", 4, 0,
        "The name that the script should use for the output file(s).", False)
    outputFileBox = scriptDialog.AddControlToGrid("OutputFileBox",
                                                  "TextControl",
                                                  "",
                                                  4,
                                                  1,
                                                  colSpan=5)
    outputFileBox.ValueModified.connect(OutputFileBoxModified)

    scriptDialog.AddControlToGrid(
        "FrameListLabel", "LabelControl", "Frame List", 5, 0,
        "The list of Frames that should be processed by the script.", False)
    scriptDialog.AddControlToGrid("FrameListBox",
                                  "TextControl",
                                  "",
                                  5,
                                  1,
                                  colSpan=5)

    distributedJob = scriptDialog.AddSelectionControlToGrid(
        "DraftDistributedJobBox",
        "CheckBoxControl",
        False,
        "Distributed Job",
        6,
        0,
        "Specify if the job will be distributed. If enabled, custom scripts must work with taskStartFrame and taskEndFrame.",
        expand=False)
    distributedJob.ValueModified.connect(AdjustDistributedJobEnabled)

    scriptDialog.AddControlToGrid(
        "DraftNumberOfFramesLabel", "LabelControl", "Frames Per Task", 6, 1,
        "The number of frames, or chunk size, to be assigned to each task.",
        False)
    scriptDialog.AddRangeControlToGrid("DraftNumberOfFramesBox",
                                       "RangeControl",
                                       200,
                                       0,
                                       9999,
                                       0,
                                       1,
                                       6,
                                       2,
                                       expand=False)

    scriptDialog.AddControlToGrid(
        "DraftMachineLimitLabel", "LabelControl", "Machine Limit", 6, 3,
        "The maximum number of machines that can process a distributed job at one time. Specify 0 for no limit.",
        False)
    scriptDialog.AddRangeControlToGrid("DraftMachineLimitBox",
                                       "RangeControl",
                                       5,
                                       0,
                                       9999,
                                       0,
                                       1,
                                       6,
                                       4,
                                       expand=False)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    firstFrameFile = GetFirstFrameFile()
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(
        scriptDialog,
        "DraftMonitor",
        addDraftTab=True,
        projectManagements=["Shotgun", "FTrack"],
        fromDraftSubmitterFlag=True,
        firstFrameFile=firstFrameFile)
    integration_dialog.Draft_dialog.draftQuickRadio.ValueModified.connect(
        InputImagesModified)
    integration_dialog.Draft_dialog.draftCustomRadio.ValueModified.connect(
        InputImagesModified)
    integration_dialog.Draft_dialog.draftFormatBox.ValueModified.connect(
        InputImagesModified)

    scriptDialog.EndTabControl()

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

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

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

    scriptDialog.EndGrid()

    #Load sticky settings
    settings = ("DepartmentBox", "PoolBox", "SecondaryPoolBox", "GroupBox",
                "PriorityBox", "IsBlacklistBox", "MachineListBox",
                "LimitGroupBox", "DraftTemplateBox", "InputBox",
                "OutputDirectoryBox", "OutputFileBox", "FrameListBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    return scriptDialog
def __main__(*args):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

    dialogWidth = 600
    labelWidth = 150
    dialogHeight = 666
    controlWidth = 156

    tabWidth = dialogWidth - 16
    tabHeight = 616

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

    scriptDialog.AddTabControl("Job Options Tabs", dialogWidth + 8, tabHeight)

    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",
                                  "TVPaint Options",
                                  0,
                                  0,
                                  colSpan=6)

    scriptDialog.AddControlToGrid(
        "Job Mode", "LabelControl", "Job Mode", 1, 0,
        "The different TVPaint job modes supported by Deadline.", False)
    jobModeBox = scriptDialog.AddComboControlToGrid(
        "JobModeBox",
        "ComboControl",
        "Sequence/Animation", ("Sequence/Animation", "Single Image",
                               "Script Job", "Export Layers", "Single Layer"),
        1,
        1,
        colSpan=4)
    jobModeBox.ValueModified.connect(JobModeBoxChanged)

    scriptDialog.AddControlToGrid(
        "AlphaSaveModeLabel", "LabelControl", "Alpha Save Mode", 2, 0,
        "The different Alpha Save Mode's supported by TVPaint.", False)
    scriptDialog.AddComboControlToGrid(
        "AlphaSaveModeBox",
        "ComboControl",
        "NoPreMultiply",
        ("NoPreMultiply", "PreMultiply", "NoAlpha", "AlphaOnly"),
        2,
        1,
        colSpan=4)

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

    scriptDialog.AddControlToGrid("OutputLabel", "LabelControl", "Output File",
                                  4, 0, "The output path to render to.", False)
    outputBox = scriptDialog.AddSelectionControlToGrid(
        "OutputBox",
        "FileSaverControl",
        "",
        "QUICKTIME (*.mov);;AVI (*.avi);;BMP (*.bmp);;CINEON (*.cin);;DEEP (*.dip);;DPX (*.dpx);;FLI (*.fli);;GIF (*.gif);;ILBM (*.iff);;JPEG (*.jpg);;PCX (*.pcx);;PNG (*.png);;PSD (*.psd);;SGI (*.rgb);;SOFTIMAGE (*.pic);;SUN (*.ras);;TGA (*.tga);;TIFF (*.tiff);;VPB (*.vpb)",
        4,
        1,
        colSpan=5)
    outputBox.ValueModified.connect(OutputBoxChanged)

    scriptDialog.AddControlToGrid("ScriptLabel", "LabelControl", "Script File",
                                  5, 0, "The render script to use.", False)
    scriptDialog.AddSelectionControlToGrid(
        "ScriptBox",
        "FileBrowserControl",
        "",
        "George Scripts (*.grg);;All Files (*)",
        5,
        1,
        colSpan=5)

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

    scriptDialog.AddControlToGrid(
        "LayerLabel", "LabelControl", "Layer", 7, 0,
        "The layer to export for a Single Layer job.", False)
    scriptDialog.AddControlToGrid("LayerBox",
                                  "TextControl",
                                  "",
                                  7,
                                  1,
                                  colSpan=5)

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 8, 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,
                                       8,
                                       1,
                                       colSpan=4)

    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", False,
        "Submit TVPaint Scene File With Job", 8, 5,
        "If this option is enabled, the scene file will be submitted with the job, and then copied locally to the slave machine during rendering.",
        "")

    scriptDialog.AddControlToGrid(
        "FrameNumberLabel", "LabelControl", "Frame Number", 9, 0,
        "This is the index number of the frame that will be rendered for the job task. ",
        False)
    scriptDialog.AddRangeControlToGrid("FrameNumberBox",
                                       "RangeControl",
                                       0,
                                       0,
                                       1000000,
                                       0,
                                       1,
                                       9,
                                       1,
                                       colSpan=4)
    scriptDialog.AddSelectionControlToGrid(
        "UseCameraBox", "CheckBoxControl", False, "Use Scene Camera", 9, 5,
        "If this option is enabled, TVPaint only renders what's in the camera's frame.",
        "")

    scriptDialog.AddControlToGrid(
        "BuildLabel", "LabelControl", "Build To Force", 10, 0,
        "You can force 32 or 64 bit rendering with this option.", False)
    scriptDialog.AddComboControlToGrid("BuildBox",
                                       "ComboControl",
                                       "None", ("None", "32bit", "64bit"),
                                       10,
                                       1,
                                       colSpan=3)
    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version",
                                  10, 4,
                                  "The version of TVPaint to render with.",
                                  False)
    versionBox = scriptDialog.AddComboControlToGrid("VersionBox",
                                                    "ComboControl", "11",
                                                    ("11", ), 10, 5)
    scriptDialog.EndGrid()

    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "TVPaintMonitor",
                                          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",
                "FrameNumberBox", "ChunkSizeBox", "VersionBox",
                "SubmitSceneBox", "UseCameraBox", "OutputBox", "BuildBox",
                "JobModeBox", "AlphaSaveModeBox", "SubmitScriptBox",
                "ScriptBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    OutputBoxChanged(None)
    JobModeBoxChanged(None)

    scriptDialog.ShowDialog(False)
Exemplo n.º 20
0
def __main__():
    global scriptDialog
    global settings
    global plotterBox
    global plotStyleBox
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    
    scriptDialog = DeadlineScriptDialog()
    
    scriptDialog.SetTitle( "Submit AutoCAD Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'AutoCAD' ) )
    
    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. ", False )

    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", 1, 1, 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", "Limits", 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", "AutoCAD Options", 0, 0 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    
    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "AutoCAD File", 0, 0, "The scene file to render.", False )
    scriptDialog.AddSelectionControlToGrid( "SceneBox", "FileBrowserControl", "", "AutoCAD Files (*.dwg)", 0, 1, colSpan=2 )
    
    scriptDialog.AddSelectionControlToGrid( "SubmitSceneBox", "CheckBoxControl", True, "Submit AutoCAD File", 1, 0, "If this option is enabled, the scene file will be submitted with the job, and then copied locally to the slave machine during rendering." )
    
    scriptDialog.AddControlToGrid( "VersionLabel", "LabelControl", "Version", 2, 0, "The version of AutoCAD to render with.", False )
    versionBox = scriptDialog.AddComboControlToGrid( "VersionBox", "ComboControl", "2016", ("2015","2016"), 2, 1 )
    versionBox.ValueModified.connect(VersionChanged)
    
    scriptDialog.EndGrid()
    
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage("Render")
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator1", "SeparatorControl", "Render Options", 0, 0 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    submitRenderControl = scriptDialog.AddSelectionControlToGrid( "SubmitRenderBox", "CheckBoxControl", False, "Submit Render Job", 0, 0, "When checked, a render job will be submitted. ", True, 1, 2 )
    submitRenderControl.ValueModified.connect(SubmitRenderValueChanged)
    
    scriptDialog.AddSelectionControlToGrid( "CurrentRenderViewBox", "CheckBoxControl", True, "Render View: Current", 1, 0, "When checked, a task to render the current view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "TopRenderViewBox", "CheckBoxControl", False, "Render View: Top", 2, 0, "When checked, a task to render the Top view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "BottomRenderViewBox", "CheckBoxControl", False, "Render View: Bottom", 2, 1, "When checked, a task to render the Bottom view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "LeftRenderViewBox", "CheckBoxControl", False, "Render View: Left", 3, 0, "When checked, a task to render the Left view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "RightRenderViewBox", "CheckBoxControl", False, "Render View: Right", 3, 1, "When checked, a task to render the Right view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "FrontRenderViewBox", "CheckBoxControl", False, "Render View: Front", 4, 0, "When checked, a task to render the Front view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "BackRenderViewBox", "CheckBoxControl", False, "Render View: Back", 4, 1, "When checked, a task to render the Back view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "SWIsometricRenderViewBox", "CheckBoxControl", False, "Render View: SW Isometric", 5, 0, "When checked, a task to render the SW Isometric view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "SEIsometricRenderViewBox", "CheckBoxControl", False, "Render View: SE Isometric", 5, 1, "When checked, a task to render the SE Isometric view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "NEIsometricRenderViewBox", "CheckBoxControl", False, "Render View: NE Isometric", 6, 0, "When checked, a task to render the NE Isometric view will be sent. ", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "NWIsometricRenderViewBox", "CheckBoxControl", False, "Render View: NW Isometric", 6, 1, "When checked, a task to render the NW Isometric view will be sent. ", True, 1, 1 )
       
    #scriptDialog.AddControlToGrid( "RenderPresetLabel", "LabelControl", "Render Presets", 7, 0, "Render Presets", True )
    #scriptDialog.AddComboControlToGrid( "RenderPresetBox", "ComboControl", "Default", ("Current","Draft","Low","Medium","High","Presentation"), 7, 1 )
    
    scriptDialog.AddControlToGrid( "RenderFileNameLabel", "LabelControl", "Output File Name", 8, 0, "The name of your output file.", False )
    scriptDialog.AddSelectionControlToGrid( "RenderFileNameBox", "FileSaverControl","","All Image Formats (*);;BMP(*.bmp);;PCX(*.pcx);;TGA(*.tga);;TIF(*.tif);;JPEG(*.jpeg;*.jpg);;PNG(*.png)", 8, 1,colSpan=3 )
    
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage("Plot")
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator1", "SeparatorControl", "Plot Options", 0, 0 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    submitPlotControl = scriptDialog.AddSelectionControlToGrid( "SubmitPlotBox", "CheckBoxControl", False, "Submit Plot Job", 0, 0, "When checked, a plot job will be submitted. ", True, 1, 2 )
    submitPlotControl.ValueModified.connect(SubmitPlotValueChanged)
    
    scriptDialog.AddControlToGrid( "PlotterLabel", "LabelControl", "Plotter", 1, 0, "The plotter to use for plotting", True )
    plotterBox = scriptDialog.AddComboControlToGrid( "PlotterBox", "ComboControl", "", (""), 1, 1,colSpan=3 )
    
    scriptDialog.AddControlToGrid( "PlotAreaLabel", "LabelControl", "Plot Area", 2, 0, "The area to plot", True )
    scriptDialog.AddComboControlToGrid( "PlotAreaBox", "ComboControl", "Display", ("Display","Extents"), 2, 1 )
    
    scriptDialog.AddControlToGrid( "PaperWidthLabel", "LabelControl", "Paper Width", 3, 0, "", False )
    scriptDialog.AddRangeControlToGrid( "PaperWidthBox", "RangeControl", 10, 0, 1000, 2, 1, 3, 1 )
    scriptDialog.AddControlToGrid( "PaperHeightLabel", "LabelControl", "Paper Height", 3, 2, "", False )
    scriptDialog.AddRangeControlToGrid( "PaperHeightBox", "RangeControl", 10, 0, 1000, 2, 1, 3, 3 )
    
    scriptDialog.AddControlToGrid( "PaperUnitsLabel", "LabelControl", "Plotter Units", 4, 0, "", True )
    scriptDialog.AddComboControlToGrid( "PaperUnitsBox", "ComboControl", "", ("Inches","Millimeters"), 4, 1 )
    
    fitPlotScaleControl = scriptDialog.AddSelectionControlToGrid( "FitPlotScaleBox", "CheckBoxControl", True, "Fit Plot Scale", 5, 0, "Should the plotter fit to scale or used the specified scale.", True, 1, 2 )
    fitPlotScaleControl.ValueModified.connect(FitPlotScaleValueChanged)
    
    scriptDialog.AddControlToGrid( "PlottedUnitsLabel", "LabelControl", "Plotted Units", 6, 0, "", False )
    scriptDialog.AddRangeControlToGrid( "PlottedUnitsBox", "RangeControl", 1, 0, 100000, 2, 1, 6, 1 )
    scriptDialog.AddControlToGrid( "DrawingUnitsLabel", "LabelControl", "Drawing Units", 6, 2, "", False )
    scriptDialog.AddRangeControlToGrid( "DrawingUnitsBox", "RangeControl", 50, 0, 100000, 2, 1, 6, 3 )
    
    scriptDialog.AddControlToGrid( "PlotStyleTable", "LabelControl", "Plot Style Table", 7, 0, "", True )
    plotStyleBox = scriptDialog.AddComboControlToGrid( "PlotStyleBox", "ComboControl", "", (""), 7, 1 )
    
    scriptDialog.AddSelectionControlToGrid( "UseLineweightsBox", "CheckBoxControl", True, "Use Line weights", 8, 0, "", True, 1, 1 )
    scriptDialog.AddSelectionControlToGrid( "ScaleLineweightsBox", "CheckBoxControl", False, "Scale lineweights", 8, 1, "", True, 1, 1 )
    
    scriptDialog.AddControlToGrid( "PlotFileNameLabel", "LabelControl", "Output File Name", 9, 0, "The name of your job. This is optional, and if left blank, it will default to 'Untitled'.", False )
    scriptDialog.AddSelectionControlToGrid( "PlotFileNameBox", "FileSaverControl","","All files (*)", 9, 1,colSpan=3 )
    
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage("Export")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator1", "SeparatorControl", "Export Options", 0, 0 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    submitPlotControl = scriptDialog.AddSelectionControlToGrid( "SubmitExportBox", "CheckBoxControl", False, "Submit Export Job", 0, 0, "When checked, an export job will be submitted. ", True, 1, 2 )
    submitPlotControl.ValueModified.connect(SubmitExportValueChanged)
    
    scriptDialog.AddControlToGrid( "ExportFileNameLabel", "LabelControl", "Output File Name", 1, 0, "The name of your job. This is optional, and if left blank, it will default to 'Untitled'.", False )
    exportFilenameBox = scriptDialog.AddSelectionControlToGrid( "ExportFileNameBox", "FileSaverControl","","3D DWF (*.dwf);;3D DWFx (*.dwfx);;FBX (*.fbx);;Metafile (*.wmf);;ACIS (*.sat);;Lithography (*.stl);;Encapsulated PS (*.eps);;DXX Extract (*.dxx);;Bitmap (*.bmp);;Block (*.dwg);;DGN (*.dgn);;IGES (*.iges);;IGES (*.igs)", 1, 1,colSpan=3 )
    exportFilenameBox.ValueModified.connect(ExportFilenameValueChanged)
    
    scriptDialog.AddSelectionControlToGrid( "ExportVisibleBox", "CheckBoxControl", False, "Export Visible Only", 2, 0, "When checked only visible objects will be exported.", True, 1, 2 )
    
    exportAllBox = scriptDialog.AddSelectionControlToGrid( "ExportAllTypesBox", "CheckBoxControl", True, "Export All Types", 3, 0, "", True, 1, 2 )
    exportAllBox.ValueModified.connect(ExportAllValueChanged)
    
    
    scriptDialog.AddSelectionControlToGrid( "ExportObjectsBox", "CheckBoxControl", True, "Export Objects", 4, 0, "", True, 1, 2 )
    scriptDialog.AddSelectionControlToGrid( "ExportCamerasBox", "CheckBoxControl", True, "Export Cameras", 4, 2, "", True, 1, 2 )
    
    scriptDialog.AddSelectionControlToGrid( "ExportLightsBox", "CheckBoxControl", True, "Export Lights", 5, 0, "", True, 1, 2 )
    scriptDialog.AddSelectionControlToGrid( "ExportMaterialsBox", "CheckBoxControl", True, "Export Materials", 5, 2, "", True, 1, 2 )
    scriptDialog.AddControlToGrid( "ExportTexturesLabel", "LabelControl", "Textures", 6, 0, "", True )
    scriptDialog.AddComboControlToGrid( "TexturesBox", "ComboControl", "", ("Embed","Reference","Copy"), 6, 1 )
    scriptDialog.AddControlToGrid( "DGNVersionLabel", "LabelControl", "DGN Version", 7, 0, "", True )
    scriptDialog.AddComboControlToGrid( "DGNVersionBox", "ComboControl", "", ("V8","V7"), 7, 1 )
    scriptDialog.AddControlToGrid( "DGNConversionUnitsLabel", "LabelControl", "Conversion Units", 8, 0, "", True )
    scriptDialog.AddComboControlToGrid( "DGNConversionUnitsBox", "ComboControl", "", ("Master","Sub"), 8, 1 )
    scriptDialog.AddControlToGrid( "DGNMappingSetupLabel", "LabelControl", "Mapping Setup", 9, 0, "", True )
    scriptDialog.AddComboControlToGrid( "DGNMappingSetupBox", "ComboControl", "", ("Standard",), 9, 1 )
    scriptDialog.AddControlToGrid( "DGBSeedFileLabel", "LabelControl", "Seed File Name", 10, 0, "", False )
    scriptDialog.AddSelectionControlToGrid( "DGNSeedFileBox", "FileSaverControl","","Seed File (*.dgn)", 10, 1,colSpan=3 )
    
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "AutoCADMonitor", 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","BuildBox","PluginIniBox","PathConfigBox","MergePathConfigBox","PreLoadBox", "PostLoadBox", "PreFrameBox", "PostFrameBox", "SubmitSceneBox","LocalRenderingBox","IsMaxDesignBox","OneCpuPerTaskBox","OverrideLanguageBox","LanguageBox","GammaCorrectionBox", "GammaInputBox", "GammaOutputBox","DBRServersBox")
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    SubmitRenderValueChanged( None )
    SubmitPlotValueChanged( None )
    SubmitExportValueChanged( None )
    VersionChanged( None )
    
    scriptDialog.ShowDialog( False )
Exemplo n.º 21
0
def __main__(*args):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

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

    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",
                                  "Mantra Options",
                                  0,
                                  0,
                                  colSpan=4)
    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "IFD File", 1,
                                  0,
                                  "Specify the Mantra IFD file(s) to render.",
                                  False)
    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "IFD Files (*.ifd);;All Files (*)",
        1,
        1,
        colSpan=3)
    sceneBox.ValueModified.connect(SceneFileChanged)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output File (Optional)", 2, 0,
        "Enable this option to override the output path in the IFD file(s).",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "OutputBox",
        "FileSaverControl",
        "",
        "BMP (*.bmp);;EXR (*.exr);;JPG (*.jpg);;PIC (*.pic);;PNG (*.png);;SGI (*.sgi);;TGA (*.tga);;TIF (*.tif);;All Files (*)",
        2,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid(
        "FramesLabel", "LabelControl", "Frame List", 3, 0,
        "The list of frames to render. If you are submitting a sequence of .ifd files, the frames you choose to render should correspond to the numbers in the .ifd files.",
        False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", "", 3, 1)
    scriptDialog.AddSelectionControlToGrid(
        "AutoFramesBox",
        "CheckBoxControl",
        False,
        "Calculate Frames From IFD File",
        3,
        2,
        "If enabled, the frame list will be calculated based on the selected input file.",
        colSpan=2)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 4,
                                  0, "The version of Mantra to render with.",
                                  False)
    versionBox = scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "17.5",
        ("7.0", "8.0", "9.0", "10.0", "11.0", "12.0", "13.0", "14.0", "15.0",
         "15.5", "16.0", "16.5", "17.0", "17.5"), 4, 1)
    versionBox.ValueModified.connect(VersionChanged)
    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 4, 2,
        "The number of threads to use for rendering. ", False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 4, 3)

    scriptDialog.AddControlToGrid(
        "CommandLabel", "LabelControl", "Additional Arguments", 5, 0,
        "Additional command line arguments to pass to the renderer. ", False)
    scriptDialog.AddControlToGrid("CommandBox",
                                  "TextControl",
                                  "",
                                  5,
                                  1,
                                  colSpan=3)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Tile Rendering")
    scriptDialog.AddGrid()

    scriptDialog.AddControlToGrid("Separator9",
                                  "SeparatorControl",
                                  "Tile Rendering",
                                  0,
                                  0,
                                  colSpan=4)
    enableTilesBox = scriptDialog.AddSelectionControlToGrid(
        "EnableTilesCheck", "CheckBoxControl", False, "Enable Tile Rendering",
        1, 0, "Enable to tile render the output.", False)
    enableTilesBox.ValueModified.connect(TilesChanged)

    scriptDialog.AddControlToGrid("XTilesLabel", "LabelControl", "Tiles in X",
                                  2, 0,
                                  "The number of tiles in the X direction.",
                                  False)
    scriptDialog.AddRangeControlToGrid("XTilesBox", "RangeControl", 2, 1, 100,
                                       0, 1, 2, 1)
    scriptDialog.AddControlToGrid("YTilesLabel", "LabelControl", "Tiles in Y",
                                  2, 2,
                                  "The number of tiles in the Y direction.",
                                  False)
    scriptDialog.AddRangeControlToGrid("YTilesBox", "RangeControl", 2, 1, 100,
                                       0, 1, 2, 3)

    singleFrameEnabledBox = scriptDialog.AddSelectionControlToGrid(
        "SingleFrameEnabledCheck", "CheckBoxControl", False,
        "Single Frame Tile Job Enabled", 3, 0,
        "Enable to submit all tiles in a single job.", False, 1, 2)
    singleFrameEnabledBox.ValueModified.connect(SingleFrameChanged)
    scriptDialog.AddControlToGrid(
        "SingleJobFrameLabel", "LabelControl", "Single Job Frame", 3, 2,
        "Which Frame to Render if Single Frame is enabled.", False)
    scriptDialog.AddRangeControlToGrid("SingleJobFrameBox", "RangeControl", 1,
                                       1, 100000, 0, 1, 3, 3)

    SubmitDependentBox = scriptDialog.AddSelectionControlToGrid(
        "SubmitDependentCheck", "CheckBoxControl", True,
        "Submit Dependent Assembly Job", 4, 0,
        "If enabled, a dependent assembly job will be submitted.", False, 1, 2)
    SubmitDependentBox.ValueModified.connect(SubmitDependentChanged)
    scriptDialog.AddSelectionControlToGrid(
        "CleanupTilesCheck", "CheckBoxControl", True,
        "Cleanup Tiles After Assembly", 4, 2,
        "If enabled, all tiles will be cleaned up by the assembly job.", False,
        1, 2)

    scriptDialog.AddSelectionControlToGrid(
        "ErrorOnMissingCheck", "CheckBoxControl", True,
        "Error on Missing Tiles", 5, 0,
        "If enabled, the assembly job will fail if any tiles are missing.",
        False, 1, 2)
    scriptDialog.AddSelectionControlToGrid(
        "ErrorOnMissingBackgroundCheck", "CheckBoxControl", False,
        "Error on Missing Background", 5, 2,
        "If enabled, the assembly will fail if the background is missing.",
        False, 1, 2)

    scriptDialog.AddControlToGrid("AssembleOverLabel", "LabelControl",
                                  "Assemble Over", 6, 0,
                                  "What the tiles should be assembled over.",
                                  False)
    assembleBox = scriptDialog.AddComboControlToGrid(
        "AssembleOverBox", "ComboControl", "Blank Image",
        ("Blank Image", "Previous Output", "Selected Image"), 6, 1)
    assembleBox.ValueModified.connect(AssembleOverChanged)

    scriptDialog.AddControlToGrid("BackgroundLabel", "LabelControl",
                                  "Background Image File", 7, 0,
                                  "The Background image to assemble over.",
                                  False)
    scriptDialog.AddSelectionControlToGrid(
        "BackgroundBox",
        "FileSaverControl",
        "",
        "Bitmap (*.bmp);;JPG (*.jpg);;PNG (*.png);;Targa (*.tga);;TIFF (*.tif);;All Files (*)",
        7,
        1,
        colSpan=3)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "MantraMonitor",
                                          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()

    # Application Box must be listed before version box or else the application changed event will change the version
    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox",
                "OutputBox", "VersionBox", "ThreadsBox", "CommandBox",
                "AutoFramesBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    SceneFileChanged()
    VersionChanged()
    TilesChanged()

    scriptDialog.ShowDialog(False)
def __main__(*args):
    global appSubmission
    global scriptDialog
    global settings

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

    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,
        "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, 7, 1)
    scriptDialog.AddSelectionControlToGrid(
        "IsBlacklistBox", "CheckBoxControl", False,
        "Machine List Is A Blacklist", 7, 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", 8, 0,
        "The whitelisted or blacklisted list of machines.", 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",
                                  "Clarisse Options",
                                  0,
                                  0,
                                  colSpan=5)

    scriptDialog.AddControlToGrid(
        "SceneLabel", "LabelControl", "Scene File", 1, 0,
        "The Scene file or render archive to render.", False)
    scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Project Files (*.project);;Render Archives (*.render);;All Files (*)",
        1,
        1,
        colSpan=4)

    scriptDialog.AddControlToGrid(
        "ImageLabel", "LabelControl", "Images to Render", 2, 0,
        "The paths to the images to renders separated by spaces. If empty, all images in the project will be rendered.",
        False)
    if len(args) > 0:
        # command-line needs args wrapped in double-quotes (inside is wrapped in single quotes), json needs strings to be wrapped in double quotes (so we replace single quotes with doubles).
        # removing 'project://', since it's not needed for the command-line and makes it look messy in our UI.
        renderableImages = json.loads(args[3].replace("project://",
                                                      "").replace("'", '"'))
        instructions = "Select the Images you would like to render by moving them to the right. Selecting none will render all images."

        scriptDialog.AddSubsetControlToGrid("ImageBox",
                                            "SubsetControl",
                                            "",
                                            renderableImages,
                                            2,
                                            1,
                                            colSpan=4,
                                            windowTitle="Images to Render",
                                            instructions=instructions,
                                            separator=" ")
    else:
        scriptDialog.AddControlToGrid("ImageBox",
                                      "TextControl",
                                      "",
                                      2,
                                      1,
                                      colSpan=4)

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

    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(
        "SubmitSceneBox",
        "CheckBoxControl",
        False,
        "Submit Scene File With The Job",
        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=3)

    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 5, 0,
        "The number of rendering threads (0 to use the value specified in the Clarisse configuration file).",
        False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 5, 1)
    scriptDialog.AddSelectionControlToGrid(
        "VerboseBox",
        "CheckBoxControl",
        False,
        "Verbose Logging",
        5,
        2,
        "Enables verbose logging during rendering.",
        colSpan=3)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 6,
                                  0, "The version of Clarisse to render with.",
                                  False)
    versionBox = scriptDialog.AddComboControlToGrid("VersionBox",
                                                    "ComboControl", "3",
                                                    ("1", "2", "3"), 6, 1)

    scriptDialog.AddControlToGrid("RenderUsingLabel", "LabelControl",
                                  "Render Using", 7, 0,
                                  "The excutable to Render using.", False)
    versionBox = scriptDialog.AddComboControlToGrid("RenderUsingBox",
                                                    "ComboControl", "CNode",
                                                    ("CNode", "CRender"), 7, 1)

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

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

    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                8,
                                                4,
                                                expand=False)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)

    scriptDialog.EndGrid()

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox",
                "ChunkSizeBox", "ThreadsBox", "SubmitSceneBox", "VerboseBox",
                "RenderUsingBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

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

        scriptDialog.SetValue("SceneBox", args[0])
        scriptDialog.SetValue("NameBox",
                              Path.GetFileNameWithoutExtension(args[0]))

        scriptDialog.SetValue("FramesBox", args[1])
        scriptDialog.SetValue("VersionBox", args[2])

        if Path.GetExtension(args[0]) == ".render":
            scriptDialog.SetValue("RenderUsingBox", "CRender")
        else:
            scriptDialog.SetValue("RenderUsingBox", "CNode")

        # Keep the submission window above all other windows when submitting from another app.
        scriptDialog.MakeTopMost()

    scriptDialog.ShowDialog(appSubmission)
Exemplo n.º 23
0
def __main__(*args):
    global scriptDialog
    global settings
    global integration_dialog

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

    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",
                                  "Vue Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "Vue File", 1,
                                  0, "The Vue scene file to be rendered. ",
                                  False)
    scriptDialog.AddSelectionControlToGrid("SceneBox",
                                           "MultiFileBrowserControl",
                                           "",
                                           "Vue Files (*.vue);;All Files (*)",
                                           1,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output Folder", 2, 0,
        "The folder where your output will be dumped (this should be a shared folder on the network). ",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           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)
    overrideOutputBox = scriptDialog.AddSelectionControlToGrid(
        "OverrideOutputBox", "CheckBoxControl", False, "Override Output Path",
        3, 2,
        "Whether or not to override the output path specified in the scene.")
    overrideOutputBox.ValueModified.connect(OverrideOutputBoxChanged)

    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(
        "SubmitSceneBox", "CheckBoxControl", False, "Submit Vue Scene", 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."
    )

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 5,
                                  0, "The version of Vue to render with.",
                                  False)
    scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "2016",
        ("7", "8", "9", "10", "11", "2014", "2015", "2016"), 5, 1)
    animationBox = scriptDialog.AddSelectionControlToGrid(
        "AnimationBox", "CheckBoxControl", True, "Render Animation Sequence",
        5, 2,
        "Whether or not to render the full animation instead of a single frame."
    )
    animationBox.ValueModified.connect(AnimationChanged)

    scriptDialog.AddControlToGrid(
        "BuildLabel", "LabelControl", "Build To Force", 6, 0,
        "You can force 32 or 64 bit rendering with this option.", False)
    scriptDialog.AddComboControlToGrid("BuildBox", "ComboControl", "None",
                                       ("None", "32bit", "64bit"), 6, 1)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "VueMonitor",
                                          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)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    #Application Box must be listed before version box or else the application changed event will change the version
    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "OutputBox",
                "OverrideOutputBox", "AnimationBox", "SubmitSceneBox",
                "FramesBox", "ChunkSizeBox", "VersionBox", "BuildBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    AnimationChanged(None)
    OverrideOutputBoxChanged(None)

    if len(args) > 0:
        scriptDialog.SetValue("SceneBox", args[0])
    if len(args) > 1:
        scriptDialog.SetValue("NameBox", args[1])
    if len(args) > 2:
        scriptDialog.SetValue("FramesBox", "0-" + str(int(args[2]) - 1))
    if len(args) > 3:
        scriptDialog.SetValue("VersionBox", args[3])
    if len(args) > 4:
        scriptDialog.SetValue("BuildBox", args[4])

    scriptDialog.ShowDialog(len(args) > 0)
Exemplo n.º 24
0
def __main__( *args ):
    global scriptDialog
    global settings
    
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit Redshift Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'Redshift' ) )

    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, "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, 7, 1 )
    scriptDialog.AddSelectionControlToGrid( "IsBlacklistBox", "CheckBoxControl", False, "Machine List Is A Blacklist", 7, 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", 8, 0, "The whitelisted or blacklisted list of machines.", 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 )

    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.", False )
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage( "Redshift Options" )
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator3", "SeparatorControl", "Redshift Options", 0, 0, colSpan=4 )

    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "Redshift File", 1, 0, "The Redshift file(s) to be rendered. If you are submitting a sequence of .rs files, select one of the numbered frames in the sequence, and the frame range will automatically be detected.", False )
    sceneBox = scriptDialog.AddSelectionControlToGrid( "SceneBox", "FileBrowserControl", "", "Redshift Files (*.rs);;All Files (*)", 1, 1, colSpan=3 )
    sceneBox.ValueModified.connect( UpdateFrames )

    scriptDialog.AddControlToGrid( "FramesLabel", "LabelControl", "Frame List", 2, 0, "The list of frames to render. If you are submitting a sequence of .rs files, the frames you choose to render should correspond to the numbers in the .rs files.", False )
    scriptDialog.AddControlToGrid( "FramesBox", "TextControl", "", 2, 1 )
    autoFramesBox = scriptDialog.AddSelectionControlToGrid( "AutoFramesBox", "CheckBoxControl", False, "Calculate Frames From Redshift File", 2, 2, "If enabled, the frame list will be calculated based on the selected input file.", colSpan=2 )
    autoFramesBox.ValueModified.connect( UpdateFrames )

    scriptDialog.AddControlToGrid( "RenderOptionsLabel", "LabelControl", "Render Options File", 3, 0, "Optional. Overrides render options using a text file. The text file should contain pairs of options on each line. ie.\nUnifiedMaxSamples 1500\nUnifiedFilterSize 3.4", False )
    sceneBox=scriptDialog.AddSelectionControlToGrid( "RenderOptionsBox", "FileBrowserControl", "", "Render Options (*.txt);;All Files (*)", 3, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "ImageOutputLabel", "LabelControl", "Image Output Directory", 4, 0, "Optional. Overrides the image output directory. If left blank, Redshift will save the image output to the folder defined in the .rs file.", False )
    scriptDialog.AddSelectionControlToGrid( "ImageOutputBox", "FolderBrowserControl", "", "", 4, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "PointBasedTechniqueOutputLabel", "LabelControl", "PBT Output Directory", 5, 0, "Optional. Overrides the point-based technique output directory. If left blank, Redshift will save the point-based technique output to the folder defined in the .rs file.", False )
    scriptDialog.AddSelectionControlToGrid( "PBTOutputBox", "FolderBrowserControl", "", "", 5, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "CacheDirectoryLabel", "LabelControl", "Cache Directory", 6, 0, "Optional. Overrides the cache path folder. If left blank, Redshift will output to the default cache path folder.", False )
    scriptDialog.AddSelectionControlToGrid( "CacheDirectoryBox", "FolderBrowserControl", "", "", 6, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "TextureCacheBudgetLabel", "LabelControl", "Texture Cache Budget (MB)", 7, 0, "Optional. Sets the texture cache size (in megabytes). If set to 0, will use the default texture cache budget.", False )
    scriptDialog.AddRangeControlToGrid( "TextureCacheBudgetBox", "RangeControl", 0, 0, 50000, 0, 1, 7, 1 )

    scriptDialog.AddControlToGrid( "GPUsPerTaskLabel", "LabelControl", "GPUs Per Task", 8, 0, "The number of GPUs to use per task. If set to 0, the default number of GPUs will be used.", False )
    gpusPerTaskBox = scriptDialog.AddRangeControlToGrid( "GPUsPerTaskBox", "RangeControl", 0, 0, 16, 0, 1, 8, 1 )
    gpusPerTaskBox.ValueModified.connect( GPUsPerTaskChanged )

    scriptDialog.AddControlToGrid( "SelectGPUDevicesLabel", "LabelControl", "Select GPU Devices", 9, 0, "A comma separated list of the GPUs to use specified by the device id. 'GPUs Per Task' will be ignored.\nie. '0' or '1' or '0,2' or '0,3,4' etc.", False )
    selectGPUDevicesBox = scriptDialog.AddControlToGrid( "SelectGPUDevicesBox", "TextControl", "", 9, 1, colSpan=3 )
    selectGPUDevicesBox.ValueModified.connect( SelectGPUDevicesChanged )

    scriptDialog.AddControlToGrid( "VersionLabel", "LabelControl", "Version", 10, 0, "The version of Redshift to render with.", False )
    scriptDialog.AddComboControlToGrid( "VersionBox", "ComboControl", "1", ( "1", ), 10, 1 )

    resOverrideBox = scriptDialog.AddSelectionControlToGrid( "ResOverrideBox", "CheckBoxControl", False, "Override Resolution", 11, 0, "If enabled, resolution will be overwritten with the values specified." )
    resOverrideBox.ValueModified.connect( enableResOverride )

    scriptDialog.AddControlToGrid( "WidthLabel", "LabelControl", "Width", 12, 0, "Width of the image." )
    scriptDialog.AddRangeControlToGrid( "WidthBox", "RangeControl", 800, 1, 50000, 0, 1, 12, 1, "Width" )
    scriptDialog.SetEnabled( "WidthLabel", False )
    scriptDialog.SetEnabled( "WidthBox", False )
    scriptDialog.AddControlToGrid( "HeightLabel", "LabelControl", "Height", 12, 2, "Height of the image." )
    scriptDialog.AddRangeControlToGrid( "HeightBox", "RangeControl", 600, 1, 50000, 0, 1, 12, 3, "Height" )
    scriptDialog.SetEnabled( "HeightLabel", False )
    scriptDialog.SetEnabled( "HeightBox", False )
    scriptDialog.EndGrid()

    scriptDialog.EndTabPage()
    
    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 )
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()
    
    #Application Box must be listed before version box or else the application changed event will change the version
    settings = ( "DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox", "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox", "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox", "AutoFramesBox", "RenderOptionsBox", "ImageOutputBox", "PBTOutputBox", "CacheDirectoryBox", "TextureCacheBudgetBox", "GPUsPerTaskBox", "SelectGPUDevicesBox", "VersionBox" )
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    UpdateFrames()
    GPUsPerTaskChanged()
    SelectGPUDevicesChanged()
    scriptDialog.ShowDialog( False )
def __main__( *args ):
    global scriptDialog
    global settings
        
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit Cinebench Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'Cinebench' ) )
    
    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, "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, 7, 1 )
    scriptDialog.AddSelectionControlToGrid( "IsBlacklistBox", "CheckBoxControl", False, "Machine List Is A Blacklist", 7, 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", 8, 0, "The whitelisted or blacklisted list of machines.", 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", "Cinebench Options", 0, 0, colSpan=4 )
    
    scriptDialog.AddControlToGrid("VersionLabel","LabelControl","Version", 1, 0, "The version of Cinebench to render with.", False )
    versionBox = scriptDialog.AddComboControlToGrid("VersionBox","ComboControl","15", ("15",), 1, 1 )
    scriptDialog.AddControlToGrid( "JobTypeLabel", "LabelControl", "Job Type", 1, 2, "Choose a normal or maintenance job.", False)
    jobTypeBox = scriptDialog.AddComboControlToGrid( "JobTypeBox", "ComboControl", "Normal", ("Normal","Maintenance"), 1, 3 )
    jobTypeBox.ValueModified.connect(jobTypeChanged)

    scriptDialog.AddControlToGrid( "FramesLabel", "LabelControl", "Frame List", 2, 0, "The list of frames for the normal job.", False )
    scriptDialog.AddControlToGrid( "FramesBox", "TextControl", "", 2, 1, colSpan=3 )
    
    scriptDialog.AddSelectionControlToGrid( "SingleCoreBox", "CheckBoxControl", True, "Run Single Core Test", 3, 0, "If checked, a single core render test will be run.  At least one Test must be selected for the job to render successfully.", colSpan=2 )
    scriptDialog.AddSelectionControlToGrid( "MultiCoreBox", "CheckBoxControl", True, "Run Multi Core Test", 3, 2, "If checked, a multi core render test will be run.  At least one Test must be selected for the job to render successfully.", colSpan=2 )
    
    scriptDialog.AddSelectionControlToGrid( "OpenGLBox", "CheckBoxControl", True, "Run OpenGL Test", 4, 0, "If checked, an OpenGL render test will be run.  At least one Test must be selected for the job to render successfully.", colSpan=2 )

    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)
    scriptDialog.EndGrid()
    
    settings = ("DepartmentBox","CategoryBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","MachineLimitBox","IsBlacklistBox","MachineListBox","LimitGroupBox","FramesBox", "SingleCoreBox", "MultiCoreBox", "OpenGLBox" )
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    jobTypeChanged(None)

    scriptDialog.ShowDialog( False )  
Exemplo n.º 26
0
def __main__(*args):
    global scriptDialog
    global settings

    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle("Submit CSi Bridge Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('CSiBridge'))

    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 'No Job Name'.",
        False)
    scriptDialog.AddControlToGrid("NameBox", "TextControl", "No Job Name", 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 process 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 process times of previous processed files for the job. "
    )

    scriptDialog.AddControlToGrid(
        "ConcurrentTasksLabel", "LabelControl", "Concurrent Tasks", 6, 0,
        "The number of tasks that can process concurrently on a single slave. This is useful if the processing application only uses one thread to process 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,
        "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, 7, 1)
    scriptDialog.AddSelectionControlToGrid(
        "IsBlacklistBox", "CheckBoxControl", False,
        "Machine List Is A Blacklist", 7, 2,
        "You can force the job to process on specific machines by using a whitelist, or you can avoid specific machines by using a blacklist."
    )

    scriptDialog.AddControlToGrid(
        "MachineListLabel", "LabelControl", "Machine List", 8, 0,
        "The whitelisted or blacklisted list of machines.", 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 processing.",
        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 processing right away. Just resume it from the Monitor when you want it to process."
    )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "CSi Bridge File Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl",
                                  "CSi Bridge Data File(s)", 1, 0,
                                  "The CSi Bridge Data File to be processed.",
                                  False)
    scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "MultiFileBrowserControl",
        "",
        "CSi Bridge Files (*.BDB);;Microsoft Access Files (*.MDB);;Microsoft Excel Files (*.XLS);;CSi Bridge Text Files (*.$BR *.B2K)",
        1,
        1,
        colSpan=2)

    OverrideOutput = scriptDialog.AddSelectionControlToGrid(
        "OverrideOutput", "CheckBoxControl", False,
        "Override Output Directory", 3, 0,
        "If this option is enabled, an output directory can be used to re-direct all processed files to.",
        False)
    OverrideOutput.ValueModified.connect(OverrideOutputPressed)
    scriptDialog.AddSelectionControlToGrid("OutputDirectoryBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           3,
                                           1,
                                           colSpan=2)
    scriptDialog.SetEnabled("OutputDirectoryBox", False)

    scriptDialog.AddControlToGrid(
        "BuildLabel", "LabelControl", "Build To Force", 4, 0,
        "You can force 32 or 64 bit processing with this option.", False)
    scriptDialog.AddComboControlToGrid("BuildBox", "ComboControl", "None",
                                       ("None", "32bit", "64bit"), 4, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", False,
        "Submit Data File With Job", 4, 2,
        "If this option is enabled, the Bridge file will be submitted with the job, and then copied locally to the slave machine during processing."
    )
    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 5,
                                  0,
                                  "The version of CSiBridge to render with.",
                                  False)
    scriptDialog.AddComboControlToGrid("VersionBox", "ComboControl", "2015",
                                       ("15", "2014", "2015"), 5, 1)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Advanced Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "Process/Solver Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "ProcessLabel", "LabelControl", "Process Selection", 1, 0,
        "Choose to execute inside of the existing Bridge application process or as a separate process.",
        False)
    ProcessType = scriptDialog.AddComboControlToGrid(
        "ProcessType", "ComboControl", "GUI Process",
        ("GUI Process", "Separate Process"), 1, 1)
    ProcessType.ValueModified.connect(ProcessTypeChanged)

    scriptDialog.AddControlToGrid(
        "SolverLabel", "LabelControl", "Solver Selection", 2, 0,
        "Select the Solver to perform the analysis on the data file.", False)
    SolverType = scriptDialog.AddComboControlToGrid(
        "SolverType", "ComboControl", "Standard Solver",
        ("Standard Solver", "Advanced Solver"), 2, 1)
    SolverType.ValueModified.connect(SolverTypeChanged)
    scriptDialog.EndGrid()

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

    scriptDialog.AddControlToGrid(
        "DesignLabel",
        "LabelControl",
        "Automatically perform design after data file has been opened & analysis results are available.",
        1,
        0,
        colSpan=3)

    scriptDialog.AddSelectionControlToGrid(
        "DesignSteelFrame", "CheckBoxControl", False, "Steel Frame Design", 2,
        0, "Perform steel frame design after the analysis has completed.")
    scriptDialog.AddSelectionControlToGrid(
        "DesignConcreteFrame", "CheckBoxControl", False,
        "Concrete Frame Design", 2, 1,
        "Perform concrete frame design after the analysis has completed.")

    scriptDialog.AddSelectionControlToGrid(
        "DesignAluminiumFrame", "CheckBoxControl", False,
        "Aluminium Frame Design", 3, 0,
        "Perform aluminium frame design after the analysis has completed.")
    scriptDialog.AddSelectionControlToGrid(
        "DesignColdFormedFrame", "CheckBoxControl", False,
        "Cold Formed Frame Design", 3, 1,
        "Peform cold formed frame design after analysis has completed.")
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator6",
                                  "SeparatorControl",
                                  "Deletion Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "DeletionLabel", "LabelControl", "Temp File Deletion", 1, 0,
        "Choose a deletion option to cleanup the analysis/log/out files if required.",
        False)
    DeletionType = scriptDialog.AddComboControlToGrid(
        "DeletionType", "ComboControl", "keep everything",
        ("keep everything", "delete all files (not *.mdb)",
         "delete analysis files only", "delete log/out files only"), 1, 1)
    DeletionType.ValueModified.connect(DeletionTypeChanged)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator7",
                                  "SeparatorControl",
                                  "Additional Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddSelectionControlToGrid(
        "IncludeDataFileBox", "CheckBoxControl", True, "Include Data File", 1,
        0,
        "If enabled, the output zip file will contain the data file OR if outputting to a directory path, the data file will be included."
    )
    scriptDialog.AddSelectionControlToGrid(
        "CompressOutputBox", "CheckBoxControl", True, "Compress (ZIP) Output",
        2, 0, "Automatically compress the output to a single zip file.")

    scriptDialog.AddControlToGrid(
        "CommandLineLabel", "LabelControl", "Command Line Args", 3, 0,
        "Additional command line flags/options can be added here if required.")
    scriptDialog.AddControlToGrid("CommandLineArgs",
                                  "TextControl",
                                  "",
                                  3,
                                  1,
                                  colSpan=2)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    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)
    closeButton.ValueModified.connect(CloseButtonPressed)

    scriptDialog.EndGrid()

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "ChunkSizeBox",
                "OutputBox", "BuildBox", "SubmitSceneBox", "ProcessType",
                "SolverType", "DesignSteelFrame", "DesignConcreteFrame",
                "DesignAluminiumFrame", "DesignColdFormedFrame",
                "DeletionType", "IncludeDataFileBox", "CompressOutputBox",
                "CommandLineArgs", "VersionBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)

    scriptDialog.Shown.connect(InitializeDialog)

    scriptDialog.ShowDialog(True)
Exemplo n.º 27
0
def __main__(*args):
    global scriptDialog
    global settings

    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle("Submit Episode Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('Episode'))

    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(
        "MachineListLabel", "LabelControl", "Machine List", 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.AddControlToGrid("MachineListBox", "MachineListControl", "",
                                  6, 1)
    scriptDialog.AddSelectionControlToGrid("IsBlacklistBox", "CheckBoxControl",
                                           False,
                                           "Machine List Is A Blacklist", 6, 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.EndTabPage()

    scriptDialog.AddTabPage("Episode Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "File Options",
                                  0,
                                  0,
                                  colSpan=20)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "DirFileChooserLabel", "LabelControl", "Selection Method", 1, 0,
        "Choose the selection method by file or by directory.", False)
    DirFileChooserRC1 = scriptDialog.AddRadioControlToGrid(
        "DirChooser", "RadioControl", False, "Select by Directory",
        "SelectMethodRadioCtrl", 1, 1,
        "Choose a root directory to scan for all supported files.", False)
    DirFileChooserRC1.ValueModified.connect(DirFileChooserChanged)
    DirFileChooserRC2 = scriptDialog.AddRadioControlToGrid(
        "FileChooser", "RadioControl", True, "Select by File",
        "SelectMethodRadioCtrl", 1, 2, "Choose by individual file selection.",
        False)
    DirFileChooserRC2.ValueModified.connect(DirFileChooserChanged)

    scriptDialog.AddControlToGrid(
        "DirectoryLabel", "LabelControl", "Input Source Directory", 2, 0,
        "Choose a root directory to scan for all supported files.", False)
    scriptDialog.AddSelectionControlToGrid("DirectoryBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           2,
                                           1,
                                           colSpan=19)
    scriptDialog.SetEnabled("DirectoryLabel", False)
    scriptDialog.SetEnabled("DirectoryBox", False)

    scriptDialog.AddSelectionControlToGrid(
        "SubDirectoriesBox", "CheckBoxControl", True,
        "Process Sub-Directories", 3, 0,
        "Optionally choose to scan sub-directories as well for supported files.",
        False)
    scriptDialog.SetEnabled("SubDirectoriesBox", False)

    scriptDialog.AddControlToGrid("InputLabel", "LabelControl",
                                  "Input Source File(s)", 4, 0,
                                  "The input file(s) to be encoded.", False)
    scriptDialog.AddSelectionControlToGrid("InputFileBox",
                                           "MultiLineMultiFileBrowserControl",
                                           "",
                                           "All Files (*)",
                                           4,
                                           1,
                                           colSpan=19)

    scriptDialog.AddControlToGrid(
        "EncoderInputLabel", "LabelControl", "Encoder (*.epitask) File", 5, 0,
        "The encoder file that will be used (required).", False)
    scriptDialog.AddSelectionControlToGrid(
        "EncoderInputFileBox",
        "FileBrowserControl",
        "",
        "Episode Encoder Files (*.epitask);;All Files (*)",
        5,
        1,
        colSpan=19)

    scriptDialog.AddSelectionControlToGrid(
        "SubmitEncoderBox", "CheckBoxControl", False,
        "Submit Encoder File with Job", 6, 0,
        "If enabled, the Encoder file will be uploaded to the Deadline Repository along with the Job (useful if the file is local).",
        False)

    scriptDialog.AddControlToGrid(
        "OutputFolderLabel", "LabelControl", "Output Path (optional)", 7, 0,
        "The output path of the encoded output. If left blank, the job will output beside the Input Source File with the default naming convention.",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputFolderBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           7,
                                           1,
                                           colSpan=19)

    scriptDialog.AddControlToGrid(
        "CustomOutputNameLabel", "LabelControl",
        "Custom Output Name (optional)", 8, 0,
        "Optionally, override the default output file naming convention.",
        False)
    scriptDialog.AddControlToGrid("CustomOutputNameBox",
                                  "TextControl",
                                  "",
                                  8,
                                  1,
                                  colSpan=19)

    enableSplit = scriptDialog.AddSelectionControlToGrid(
        "SplitBox", "CheckBoxControl", False, "Split and Stitch", 9, 0,
        "If enabled, the encoder(s) will split the encoding and stitch to the final output.",
        False)
    enableSplit.ValueModified.connect(EnableSplitChanged)

    scriptDialog.AddControlToGrid(
        "MinSplitTimeLabel", "LabelControl", "Minimum Split Duration (sec)",
        10, 0,
        "Specify minimum duration in seconds for each split. The default value is 30.",
        False)
    scriptDialog.AddRangeControlToGrid("MinSplitTimeBox", "RangeControl", 30,
                                       9, 3600, 0, 1, 10, 1)
    scriptDialog.AddControlToGrid(
        "MaxSplitsLabel", "LabelControl", "Maximum Number of Video Splits", 10,
        2,
        "Specify maximum number of splits created. The default value is 16.",
        False)
    scriptDialog.AddRangeControlToGrid("MaxSplitsBox",
                                       "RangeControl",
                                       16,
                                       2,
                                       32,
                                       0,
                                       1,
                                       10,
                                       3,
                                       colSpan=17)

    scriptDialog.AddControlToGrid(
        "ArgsLabel", "LabelControl", "Additional CLI Arguments (optional)", 11,
        0, "Any additional command line arguments to be submitted.")
    scriptDialog.AddControlToGrid("ArgsBox",
                                  "TextControl",
                                  "",
                                  11,
                                  1,
                                  colSpan=19)

    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "Cluster Encoding",
                                  12,
                                  0,
                                  colSpan=20)

    scriptDialog.AddControlToGrid(
        "ClusterTypeLabel", "LabelControl", "Cluster Submission", 13, 0,
        "Disabled: No cluster encoding will take place.\nSubmit To Independent Cluster: Submit the encoding job to an existing Episode cluster on the network outside of Deadline queue.",
        False)
    clusterTypeBox = scriptDialog.AddComboControlToGrid(
        "ClusterTypeBox",
        "ComboControl",
        "Disabled", ("Disabled", "Submit To Independent Cluster"),
        13,
        1,
        colSpan=19)
    clusterTypeBox.ValueModified.connect(ClusterTypeChanged)

    scriptDialog.AddControlToGrid(
        "ClusterNameLabel", "LabelControl", "Cluster Name (Bonjour required)",
        14, 0,
        "The name of the cluster that you wish to use for encoding (requires Bonjour to work)."
    )
    clusterName = scriptDialog.AddControlToGrid("ClusterNameBox",
                                                "TextControl",
                                                "",
                                                14,
                                                1,
                                                colSpan=19)
    clusterName.ValueModified.connect(ClusterNameChanged)

    scriptDialog.AddControlToGrid(
        "HostNameLabel", "LabelControl", "Hostname / IP Address", 15, 0,
        "The hostname or ip address of the cluster's master node that you wish to submit to for encoding."
    )
    hostName = scriptDialog.AddControlToGrid("HostNameBox",
                                             "TextControl",
                                             "",
                                             15,
                                             1,
                                             colSpan=19)
    hostName.ValueModified.connect(ClusterHostChanged)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    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)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "IsBlacklistBox", "MachineListBox",
                "LimitGroupBox", "SubDirectoriesBox", "InputFileBox",
                "EncoderInputFileBox", "SubmitEncoderBox", "OutputFolderBox",
                "CustomOutputNameBox", "SplitBox", "ArgsBox",
                "MinSplitTimeBox", "MaxSplitsBox", "ClusterTypeBox",
                "ClusterNameBox", "HostNameBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    DirFileChooserChanged()
    EnableSplitChanged()
    ClusterTypeChanged()

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

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

    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",
                                  "Rib Options",
                                  0,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "SceneLabel", "LabelControl", "RIB Files", 1, 0,
        "The RIB files to be rendered (can be ASCII or binary formatted). These files should be network accessible. ",
        False)
    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "RIB Files (*.rib);;All files (*)",
        1,
        1,
        colSpan=2)
    sceneBox.ValueModified.connect(SceneFileChanged)

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

    scriptDialog.AddControlToGrid(
        "WorkingDirLabel", "LabelControl", "Working Dir (Optional)", 3, 0,
        "The working directory used during rendering. This is required if your RIB files contain relative paths.",
        False)
    scriptDialog.AddSelectionControlToGrid("WorkingDirBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           3,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 4, 0,
        "The number of threads to use for rendering. Set to 0 to let RenderMan automatically determine the optimal thread count.",
        False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 4, 1)
    scriptDialog.AddHorizontalSpacerToGrid("RHSpacer1", 4, 2)

    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "Command Line Options",
                                  5,
                                  0,
                                  colSpan=3)

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

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "RenderManMonitor",
                                          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",
                "ThreadsBox", "CommandLineBox", "WorkingDirBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    SceneFileChanged(None)

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

    defaultLocation = ""

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    jobTypeChanged(None)
    ShellExecuteButtonPressed(None)

    scriptDialog.ShowDialog(True)
Exemplo n.º 30
0
def __main__( *args ):
    global scriptDialog

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit Katana To Deadline" )
    scriptDialog.SetIcon( RepositoryUtils.GetRepositoryFilePath( "plugins/Katana/Katana.ico", True ) )

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "JobOptionsSeparator", "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.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()

    # ACTUAL KATANA SETTINGS
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator4", "SeparatorControl", "Katana Options", 0, 0, colSpan=4 )

    scriptDialog.AddControlToGrid( "FileLabel", "LabelControl", "Katana Scene File", 1, 0, "The file path to the .katana file to use.", False )
    scriptDialog.AddSelectionControlToGrid( "KatanaFileBox", "FileBrowserControl", "", "Katana Files (*.katana)", 1, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "WorkingDirLabel", "LabelControl", "Working Dir (Optional)", 2, 0, "The working directory used during Katana rendering. This is required if your Katana project file contains relative paths.", False )
    scriptDialog.AddSelectionControlToGrid( "WorkingDirBox", "FolderBrowserControl", "", "", 2, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "RangeLabel", "LabelControl", "Frame List", 3, 0, "A comma-separated collection of single frames or frame ranges. ex: 1-2,3,4-6." )
    scriptDialog.AddControlToGrid( "FramesBox", "TextControl", "", 3, 1 )
    scriptDialog.AddSelectionControlToGrid( "SubmitSceneBox", "CheckBoxControl", False, "Submit Katana Scene File", 3, 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", 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.AddControlToGrid( "VersionLabel", "LabelControl", "Version", 4, 2, "The version of Katana to use for this render job.", False )
    scriptDialog.AddComboControlToGrid( "VersionBox", "ComboControl", "3", ("2","3"), 4, 3 )

    scriptDialog.AddControlToGrid( "RenderNodeLabel", "LabelControl", "Render Node (optional)", 5, 0, "The Katana scene node to render. This can be left blank to render the default render node.", False )
    scriptDialog.AddControlToGrid( "RenderNodeBox", "TextControl", "", 5, 1, colSpan=3 )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid() # Submit and Close buttons
    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()

    # sticky settings
    settings = ( "CategoryBox","DepartmentBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","LimitGroupBox","OnJobCompleteBox","MachineListBox","SubmitSuspendedBox","IsBlacklistBox","KatanaFileBox","WorkingDirBox","FramesBox","ChunkSizeBox","SubmitSceneBox","RenderNodeBox","VersionBox" )
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )

    scriptDialog.SetSize( 400, 100 )
    scriptDialog.ShowDialog( True )