Beispiel #1
0
def __main__(*args):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

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

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

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

    scriptDialog.AddControlToGrid(
        "ContentLabel", "LabelControl", "Content Folder (Optional)", 2, 0,
        "The content folder that contains the assets used by the scene file. Using a content folder is recommended for network rendering, but can be left blank.",
        False)
    scriptDialog.AddSelectionControlToGrid("ContentBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           2,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output Folder (Optional)", 3, 0,
        "Override the output folder where the buffers will be saved. This is optional, and can be left blank. Note that when specified, all enabled buffers will be saved to this folder.",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           3,
                                           1,
                                           colSpan=2)

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

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 5, 0,
        "This is the number of frames that will be rendered at a time for each job task. ",
        False)
    scriptDialog.AddRangeControlToGrid("ChunkSizeBox", "RangeControl", 1, 1,
                                       1000000, 0, 1, 5, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", False,
        "Submit Messiah Scene 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(
        "ThreadsLabel", "LabelControl", "Threads", 6, 0,
        "The number of threads to use for rendering.", False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 6, 1)

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

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

    scriptDialog.AddControlToGrid(
        "WidthLabel", "LabelControl", "Width (0 to use default)", 1, 0,
        "The width of the image in pixels (specify 0 to use the default width).",
        False)
    scriptDialog.AddRangeControlToGrid("WidthBox", "RangeControl", 0, 0,
                                       1000000, 0, 1, 1, 1)
    scriptDialog.AddHorizontalSpacerToGrid("AOHSpacer1", 1, 2)

    scriptDialog.AddControlToGrid(
        "HeightLabel", "LabelControl", "Height (0 to use default)", 2, 0,
        "The height of the image in pixels (specify 0 to use the default height).",
        False)
    scriptDialog.AddRangeControlToGrid("HeightBox", "RangeControl", 0, 0,
                                       1000000, 0, 1, 2, 1)

    scriptDialog.AddControlToGrid("Separator5",
                                  "SeparatorControl",
                                  "Antialiasing",
                                  3,
                                  0,
                                  colSpan=3)

    aaOverrideBox = scriptDialog.AddSelectionControlToGrid(
        "OverrideAABox",
        "CheckBoxControl",
        False,
        "Override Antialiasing Settings",
        4,
        0,
        "Enable to override the antialiasing mode and level.",
        colSpan=2)
    aaOverrideBox.ValueModified.connect(AAOverideChanged)

    scriptDialog.AddControlToGrid("AAModeLabel", "LabelControl",
                                  "Antialiasing Mode", 5, 0,
                                  "The antialiasing mode to use.", False)
    scriptDialog.AddComboControlToGrid("AAModeBox", "ComboControl", "Adaptive",
                                       ("Off", "Adaptive", "Enhanced"), 5, 1)

    scriptDialog.AddControlToGrid("AALevelLabel", "LabelControl",
                                  "Antialiasing Level", 6, 0,
                                  "The antialiasing level.", False)
    scriptDialog.AddRangeControlToGrid("AALevelBox", "RangeControl", 3, 1, 10,
                                       0, 1, 6, 1)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "MessiahMonitor",
                                          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", "ContentBox", "OutputBox", "ThreadsBox",
                "BuildBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    AAOverideChanged(None)

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

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

        scriptDialog.SetValue("SceneBox", args[0])
        scriptDialog.SetValue("NameBox",
                              Path.GetFileNameWithoutExtension(args[0]))
        scriptDialog.SetValue("ContentBox", args[1])
        scriptDialog.SetValue("FramesBox", args[2])
        scriptDialog.SetValue("BuildBox", args[3])

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

    scriptDialog.ShowDialog(appSubmission)
Beispiel #2
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)
Beispiel #3
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)
Beispiel #4
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)
Beispiel #5
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)
Beispiel #6
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)
Beispiel #7
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)
def __main__(*args):
    global scriptDialog
    global settings
    global presetSettings
    global startup
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

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

    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",
                                  "Quicktime 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 accordingly. ",
        False)
    inputBox = scriptDialog.AddSelectionControlToGrid("InputBox",
                                                      "FileBrowserControl",
                                                      "",
                                                      "All Files (*)",
                                                      1,
                                                      1,
                                                      colSpan=3)
    inputBox.ValueModified.connect(InputImagesModified)

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

    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(
        "CodecLabel", "LabelControl", "Codec", 4, 0,
        "The codec format to use for the Quicktime. ", False)
    codecBox = scriptDialog.AddComboControlToGrid(
        "CodecBox", "ComboControl", "QuickTime Movie",
        ("3G", "AVI", "DV Stream", "FLC", "MPEG-4", "QuickTime Movie"), 4, 1)
    codecBox.ValueModified.connect(CodecChanged)
    scriptDialog.AddControlToGrid("FrameRateLabel", "LabelControl",
                                  "Frame Rate", 4, 2,
                                  "The frame rate of the Quicktime. ", False)
    scriptDialog.AddRangeControlToGrid("FrameRateBox", "RangeControl", 24.00,
                                       0.01, 100.00, 2, 1.00, 4, 3)

    scriptDialog.AddControlToGrid(
        "AudioLabel", "LabelControl", "Audio File (Optional)", 5, 0,
        "Specify an audio file to be added to the Quicktime movie. Leave blank to disable this feature. ",
        False)
    scriptDialog.AddSelectionControlToGrid("AudioBox",
                                           "FileBrowserControl",
                                           "",
                                           "All Files (*)",
                                           5,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "SettingsLabel", "LabelControl", "Settings File (Optional)", 6, 0,
        "The Quicktime settings file to use. If not specified here, you will be prompted to specify your settings after pressing the Submit button.",
        False)
    scriptDialog.AddSelectionControlToGrid("SettingsBox",
                                           "FileBrowserControl",
                                           "",
                                           "All Files (*)",
                                           6,
                                           1,
                                           colSpan=3)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

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

    scriptDialog.EndTabControl()

    scriptDialog.AddGrid()
    settingsButton = scriptDialog.AddControlToGrid(
        "SettingsButton", "ButtonControl", "Create Settings", 0, 0,
        "Create a new Quicktime settings file. ", False)
    settingsButton.ValueModified.connect(SettingsButtonPressed)
    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)
    # 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", "FrameRateBox", "AudioBox", "CodecBox",
                "SettingsBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

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

    InputImagesModified()
    CodecChanged()

    startup = False

    scriptDialog.ShowDialog(len(args) > 0)
Beispiel #9
0
def __main__(*args):
    global scriptDialog
    global settings

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

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

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

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl",
                                  "Silhouette Version", 2, 0,
                                  "The version of Silhouette to render with.",
                                  False)
    versionBox = scriptDialog.AddComboControlToGrid("VersionBox",
                                                    "ComboControl", "6",
                                                    ("5", "6"), 2, 1)
    versionBox.ValueModified.connect(VersionChanged)

    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox", "CheckBoxControl", False, "Submit Silhouette File",
        2, 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."
    )

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

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

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

    scriptDialog.AddControlToGrid(
        "SessionLabel", "LabelControl", "Session", 1, 0,
        "Make the specified session active in the project. If empty the currently selected session will be used to render.",
        False)
    scriptDialog.AddControlToGrid("SessionBox",
                                  "TextControl",
                                  "",
                                  1,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "NodeLabel", "LabelControl", "Node", 2, 0,
        "The specified node in the active session to render. If empty the currently selected node will be used to render.",
        False)
    scriptDialog.AddControlToGrid("NodeBox",
                                  "TextControl",
                                  "",
                                  2,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "OutputDirectoryLabel", "LabelControl", "Output Directory", 3, 0,
        "The output directory to use. If empty the output directory defined in the session will be used.",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputDirectoryBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           3,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "OutputFilenameLabel", "LabelControl", "Output Filename", 4, 0,
        "The output prefix to use. If empty the output prefix defined in the session will be used.",
        False)
    scriptDialog.AddControlToGrid("OutputFilenameBox",
                                  "TextControl",
                                  "",
                                  4,
                                  1,
                                  colSpan=3)

    overrideFormatBox = scriptDialog.AddSelectionControlToGrid(
        "FormatCheck", "CheckBoxControl", False, "Override Format", 5, 0,
        "Override the image file format to be rendered.")
    overrideFormatBox.ValueModified.connect(OverrideFormatChanged)
    scriptDialog.AddComboControlToGrid(
        "FormatBox",
        "ComboControl",
        "OpenEXR", ("Cineon", "DPX", "IFF", "JPEG", "OpenEXR", "PNG", "SGI",
                    "TIFF", "Targa"),
        5,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid("ResolutionLabel", "LabelControl",
                                  "Resolution", 6, 0,
                                  "The resolution to render with.", False)
    scriptDialog.AddComboControlToGrid("ResolutionBox",
                                       "ComboControl",
                                       "full",
                                       ("full", "half", "third", "quarter"),
                                       6,
                                       1,
                                       colSpan=3)

    scriptDialog.AddControlToGrid("FieldsLabel", "LabelControl", "Fields", 7,
                                  0, "Various options to handle fields.",
                                  False)
    fields = scriptDialog.AddComboControlToGrid(
        "FieldsBox",
        "ComboControl",
        "none", ("none", "interlace", "aa", "bb", "bc", "cd", "dd"),
        7,
        1,
        colSpan=3)
    fields.ValueModified.connect(FieldsChanged)

    scriptDialog.AddControlToGrid("DominanceLabel", "LabelControl",
                                  "Dominance", 8, 0,
                                  "Various options to handle fields.", False)
    scriptDialog.AddComboControlToGrid("DominanceBox",
                                       "ComboControl",
                                       "even", ("even", "odd"),
                                       8,
                                       1,
                                       colSpan=3)

    scriptDialog.AddControlToGrid(
        "AdditionalOptionsLabel", "LabelControl", "Additional Options", 9, 0,
        "Any additional options to use while rendering.", False)
    scriptDialog.AddControlToGrid("AdditionalOptionsBox",
                                  "TextControl",
                                  "",
                                  9,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid("Separator5",
                                  "SeparatorControl",
                                  "Script Options",
                                  10,
                                  0,
                                  colSpan=4)

    runScriptBox = scriptDialog.AddSelectionControlToGrid(
        "RunScript", "CheckBoxControl", False, "Run Script", 11, 0,
        "Run Python script after loading the project.")
    runScriptBox.ValueModified.connect(RunScriptChanged)
    scriptDialog.AddSelectionControlToGrid(
        "DisableRender", "CheckBoxControl", False, "Disable Rendering", 11, 1,
        "If this option is enabled, rendering will be disabled, which might be useful for certain Python script jobs."
    )
    scriptDialog.AddSelectionControlToGrid(
        "SubmitScriptBox", "CheckBoxControl", False,
        "Submit Python Script File", 11, 2,
        "If this option is enabled, the Python script file will be submitted with the job to the Deadline Repository."
    )

    scriptDialog.AddControlToGrid("ScriptFileLabel", "LabelControl",
                                  "Python Script File", 12, 0,
                                  "The Python script file to be executed.",
                                  False)
    scriptDialog.AddSelectionControlToGrid("ScriptFileBox",
                                           "FileBrowserControl",
                                           "",
                                           "Python Files (*.py)",
                                           12,
                                           1,
                                           colSpan=3)

    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", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox",
                "ChunkSizeBox", "VersionBox", "SubmitSceneBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    VersionChanged(None)
    OverrideFormatChanged(None)
    FieldsChanged(None)
    RunScriptChanged(None)

    scriptDialog.ShowDialog(False)
def __main__( *args ):
    global scriptDialog
    global settings
    
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit SketchUp To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'SketchUp' ) )
    
    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.EndTabPage()

    scriptDialog.AddTabPage( "Render Options" )
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator3", "SeparatorControl", "SketchUp Options", 0, 0, colSpan=4 )

    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "SketchUp File", 1, 0, "The scene file to be rendered.", False )
    scriptDialog.AddSelectionControlToGrid( "SceneBox", "FileBrowserControl", "", "SketchUp Files (*.skp)", 1, 1, colSpan=3  )

    scriptDialog.AddControlToGrid( "ExportDirectoryLabel", "LabelControl", "Export Directory", 2, 0, "The directory your saved export file is saved to.", False )
    scriptDialog.AddSelectionControlToGrid( "ExportDirectoryBox", "FolderBrowserControl", "", "", 2, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "ExportNameLabel", "LabelControl", "Export File Prefix", 3, 0, "The name of your output file(s), without the format. If blank, uses SketchUp filename.", False )
    scriptDialog.AddControlToGrid( "ExportNameBox", "TextControl", "", 3, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "SceneNameLabel", "LabelControl", "Scene to Export", 4, 0, "The name of the scene to export. If blank, uses currently selected scene.", False )
    scriptDialog.AddControlToGrid( "SceneNameBox", "TextControl", "", 4, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "ExportTypeLabel", "LabelControl", "Export Type", 5, 0, "Specify the type of job you wish to export.", False ) # SU Free only supports .dae and .kmz
    exportTypeBox = scriptDialog.AddComboControlToGrid( "ExportTypeBox", "ComboControl", "3D", ("3D model", "2D image sequence", "2D image"), 5, 1 )
    exportTypeBox.ValueModified.connect( ExportTypeChanged )
    scriptDialog.AddControlToGrid( "ExportFormatLabel", "LabelControl", "Export Format", 5, 2, "Specify the output format of the job.", False )
    exportFormatBox = scriptDialog.AddComboControlToGrid( "ExportFormatBox", "ComboControl", ".dae", (".3ds", ".dae", ".dwg", ".dxf", ".fbx", ".ifc", "kmz", ".obj", ".wrl", ".xsi"), 5, 3 )
    exportFormatBox.ValueModified.connect( JobOptionChanged )

    scriptDialog.AddControlToGrid( "FrameRateLabel", "LabelControl", "Frame Rate", 6, 0, "Specify the frame rate (frames per second) for the image sequence.", False )
    scriptDialog.AddRangeControlToGrid( "FrameRateBox", "RangeControl", 1, 1, 100000, 2, 0.1, 6, 1 )
    scriptDialog.AddControlToGrid( "CompressionLabel", "LabelControl", "Compression Rate", 6, 2, "Specify the compression rate for jpg's (0.0 smallest size, 1.0 best quality).", False )
    scriptDialog.AddRangeControlToGrid( "CompressionRateBox", "RangeControl", 0, 0, 1, 2, 0.1, 6, 3 )

    scriptDialog.AddControlToGrid( "WidthLabel", "LabelControl", "Width", 7, 0, "The width of the exported image in pixels (if 0, will use default width).", False )
    scriptDialog.AddRangeControlToGrid( "WidthBox", "RangeControl", 0, 0, 16000, 0, 1, 7, 1 )
    scriptDialog.AddSelectionControlToGrid( "AntiAliasBox", "CheckBoxControl", False, "Anti-alias", 7, 2, "Specify if you want to use anti-aliasing.")
    
    scriptDialog.AddControlToGrid( "HeightLabel", "LabelControl", "Height", 8, 0, "The height of the exported image in pixels (if 0, will use default height).", False )
    scriptDialog.AddRangeControlToGrid( "HeightBox", "RangeControl", 0, 0, 16000, 0, 1, 8, 1 )
    scriptDialog.AddSelectionControlToGrid( "TransparentBox", "CheckBoxControl", False, "Transparent", 8, 2, "Specify whether you want the image transparent or not.")

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 9, 0, "The version of SketchUp to render with.", False )
    scriptDialog.AddComboControlToGrid("VersionBox", "ComboControl", "2018", ("7","8","2013", "2014", "2015", "2016", "2017", "2018" ), 9, 1 )
    scriptDialog.AddSelectionControlToGrid("SubmitSceneBox", "CheckBoxControl", False, "Submit SketchUp Scene", 9, 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.AddControlToGrid( "VRayOptionsSeparator", "SeparatorControl", "V-Ray Options", 0, 0, colSpan=4 )

    useVrayBox = scriptDialog.AddSelectionControlToGrid( "VrayBox", "CheckBoxControl", False, "Use VRay", 1, 0, "If this option is enabled, V-Ray is used to render the sceneFile." )
    useVrayBox.ValueModified.connect( JobOptionChanged )
    vrayVersionBox = scriptDialog.AddComboControlToGrid( "VrayVersionBox", "ComboControl", "2", ("2", "3"), 1, 1 )
    vrayVersionBox.ValueModified.connect( JobOptionChanged )

    scriptDialog.AddControlToGrid( "VrayFramesLabel", "LabelControl", "Frame List", 2, 0, "The list of frames to render.", False )
    scriptDialog.AddControlToGrid( "VrayFramesBox", "TextControl", "0", 2, 1 )
    scriptDialog.AddControlToGrid( "VrayChunkSizeLabel", "LabelControl", "Frames Per Task", 2, 2, "The number of frames rendered per task in a V-Ray 3 (or later) job.", False )
    scriptDialog.AddRangeControlToGrid( "VrayChunkSizeBox", "RangeControl", 1, 1, 1000000, 0, 1, 2, 3 )

    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", "PoolBox", "SecondaryPoolBox", "GroupBox", "PriorityBox", "IsBlacklistBox",
                 "MachineListBox", "LimitGroupBox", "ExportTypeBox", "ExportFormatBox", "ExportDirectoryBox",
                 "ExportNameBox", "FrameRateBox", "CompressionRateBox", "WidthBox", "HeightBox", "AntiAliasBox",
                 "TransparentBox", "SceneBox", "VersionBox", "SubmitSceneBox", "SceneNameBox",
                 "VrayBox", "VrayVersionBox", "VrayFramesBox", "VrayChunkSizeBox" )

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

    # Determine if submitting from monitor or from SketchUp
    inAppSubmission = False
    if len( args ) > 0:
        inAppSubmission = True
        scriptDialog.SetValue( "SceneBox", args[0] )
        scriptDialog.SetValue( "VersionBox", args[1] )
        if len( args ) > 2:
            scriptDialog.SetValue( "SceneNameBox", args[2] )
        
        # Keep the submission window above all other windows when submitting from another app.
        scriptDialog.MakeTopMost()

    ExportTypeChanged()

    scriptDialog.ShowDialog( inAppSubmission )
Beispiel #11
0
def __main__():
    global scriptDialog
    global settings

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

    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",
                                  "FFmpeg Options",
                                  0,
                                  0,
                                  colSpan=2)

    scriptDialog.AddControlToGrid("Input0Label", "LabelControl", "Input File",
                                  1, 0, "The input file to process.", False)
    scriptDialog.AddSelectionControlToGrid(
        "Input0Box", "FileBrowserControl", "",
        "AVI Files (*.avi);;M2V Files (*.m2v);;MPG Files (*.mpg);;VOB Files (*.vob);;WAV Files (*.wav);;All Files (*)",
        1, 1)

    scriptDialog.AddControlToGrid(
        "Input0ArgsLabel", "LabelControl", "Input Arguments", 2, 0,
        "Additional command line arguments for the input file. ", False)
    scriptDialog.AddControlToGrid("Input0ArgsBox", "TextControl", "", 2, 1)

    scriptDialog.AddSelectionControlToGrid(
        "Input0ReplacePaddingBox", "CheckBoxControl", True,
        "Replace Frame in Input File(s) With Padding (file%03d.ext)", 3, 1,
        "If enabled, the frame number in the file name will be replaced by frame padding before being passed to FFMpeg. This should be enabled if you are passing a sequence of images as input."
    )

    scriptDialog.AddControlToGrid("OutputLabel", "LabelControl", "Output File",
                                  4, 0, "The output file path.", False)
    scriptDialog.AddSelectionControlToGrid("OutputBox", "FileSaverControl", "",
                                           "All Files (*)", 4, 1)

    scriptDialog.AddControlToGrid(
        "OutputArgsLabel", "LabelControl", "Output Arguments", 5, 0,
        "Additional command line arguments for the output file. ", False)
    scriptDialog.AddControlToGrid("OutputArgsBox", "TextControl", "", 5, 1)

    scriptDialog.AddControlToGrid(
        "AdditionalArgsLabel", "LabelControl", "Additional Arguments", 6, 0,
        "Additional general command line arguments.", False)
    scriptDialog.AddControlToGrid("AdditionalArgsBox", "TextControl", "", 6, 1)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Additional Input Files")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "Additional Input Files",
                                  0,
                                  0,
                                  colSpan=2)

    useSameArgsBox = scriptDialog.AddSelectionControlToGrid(
        "UseSameArgsBox", "CheckBoxControl", False,
        "All Inputs Use Same Arguments as Input 1", 1, 0,
        "If enabled, all additional input files will use the same arguments as the main input file.",
        False)
    useSameArgsBox.ValueModified.connect(UseSameArgsModified)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    currRow = 0
    for i in range(1, 9):
        scriptDialog.AddControlToGrid("Input%dLabel" % i, "LabelControl",
                                      "Input File %d" % (i + 1), currRow, 0,
                                      "An additional input file to process.",
                                      False)
        scriptDialog.AddSelectionControlToGrid(
            "Input%dBox" % i,
            "FileBrowserControl",
            "",
            "AVI Files (*.avi);;M2V Files (*.m2v);;MPG Files (*.mpg);;VOB Files (*.vob);;WAV Files (*.wav);;All Files (*)",
            currRow,
            1,
            colSpan=2)
        currRow += 1

        scriptDialog.AddControlToGrid(
            "Input%dArgsLabel" % i, "LabelControl",
            "Input Arguments %d" % (i + 1), currRow, 0,
            "Additional command line arguments for the input file above.",
            False)
        scriptDialog.AddControlToGrid("Input%dArgsBox" % i, "TextControl", "",
                                      currRow, 1)
        scriptDialog.AddSelectionControlToGrid(
            "Input%dReplacePaddingBox" % i,
            "CheckBoxControl",
            True,
            "Replace Padding",
            currRow,
            2,
            "If enabled, the frame number in the file name will be replaced by frame padding before being passed to FFMpeg. This should be enabled if you are passing a sequence of images as input.",
            expand=False)
        currRow += 1

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("FFmpeg Preset Files")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator5",
                                  "SeparatorControl",
                                  "FFmpeg Preset Files",
                                  0,
                                  0,
                                  colSpan=2)

    scriptDialog.AddControlToGrid("VideoPresetLabel", "LabelControl",
                                  "Video Preset File", 1, 0,
                                  "The video preset file.", False)
    scriptDialog.AddSelectionControlToGrid(
        "VideoPresetBox", "FileBrowserControl", "",
        "FFmpeg Preset (*.ffpreset);;All Files (*)", 1, 1)

    scriptDialog.AddControlToGrid("AudioPresetLabel", "LabelControl",
                                  "Audio Preset File", 2, 0,
                                  "The audio preset file.", False)
    scriptDialog.AddSelectionControlToGrid(
        "AudioPresetBox", "FileBrowserControl", "",
        "FFmpeg Preset (*.ffpreset);;All Files (*)", 2, 1)

    scriptDialog.AddControlToGrid("SubtitlePresetLabel", "LabelControl",
                                  "Subtitle Preset File", 3, 0,
                                  "The subtitle preset file.", False)
    scriptDialog.AddSelectionControlToGrid(
        "SubtitlePresetBox", "FileBrowserControl", "",
        "FFmpeg Preset (*.ffpreset);;All Files (*)", 3, 1)
    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",
                "ChunkSizeBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    UseSameArgsModified(None)

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

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

    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", "Octane Options", 0, 0, colSpan=4 )

    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "Octane Scene File", 1, 0, "The scene file to render.", False )
    sceneBox = scriptDialog.AddSelectionControlToGrid( "SceneBox", "FileBrowserControl", "", "Octane Scene Files (*.ocs);;Octane Package Files (*.orbx)", 1, 1, colSpan=3 )
    sceneBox.ValueModified.connect( SceneBoxChanged )

    scriptDialog.AddControlToGrid( "OutputLabel", "LabelControl", "Output Folder", 2, 0, "Override the output path in the scene.", False )
    scriptDialog.AddSelectionControlToGrid( "OutputBox","FolderBrowserControl", "","All Files (*)", 2, 1, colSpan=3 )

    framePerFileBox = scriptDialog.AddSelectionControlToGrid( "FramePerFileBox", "CheckBoxControl", False, "Enable \"Single Frame per OCS File\" Mode", 3, 0, "Enable this mode if you have an animation with one frame per OCS file. Select just one file from the sequence.", colSpan=2 )
    framePerFileBox.ValueModified.connect( FramePerFileBoxChanged )

    scriptDialog.AddControlToGrid( "FilenameTemplateLabel", "LabelControl", "Filename Template", 4, 0, "Template parameters:\n\t%i render target index\n\t%n render target node name\n\t%e file extension\n\t%t timestamp\n\t%f frame number\n\t%F frame number prefixed with 0s\n\t%s sub frame number\n\t%p render pass name\nNote: Parameters ignored in \"Single Frame per OCS File\" mode." )
    scriptDialog.AddControlToGrid( "FilenameTemplateBox", "TextControl", "%F.%e", 4, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "VersionLabel", "LabelControl", "Version", 5, 0, "The Octane Standalone application version to use.", False )
    versionBox = scriptDialog.AddComboControlToGrid( "VersionBox", "ComboControl", "4", ( "1", "2", "3", "4" ), 5, 1 )
    versionBox.ValueModified.connect( VersionBoxChanged )

    scriptDialog.AddControlToGrid( "FileFormatLabel", "LabelControl", "File Format", 5, 2, "What format the output file will be saved as.", False )
    scriptDialog.AddComboControlToGrid( "FileFormatBox", "ComboControl", "png8", formatOptions, 5, 3 )

    scriptDialog.AddControlToGrid( "TargetOCSLabel", "LabelControl", "Render Target (ocs)", 6, 0, "Select the target to render (ocs files only).", False )
    scriptDialog.AddComboControlToGrid( "TargetOCSBox", "ComboControl", "", [""], 6, 1 )
    scriptDialog.SetEnabled( "TargetOCSBox", False )
    scriptDialog.AddControlToGrid( "TargetORBXLabel", "LabelControl", "Render Target (orbx)", 6, 2, "The target to render (orbx files only). Leaving this field blank will render all targets.", False )
    scriptDialog.AddControlToGrid( "TargetORBXBox", "TextControl", "", 6, 3 )
    scriptDialog.SetEnabled( "TargetORBXBox", False )
    
    scriptDialog.AddControlToGrid( "FramesLabel", "LabelControl", "Frame List", 7, 0, "The list of frames to render.", False )
    scriptDialog.AddControlToGrid( "FramesBox", "TextControl", "", 7, 1, colSpan=3 )

    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=2 )
    singleFileBox = scriptDialog.AddSelectionControlToGrid( "SingleFileBox", "CheckBoxControl", False, "Single Frame Job", 8, 3, "This should be checked if you're submitting a single Octane file only, as opposed to separate files per frame. " )
    singleFileBox.ValueModified.connect(SingleFileBoxChanged)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Advanced Options")
    scriptDialog.AddGrid()
    overrideSamplingCheck = scriptDialog.AddSelectionControlToGrid( "OverrideSamplingBox", "CheckBoxControl", False, "Override Sampling", 9, 0, "Enable to override the Sampling setting in the scene file.", False )
    overrideSamplingCheck.ValueModified.connect(OverrideSamplingChanged)
    scriptDialog.AddRangeControlToGrid( "SampleBox", "RangeControl", 10, 0, 100000, 0, 1, 9, 1, colSpan=2 )
    scriptDialog.SetEnabled("SampleBox", False)
    
    scriptDialog.AddControlToGrid( "GPUsPerTaskLabel", "LabelControl", "GPUs Per Task", 10, 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, 1024, 0, 1, 10, 1, colSpan=2 )
    GPUsPerTaskBox.ValueModified.connect(GPUsPerTaskChanged)

    scriptDialog.AddControlToGrid( "GPUsSelectDevicesLabel", "LabelControl", "Select GPU Devices", 11, 0, "A comma separated list of the GPU devices to use specified by device Id. 'GPUs Per Task' will be ignored.", False )
    GPUsSelectDevicesBox = scriptDialog.AddControlToGrid( "GPUsSelectDevicesBox", "TextControl", "", 11, 1, colSpan=2 )
    GPUsSelectDevicesBox.ValueModified.connect(GPUsSelectDevicesChanged)

    scriptDialog.AddControlToGrid( "CmdLabel", "LabelControl", "Command Line Args", 12, 0, "Additional command line arguments to use for rendering.", False )
    scriptDialog.AddControlToGrid( "CmdBox", "TextControl", "", 12, 1, colSpan=3 )
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "OctaneMonitor", 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","OutputBox","SampleBox","FramesBox","FilenameTemplateBox","FileFormatBox","CmdBox","SingleFileBox", "OverrideSamplingBox","TargetORBXBox","ChunkSizeBox","VersionBox","FramePerFileBox" )
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    scriptDialog.ShowDialog( False )
Beispiel #13
0
def __main__():
    global scriptDialog
    global settings

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

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

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

    useDbBox = scriptDialog.AddSelectionControlToGrid(
        "UseDatabaseBox",
        "CheckBoxControl",
        False,
        "Use Database Scene",
        1,
        0,
        "If this option is enabled, Harmony use a scene from the Database it is connected to.",
        colSpan=2)
    useDbBox.ValueModified.connect(UseDatabaseChanged)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox",
        "CheckBoxControl",
        False,
        "Submit Harmony Scene",
        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.",
        colSpan=2)

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "Harmony File",
                                  2, 0, "The scene file to be rendered.",
                                  False)
    scriptDialog.AddSelectionControlToGrid("SceneBox",
                                           "FileBrowserControl",
                                           "",
                                           "Harmony Files (*.xstage)",
                                           2,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "EnvironmentLabel", "LabelControl", "Environment", 3, 0,
        "The environment of the scene you want to render.", False)
    scriptDialog.AddControlToGrid("EnvironmentBox", "TextControl", "", 3, 1)
    scriptDialog.AddControlToGrid(
        "JobLabel", "LabelControl", "Job", 3, 2,
        "The Job that the scene you wish to render is part of.", False)
    scriptDialog.AddControlToGrid("JobBox", "TextControl", "", 3, 3)

    scriptDialog.AddControlToGrid("SceneNameLabel", "LabelControl", "Scene", 4,
                                  0, "The scene that you want to render.",
                                  False)
    scriptDialog.AddControlToGrid("SceneNameBox", "TextControl", "", 4, 1)
    scriptDialog.AddControlToGrid(
        "VersionLabel", "LabelControl", "Version", 4, 2,
        "The version of the scene that you want to render.", False)
    scriptDialog.AddControlToGrid("SceneVersionBox", "TextControl", "", 4, 3)

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

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl",
                                  "Harmony Version", 6, 0,
                                  "The version of Harmony to render with.",
                                  False)
    scriptDialog.AddComboControlToGrid("VersionBox", "ComboControl", "15",
                                       ("10", "11", "12", "14", "15"), 6, 1)
    scriptDialog.AddControlToGrid(
        "CameraLabel", "LabelControl", "Camera", 6, 2,
        "The Camera to render with. If Blank, the scene will be rendered with the current Camera.",
        False)
    scriptDialog.AddControlToGrid("CameraBox", "TextControl", "", 6, 3)

    useResNameBox = scriptDialog.AddSelectionControlToGrid(
        "UseResolutionNameBox",
        "CheckBoxControl",
        False,
        "Use Resolution Preset",
        7,
        0,
        "If this option is enabled, Harmony uses the specified resolution preset in the box below.",
        colSpan=2)
    useResNameBox.ValueModified.connect(UseResolutionName)

    scriptDialog.AddControlToGrid("PresetLabel", "LabelControl",
                                  "Resolution Preset", 8, 0,
                                  "The resolution preset to use.", False)
    resolutionPresetBox = scriptDialog.AddComboControlToGrid(
        "ResolutionPresetBox", "ComboControl", "HDTV_1080p24",
        ("HDTV_1080p24", "HDTV_1080p25", "HDTV_720p24", "4K_UHD", "8K_UHD",
         "DCI_2K", "DCI_4K", "film-2K", "film-4K", "film-1.33_H",
         "film-1.66_H", "film-1.66_V", "Cineon", "NTSC", "PAL", "2160p",
         "1440p", "1080p", "720p", "480p", "360p", "240p", "low", "Web_Video",
         "Game_512", "Game_512_Ortho", "WebCC_Preview", "Custom"), 8, 1)
    resolutionPresetBox.ValueModified.connect(ResPresetChanged)
    scriptDialog.AddControlToGrid(
        "PresetNameLabel", "LabelControl", "Preset Name", 8, 2,
        "The name of the custom resolution preset that will be used.", False)
    scriptDialog.AddControlToGrid("PresetName", "TextControl", "", 8, 3)

    scriptDialog.AddControlToGrid(
        "ResolutionXLabel", "LabelControl", "Resolution X", 9, 0,
        "The X resolution of the render image. If 0, then the current resolution and Field of view will be used.",
        False)
    scriptDialog.AddRangeControlToGrid("ResolutionXBox", "RangeControl", 1920,
                                       0, 100000, 0, 1, 9, 1)
    scriptDialog.AddControlToGrid(
        "ResolutionYLabel", "LabelControl", "Resolution Y", 9, 2,
        "The Y resolution of the render image. If 0, then the current resolution and Field of view will be used.",
        False)
    scriptDialog.AddRangeControlToGrid("ResolutionYBox", "RangeControl", 1080,
                                       0, 100000, 0, 1, 9, 3)

    scriptDialog.AddControlToGrid(
        "FieldOfViewLabel", "LabelControl", "Field of View", 10, 0,
        "The Field of view of the render image. If 0, then the current resolution and Field of view will be used.",
        False)
    scriptDialog.AddRangeControlToGrid("FieldOfViewBox", "RangeControl", 41.11,
                                       0, 89, 2, 0.1, 10, 1)

    scriptDialog.SetEnabled("ResolutionPresetBox", False)
    scriptDialog.SetEnabled("PresetName", 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()

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox",
                "ChunkSizeBox", "VersionBox", "SubmitSceneBox",
                "ResolutionXBox", "ResolutionYBox", "FieldOfViewBox",
                "UseDatabaseBox", "EnvironmentBox", "JobBox", "SceneNameBox",
                "SceneVersionBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    UseDatabaseChanged()

    scriptDialog.ShowDialog(False)
Beispiel #14
0
def __main__( *args ):
    global scriptDialog
    global settings
        
    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle( "Submit EnergyPlus Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'EnergyPlus' ) )
    
    scriptDialog.AddTabControl("Tabs", 0, 0)
    
    scriptDialog.AddTabPage("Job Options")
    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 'No Job Name'.", False )
    scriptDialog.AddControlToGrid( "NameBox", "TextControl", "No Job Name", 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 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", "EnergyPlus File Options", 0, 0, colSpan=3 )

    scriptDialog.AddControlToGrid( "DataLabel", "LabelControl", "EnergyPlus IDF File(s)", 1, 0, "The EnergyPlus IDF file(s) to be processed.", False )
    scriptDialog.AddSelectionControlToGrid( "DataBox", "MultiFileBrowserControl", "", "EnergyPlus Files (*.idf)", 1, 1, colSpan=2 )
    
    scriptDialog.AddControlToGrid( "WeatherDirLabel", "LabelControl", "Weather EPW File(s)", 2, 0, "The Weather EPW File(s) to be referenced (Optional).", False )
    scriptDialog.AddSelectionControlToGrid( "WeatherDirBox", "MultiFileBrowserControl", "", "EnergyPlus Files (*.epw)", 2, 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("SubmitDataBox","CheckBoxControl",False,"Submit File(s) With The Job", 4, 2, "If this option is enabled, the data file(s) will be submitted with the job, and then copied locally to the slave machine during processing.")
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage("Advanced Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator4", "SeparatorControl", "EP Post-Process Options", 0, 0, colSpan=3 )

    scriptDialog.AddControlToGrid( "ReadVarsESOLabel", "LabelControl", "../ReadVarsESO.exe Max.Columns", 1, 0, "Limit the maximium number of columns used when calling readVarsESO.exe.", False )
    ReadVarsESOMaxCol = scriptDialog.AddComboControlToGrid( "ReadVarsESOMaxColBox", "ComboControl", "unlimited", ("unlimited","less than 250"), 1, 1 )
    ReadVarsESOMaxCol.ValueModified.connect(ReadVarsESOMaxColChanged)

    scriptDialog.AddSelectionControlToGrid( "ConvESOBox", "CheckBoxControl", False, "Execute ../convertESOMTR.exe", 2, 0, "Execute the convertESOMTR.exe application as a post-process.", colSpan=2 )

    scriptDialog.AddSelectionControlToGrid( "CSVprocBox", "CheckBoxControl", False, "Execute ../CSVproc.exe", 3, 0, "Execute the csvProc.exe application as a post-process.", colSpan=2 )
    scriptDialog.EndGrid()

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

    scriptDialog.AddSelectionControlToGrid( "MultithreadingBox", "CheckBoxControl", True, "Multithreading", 1, 0, "If enabled, EnergyPlus simulations will use multithreading. Ignored if Concurrent Tasks > 1." )

    scriptDialog.AddSelectionControlToGrid( "DebugBox", "CheckBoxControl", False, "Pause Mode (DEBUG only)", 2, 0, "Only for Debug purposes. Will PAUSE the program execution at key steps." )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator6", "SeparatorControl", "Other 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 EP output to a single zip file." )
    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","DataBox","ChunkSizeBox","OutputBox","BuildBox", "WeatherDirBox", "ReadVarsESOMaxColBox", "ConvESOBox", "CSVprocBox", "MultithreadingBox", "DebugBox", "IncludeDataFileBox", "CompressOutputBox")
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )

    scriptDialog.Shown.connect( InitializeDialog )

    scriptDialog.ShowDialog( True )
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)
Beispiel #16
0
def __main__(*args):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit Mental Ray Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('MentalRay'))

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

    scriptDialog.AddControlToGrid(
        "SceneLabel", "LabelControl", "Mental Ray File", 1, 0,
        "The Mental Ray files to be rendered. Can be a single file, or a sequence of files. ",
        False)
    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Mental Ray Files (*.mi *.mi2)",
        1,
        1,
        colSpan=3)
    sceneBox.ValueModified.connect(SceneBoxChanged)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output Folder", 2, 0,
        "The location to which your output files will be written. ", False)
    scriptDialog.AddSelectionControlToGrid("OutputBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           2,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  3, 0, "The list of frames to render.", False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", "", 3, 1)
    SeparateFilesBox = scriptDialog.AddSelectionControlToGrid(
        "SeparateFilesBox", "CheckBoxControl", False,
        "Separate Input MI Files Per Frame", 3, 2,
        "Should be checked if you are submitting a sequence of MI files that represent a single frame each. "
    )
    SeparateFilesBox.ValueModified.connect(SeparateFilesChanged)

    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(
        "FrameOffsetLabel", "LabelControl", "Frame Offset", 4, 2,
        "The first frame in the input MI file being rendered, which is used to offset the frame range being passed to the mental ray renderer. "
    )
    scriptDialog.AddRangeControlToGrid("FrameOffsetBox", "RangeControl", 1,
                                       -100000, 100000, 0, 1, 4, 3)

    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 5, 0,
        "The number of threads to use for rendering. ", False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 5, 1)
    scriptDialog.AddControlToGrid("VerboseLabel", "LabelControl", "Verbosity",
                                  5, 2,
                                  "Set the verbosity level for the render.",
                                  False)
    scriptDialog.AddRangeControlToGrid("VerboseBox", "RangeControl", 5, 0, 7,
                                       0, 1, 5, 3)

    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.AddSelectionControlToGrid(
        "LocalRenderingBox",
        "CheckBoxControl",
        False,
        "Enable Local Rendering",
        6,
        2,
        "If enabled, the frames will be rendered locally, and then copied to their final network location. ",
        colSpan=2)

    scriptDialog.AddControlToGrid(
        "CommandLineLabel", "LabelControl", "Command Line Args", 7, 0,
        "Specify additional command line arguments you would like to pass to the mental ray renderer. ",
        False)
    scriptDialog.AddControlToGrid("CommandLineBox",
                                  "TextControl",
                                  "",
                                  7,
                                  1,
                                  colSpan=3)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "MentalRayMonitor",
                                          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",
                "ChunkSizeBox", "OutputBox", "ThreadsBox", "BuildBox",
                "FrameOffsetBox", "LocalRenderingBox", "VerboseBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    SceneBoxChanged(None)
    SeparateFilesChanged(None)

    scriptDialog.ShowDialog(False)
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)
Beispiel #18
0
def __main__(*args):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    global passInformationDict
    global qualityOptionDict

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

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

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

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

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

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

    scriptDialog.EndGrid()

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

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

    scriptDialog.EndTabControl()

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

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox",
                "ChunkSizeBox", "SubmitSceneBox", "VersionBox")
    settings += tuple(passInformationDict.keys())
    settings += tuple(qualityOptionDict.keys())
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    OverrideRenderPassesChanged(None)
    QualityTypeChanged(None)

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

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

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

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

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

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

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

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

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

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

    scriptDialog.ShowDialog(True)
Beispiel #19
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 )
Beispiel #20
0
def __main__( *args ):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    global versionOptions
    
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit VRED Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'VRED' ) )
    
    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.EndTabPage()
    
    scriptDialog.AddTabPage("VRED Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator3", "SeparatorControl", "VRED Options", 0, 0, colSpan=4 )

    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "VRED File", 1, 0, "The VRED project file to be rendered.", False )
    scriptDialog.AddSelectionControlToGrid( "SceneBox", "FileBrowserControl", "", "VRED Essentials Project Binary (*.vpe);;VRED Project Binary (*.vpb);;VRED Project File (*.vpf);;All Files (*)", 1, 1, colSpan=3 )

    scriptDialog.AddControlToGrid( "VersionLabel", "LabelControl", "Version", 2, 0, "The VRED application version to use.", False )
    scriptDialog.AddComboControlToGrid( "VersionBox", "ComboControl", "11.0 (2019)", versionOptions.keys(), 2, 1 )
    
    scriptDialog.AddSelectionControlToGrid( "SubmitSceneBox", "CheckBoxControl", False, "Submit VRED Project File", 2, 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( "JobTypeLabel", "LabelControl", "Job Type", 3, 0, "The VRED job type.", False )
    JobTypeBoxBox = scriptDialog.AddComboControlToGrid( "JobTypeBox", "ComboControl", "Render", ("Render","Render Queue","Sequencer"), 3, 1 )
    JobTypeBoxBox.ValueModified.connect(JobTypeChanged)
    renderAnimCheck = scriptDialog.AddSelectionControlToGrid( "RenderAnimationCheck", "CheckBoxControl", True, "Render Animation", 3, 2, "If this option is enabled, the render job will render animations.", colSpan=2 )    
    renderAnimCheck.ValueModified.connect(JobTypeChanged)
    
    scriptDialog.AddControlToGrid( "OutputLabel","LabelControl","Output File", 4, 0, "The filename of the image(s) to be rendered.", False )
    outputBox = scriptDialog.AddSelectionControlToGrid("OutputBox","FileSaverControl","","Windows Bitmap (*.bmp *.dib);;DirectDraw Surface (*.dds);;EXR (*.exr);;HDR (*.hdr);;JFIF (*.jfif);;JPEG (*.jpe *.jpg *.jpeg);;NRRD (*.nrrd);;PGM (*.pgm);;PCX (*.pcx);;PNG (*.png);;PNM (*.pnm);;PPM (*.ppm);;PSB (*.psb);;PSD (*.psd);;RLE (*.rle);;TIFF (*.tif *.tiff);;VIF (*.vif);;All files (*)", 4, 1, colSpan=3)
    outputBox.ValueModified.connect(ChangeOutputFilename)
    #AVI (*.avi);;
    
    scriptDialog.AddControlToGrid( "ViewLabel", "LabelControl", "View / Camera", 5, 0, "The view or camera to render from, if left blank it will use the current view.", False )
    scriptDialog.AddControlToGrid( "ViewBox", "TextControl", "", 5, 1, colSpan=3 )
        
    scriptDialog.AddControlToGrid( "AnimationLabel", "LabelControl", "Animation Clip", 6, 0, "The animation to use, if left blank it will use all enabled clips", False )
    scriptDialog.AddControlToGrid( "AnimationBox", "TextControl", "", 6, 1, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "RenderWidthLabel", "LabelControl", "Render Width", 7, 0, "The width of the images rendered.", False )
    scriptDialog.AddRangeControlToGrid( "RenderWidthBox", "RangeControl", 1920, 1, 1000000, 0, 1, 7, 1 )
    
    scriptDialog.AddControlToGrid( "RenderHeightLabel", "LabelControl", "Render Height", 7, 2, "The height of the images rendered.", False )
    scriptDialog.AddRangeControlToGrid( "RenderHeightBox", "RangeControl", 1080, 1, 1000000, 0, 1, 7, 3 )
    
    scriptDialog.AddControlToGrid( "SuperSamplingLabel", "LabelControl", "Super Sampling Factor", 8, 0, "The height of the images rendered.", False )
    scriptDialog.AddRangeControlToGrid( "SuperSamplingBox", "RangeControl", 32, 1, 1024, 0, 1, 8, 1 )
    scriptDialog.AddControlToGrid( "RenderQualityLabel", "LabelControl", "Render Quality", 8, 2, "The Render quality to use.", False )
    renderQualityBox = scriptDialog.AddComboControlToGrid( "RenderQualityBox", "ComboControl", "Realistic High", ("Analytic Low","Analytic High","Realistic Low","Realistic High","Raytracing","NPR"), 8, 3 )
    renderQualityBox.ValueModified.connect(ChangeRenderQuality)
    
    scriptDialog.AddControlToGrid( "BackgroundColorLabel", "LabelControl", "Background", 9, 0, "The background color.", False )
    scriptDialog.AddControlToGrid( "BackgroundColorBox", "ColorControl", QColor(0,0,0), 9, 1, colSpan=3 )
        
    alphaChannelBox = scriptDialog.AddSelectionControlToGrid( "AlphaChannelBox", "CheckBoxControl", True, "Include Alpha Channel", 10, 0, "If enabled, the rendered images will include an alpha channel." )
    alphaChannelBox.ValueModified.connect(ChangeAlphaChannelBox)
    
    scriptDialog.AddSelectionControlToGrid( "AlphaPremultiplyBox", "CheckBoxControl", True, "Premultiply Alpha", 10, 1, "If enabled, the alpha channel will be premultiplied." )
    scriptDialog.AddSelectionControlToGrid( "ToneMapBox", "CheckBoxControl", False, "Tonemap HDR", 10, 2, "If enabled, tonemapping will be used for .hdr files." )
    
    scriptDialog.AddControlToGrid( "FramesLabel", "LabelControl", "Frame List", 11, 0, "The list of frames to render.", False )
    scriptDialog.AddControlToGrid( "FramesBox", "TextControl", "", 11, 1 )
    scriptDialog.AddControlToGrid( "ChunkSizeLabel", "LabelControl", "Frames Per Task", 11, 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, 11, 3 )
    
    #scriptDialog.AddControlToGrid( "fpsLabel", "LabelControl", "Frames Per Second", 13, 0, "This is the number of frames per second. Used only for rendering avi files.", False )
    #scriptDialog.AddRangeControlToGrid( "fpsBox", "RangeControl", 25, 1, 1000000, 0, 1, 13, 1 )
    
    scriptDialog.AddControlToGrid( "DPILabel", "LabelControl", "DPI", 12, 0, "The dots per inch for the rendered single frame image.", False )
    scriptDialog.AddRangeControlToGrid( "DPIBox", "RangeControl", 72, 1, 1200, 0, 1, 12, 1 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddSelectionControlToGrid( "OverrideRenderPassBox", "CheckBoxControl", False, "Override Render Pass Options", 0, 0, "If enabled, you will use the render pass options from the submitter instead of those from within the scene." )
    
    changeExportBox = scriptDialog.AddSelectionControlToGrid( "ExportRenderPassBox", "CheckBoxControl", False, "Export Render Passes", 0, 1, "If enabled and the render quality is Raytracing, the checked Render Passes will be rendered." )
    changeExportBox.ValueModified.connect(ChangeExportRenderPass)
    
    scriptDialog.AddSelectionControlToGrid( "OverrideMetaDataBox", "CheckBoxControl", False, "Override Embed Meta Data", 1, 0, "If enabled, you will use the Embedded Meta data options from the submitter instead of those from within the scene." )
    
    embedMetaBox = scriptDialog.AddSelectionControlToGrid( "EmbedMetaDataBox", "CheckBoxControl", False, "Embed Meta Data", 1, 1, "When rendering to .png, .jpg, or .tif if enabled the checked Meta data will be embedded." )
    embedMetaBox.ValueModified.connect(ChangeEmbedMeta)
    
    scriptDialog.AddControlToGrid( "SequenceNameLabel", "LabelControl", "Sequence Name", 2, 0, "The name of the sequence to run. If not defined or using 2015 version all sequences will be rendered.", False )
    scriptDialog.AddControlToGrid( "SequenceNameBox", "TextControl", "", 2, 1, colSpan=3 )
    
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    scriptDialog.AddTabPage("Render Passes/Meta Data")
    scriptDialog.AddGrid()
    
    scriptDialog.AddControlToGrid( "CombinedChannelLabel", "SeparatorControl", "Combined Channels", 0, 0, colSpan=4 )
    scriptDialog.AddControlToGrid( "ColorChannelLabel", "SeparatorControl", "Color Channels", 1, 0, colSpan=4 )
    
    scriptDialog.AddSelectionControlToGrid( "BeautyPassBox", "CheckBoxControl", False, "Beauty", 2, 0, "If enabled, the specular Beauty pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "DiffuseIBLPassBox", "CheckBoxControl", False, "Diffuse IBL", 2, 1, "If enabled, the Diffuse IBL pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "DiffuseLightPassBox", "CheckBoxControl", False, "Diffuse Light", 2, 2, "If enabled, should the Diffuse Light pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "DiffuseIndirectPassBox", "CheckBoxControl", False, "Diffuse Indirect", 2, 3, "If enabled, should the Diffuse Indirect pass be exported." )
    
    scriptDialog.AddSelectionControlToGrid( "IncandescencePassBox", "CheckBoxControl", False, "Incandescence", 3, 0, "If enabled, the Incandescence pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "BackgroundColorPassBox", "CheckBoxControl", False, "Background Color", 3, 1, "If enabled, the Background Color pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "SpecularReflectionPassBox", "CheckBoxControl", False, "Specular Reflection", 3, 2, "If enabled, should the Specular Reflection pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "GlossyIBLPassBox", "CheckBoxControl", False, "Glossy IBL", 3, 3, "If enabled, should the Glossy IBL pass be exported." )
    
    scriptDialog.AddSelectionControlToGrid( "GlossyLightPassBox", "CheckBoxControl", False, "Glossy Light", 4, 0, "If enabled, the specular Glossy Light pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "GlossyIndirectPassBox", "CheckBoxControl", False, "Glossy Indirect", 4, 1, "If enabled, the Glossy Indirect pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "TranslucentPassBox", "CheckBoxControl", False, "Translucent", 4, 2, "If enabled, should the Translucent pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "TransparencyColorPassBox", "CheckBoxControl", False, "Transparency Color", 4, 3, "If enabled, should the Transparency Color pass be exported." )
    
    scriptDialog.AddControlToGrid( "AuxChannelLabel", "SeparatorControl", "Auxiliary Channels", 5, 0, colSpan=4 )
    
    scriptDialog.AddSelectionControlToGrid( "OcclusionPassBox", "CheckBoxControl", False, "Occlusion", 6, 0, "If enabled, the specular Occlusion pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "MaskPassBox", "CheckBoxControl", False, "Mask", 6, 1, "If enabled, the Mask pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "MaterialIDPassBox", "CheckBoxControl", False, "Material ID", 6, 2, "If enabled, should the Material ID pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "DepthPassBox", "CheckBoxControl", False, "Depth", 6, 3, "If enabled, should the Depth pass be exported." )
    
    scriptDialog.AddSelectionControlToGrid( "NormalPassBox", "CheckBoxControl", False, "Normal", 7, 0, "If enabled, the Specular Normal pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "PositionPassBox", "CheckBoxControl", False, "Position", 7, 1, "If enabled, the Position pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "ViewVectorPassBox", "CheckBoxControl", False, "View Vector", 7, 2, "If enabled, should the View Vector pass be exported." )
    
    scriptDialog.AddControlToGrid( "SeparatedChannelLabel", "SeparatorControl", "Separated Channels", 8, 0, colSpan=4 )
    scriptDialog.AddControlToGrid( "MaterialChannelLabel", "SeparatorControl", "Material Channels", 9, 0, colSpan=4 )
    
    scriptDialog.AddSelectionControlToGrid( "DiffuseColorPassBox", "CheckBoxControl", False, "Diffuse Color", 10, 0, "If enabled, should the Diffuse Color pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "GlossyColorPassBox", "CheckBoxControl", False, "Glossy Color", 10, 1, "If enabled, the Glossy Color pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "SpecularColorPassBox", "CheckBoxControl", False, "Specular Color", 10, 2, "If enabled, the Specular Color pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "TranslucencyColorPassBox", "CheckBoxControl", False, "Translucency Color", 10, 3, "If enabled, should the Translucency Color pass be exported." )
    
    scriptDialog.AddControlToGrid( "IlluminationChannelLabel", "SeparatorControl", "Illumination Channels", 11, 0, colSpan=4 )
    
    scriptDialog.AddSelectionControlToGrid( "IBLDiffusePassBox", "CheckBoxControl", False, "IBL Diffuse", 12, 0, "If enabled, should the IBL Diffuse pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "LightsDiffusePassBox", "CheckBoxControl", False, "Lights Diffuse", 12, 1, "If enabled, should the Lights Diffuse pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "IndirectDiffusePassBox", "CheckBoxControl", False, "Indirect Diffuse", 12, 2, "If enabled, the Indirect Diffuse pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "IBLGlossyPassBox", "CheckBoxControl", False, "IBL Glossy", 12, 3, "If enabled, the IBL Glossy pass will be exported." )
    
    scriptDialog.AddSelectionControlToGrid( "LightsGlossyPassBox", "CheckBoxControl", False, "Lights Glossy", 13, 0, "If enabled, should the Lights Glossy pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "IndirectGlossyPassBox", "CheckBoxControl", False, "Indirect Glossy", 13, 1, "If enabled, should the Indirect Glossy pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "IBLTranslucencyPassBox", "CheckBoxControl", False, "IBL Translucency", 13, 2, "If enabled, the IBL Translucency pass will be exported." )
    scriptDialog.AddSelectionControlToGrid( "LightTranslucencyPassBox", "CheckBoxControl", False, "Light Translucency", 13, 3, "If enabled, the Light Translucency pass will be exported." )
    
    scriptDialog.AddSelectionControlToGrid( "IndirectTranslucencyPassBox", "CheckBoxControl", False, "Indirect Translucency", 14, 0, "If enabled, should the Indirect Translucency pass be exported." )
    scriptDialog.AddSelectionControlToGrid( "IndirectSpecularPassBox", "CheckBoxControl", False, "Indirect Specular", 14, 1, "If enabled, should the Indirect Specular pass be exported." )
    
    scriptDialog.AddControlToGrid( "MetaDataLabel", "SeparatorControl", "Meta Data", 15, 0, colSpan=4 )
    
    scriptDialog.AddSelectionControlToGrid( "EmbedRenderSettingsBox", "CheckBoxControl", False, "Render Settings", 16, 0, "If enabled, the Render Settings will be embedded." )
    scriptDialog.AddSelectionControlToGrid( "EmbedCameraSettingsBox", "CheckBoxControl", False, "Camera Settings", 16, 1, "If enabled, the Camera Settings will be embedded." )
    scriptDialog.AddSelectionControlToGrid( "EmbedNodeVisibilitiesBox", "CheckBoxControl", False, "Node Visibilities", 16, 2, "If enabled, the Node Visibilities will be embedded." )
    scriptDialog.AddSelectionControlToGrid( "EmbedSwitchNodeStatesBox", "CheckBoxControl", False, "Switch Node States", 16, 3, "If enabled, the Switch Node States will be embedded." )

    scriptDialog.AddSelectionControlToGrid( "EmbedSwitchMaterialStatesBox", "CheckBoxControl", False, "Switch Material States", 17, 0, "If enabled, the Switch Material States will be embedded." )

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "VREDMonitor", 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","BongoBox","SubmitSceneBox","VersionBox" )
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    JobTypeChanged()
    
    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)
Beispiel #22
0
def __main__():
    global scriptDialog
    global settings

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Vaccine fix")

    scriptDialog.AddTabControl("Example Tab Control", 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", "Vaccine_patch", 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", "ffmpeg", 1,
                                  1)

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

    temp_in = "Y:\\TOOLS\\EmerTech\\vaccine_patch"

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl",
                                  "Maya Version", 3, 0,
                                  "The version of Maya to render with.", False)
    versionBox = scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "2019",
        ("2010", "2011", "2011.5", "2012", "2012.5", "2013", "2013.5", "2014",
         "2014.5", "2015", "2015.5", "2016", "2016.5", "2017", "2017.5",
         "2018", "2019"), 3, 1)
    #versionBox.ValueModified.connect( VersionChanged )

    scriptDialog.AddControlToGrid("OutputLabel", "LabelControl", "Patch File",
                                  4, 0, "python patch file path.", False)
    scriptDialog.AddSelectionControlToGrid("Input0Box", "FolderBrowserControl",
                                           temp_in, "", 4, 1)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.EndTabControl()

    scriptDialog.AddGrid()
    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.AddHorizontalSpacerToGrid("DummySpacer1", 0, 3)
    scriptDialog.EndGrid()

    scriptDialog.ShowDialog(True)
Beispiel #23
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)
Beispiel #24
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 )
Beispiel #25
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 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)
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)
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
Beispiel #29
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__():
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

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

    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",
                                  "Composite Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid("ProjectLabel", "LabelControl",
                                  "Project File", 1, 0,
                                  "Path to the project file. ", False)
    scriptDialog.AddSelectionControlToGrid("ProjectBox",
                                           "FileBrowserControl",
                                           "",
                                           "Projects (*.txproject)",
                                           1,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid("CompositionLabel", "LabelControl",
                                  "Composition", 2, 0,
                                  "Path to the composition file.", False)
    scriptDialog.AddSelectionControlToGrid("CompositionBox",
                                           "FileBrowserControl",
                                           "",
                                           "Compositions (*.txcomposition)",
                                           2,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "VersionLabel", "LabelControl", "Composition Version", 3, 0,
        "The version of the current composition selected. ", False)
    scriptDialog.AddControlToGrid("VersionBox",
                                  "TextControl",
                                  "",
                                  3,
                                  1,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "UsersFileLabel", "LabelControl", "User File", 4, 0,
        "The path to the user.ini file for this composition. ", False)
    scriptDialog.AddSelectionControlToGrid(
        "UsersFileBox",
        "FileBrowserControl",
        "",
        "User Files (*.txuser *.ini);;All Files (*)",
        4,
        1,
        colSpan=3)

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

    scriptDialog.AddControlToGrid("CompositeVersionLabel", "LabelControl",
                                  "Version", 6, 0,
                                  "The version of Composite to render with.",
                                  False)
    scriptDialog.AddComboControlToGrid(
        "CompositeVersionBox", "ComboControl", "2012",
        ("2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017"), 6, 1)
    scriptDialog.AddControlToGrid(
        "BuildLabel", "LabelControl", "Build to Force", 6, 2,
        "You can force 32 or 64 bit rendering with this option.", False)
    scriptDialog.AddComboControlToGrid("BuildBox", "ComboControl", "None",
                                       ("None", "32bit", "64bit"), 6, 3)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "CompositeMonitor",
                                          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", "FramesBox", "ChunkSizeBox",
                "ProjectBox", "CompositionBox", "VersionBox", "UsersFileBox",
                "CompositeVersionBox", "BuildBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)

    appSubmission = LoadContext()
    if appSubmission:
        # Keep the submission window above all other windows when submitting from another app.
        scriptDialog.MakeTopMost()
    else:
        scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    scriptDialog.ShowDialog(appSubmission)