Beispiel #1
0
def __main__( *args ):
    global scriptDialog
    global settings
    
    dialogWidth = 620
    dialogHeight = 500
    labelWidth = 120
    controlWidth = 152
    tabWidth = dialogWidth - 16
    
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit Pdplayer Viewer Job To Deadline" )
    scriptDialog.SetIcon( Path.Combine( RepositoryUtils.GetRootDirectory(), "plugins/Pdplayer/Pdplayer.ico" ) )
    
    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( "Separator3", "SeparatorControl", "Pdplayer Options", 0, 0, colSpan=3 )

    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "Scene File", 1, 0, "The scene to be viewed.", False )
    scriptDialog.AddSelectionControlToGrid( "SceneBox", "FileBrowserControl", "", "All Files (*)", 1, 1, colSpan=2 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid( "HSpacer1", 0, 0 )
    submitButton = scriptDialog.AddControlToGrid( "SubmitButton", "ButtonControl", "Submit", 0, 1, expand=False )
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid( "CloseButton", "ButtonControl", "Close", 0, 2, expand=False )
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()
    
    settings = ("DepartmentBox","CategoryBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","IsBlacklistBox","MachineListBox","LimitGroupBox","SceneBox","ArgsBox","VersionBox","SubmitSceneBox")
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    scriptDialog.ShowDialog( False )
def __main__():
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

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

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

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl",
                                  "Lightwave File", 1, 0,
                                  "The scene file to be rendered.", False)
    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "MultiFileBrowserControl",
        "",
        "Lightwave Files (*.lws)",
        1,
        1,
        colSpan=2)
    sceneBox.ValueModified.connect(SceneChanged)

    scriptDialog.AddControlToGrid(
        "ContentLabel", "LabelControl", "Content Folder", 2, 0,
        "The Lightwave Content directory. Refer to your Lightwave documentation for more information. ",
        False)
    scriptDialog.AddSelectionControlToGrid("ContentBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           2,
                                           1,
                                           colSpan=2)

    scriptDialog.AddControlToGrid(
        "ConfigLabel", "LabelControl", "Config Folder", 3, 0,
        "The Lightwave Config directory. Refer to your Lightwave documentation for more information. ",
        False)
    scriptDialog.AddSelectionControlToGrid("ConfigBox",
                                           "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 Lightwave Scene File", 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("VersionLabel", "LabelControl", "Version", 6,
                                  0,
                                  "The version of Lightwave to render with.",
                                  False)
    scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "2019",
        ("8", "9", "10", "11", "2015", "2018", "2019"), 6, 1)
    scriptDialog.AddSelectionControlToGrid(
        "FPrimeBox", "CheckBoxControl", False, "Use FPrime Renderer", 6, 2,
        "Enable if you want to use the FPrime renderer instead of the normal Lightwave renderer. "
    )

    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.AddSelectionControlToGrid(
        "ScreamerNetBox", "CheckBoxControl", True, "Use ScreamerNet Rendering",
        7, 2,
        "ScreamerNet rendering keeps the Lightwave scene loaded in memory between frames, which reduces overhead time when rendering."
    )
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "LightwaveMonitor",
                                          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", "ContentBox",
                "ConfigBox", "FPrimeBox", "ScreamerNetBox", "SubmitSceneBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    SceneChanged(None)

    scriptDialog.ShowDialog(False)
Beispiel #3
0
def __main__(*args):
    global scriptDialog

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

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

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

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

    scriptDialog.AddControlToGrid(
        "DepartmentLabel", "LabelControl", "Department", 3, 0,
        "The department you belong to. This is optional and can be left blank.",
        False)
    scriptDialog.AddControlToGrid("DepartmentBox",
                                  "TextControl",
                                  "",
                                  3,
                                  1,
                                  colSpan=2)
    scriptDialog.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("Separator3",
                                  "SeparatorControl",
                                  "Autopano Video Options",
                                  0,
                                  0,
                                  colSpan=4)

    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 kava files.", False)
    DirFileChooserRC1.ValueModified.connect(DirFileChooserChanged)
    DirFileChooserRC2 = scriptDialog.AddRadioControlToGrid(
        "FileChooser", "RadioControl", True, "Select by File",
        "SelectMethodRadioCtrl", 1, 2,
        "Choose by individual kava file selection.", False)
    DirFileChooserRC2.ValueModified.connect(DirFileChooserChanged)

    scriptDialog.AddControlToGrid(
        "DirectoryLabel", "LabelControl", "Autopano File Directory", 2, 0,
        "Choose a root directory to scan for all kava files.", False)
    scriptDialog.AddSelectionControlToGrid("DirectoryBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           2,
                                           1,
                                           colSpan=3)
    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 kava files.",
        False)
    scriptDialog.SetEnabled("SubDirectoriesBox", False)

    scriptDialog.AddControlToGrid(
        "KavaLabel", "LabelControl", "Autopano File(s)", 4, 0,
        "The file path to the kava file(s) to be rendered.", False)
    scriptDialog.AddSelectionControlToGrid("KavaFileBox",
                                           "MultiLineMultiFileBrowserControl",
                                           "",
                                           "Autopano Video Files (*.kava)",
                                           4,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "VersionLabel", "LabelControl", "Version", 5, 0,
        "The version of Autopano Video being used for this render job.", False)
    scriptDialog.AddComboControlToGrid("VersionBox", "ComboControl", "3",
                                       ("2", "3"), 5, 1)

    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.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 1)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 2,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                3,
                                                expand=False)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ("CategoryBox", "DepartmentBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "LimitGroupBox", "OnJobCompleteBox",
                "MachineListBox", "SubmitSuspendedBox", "IsBlacklistBox",
                "DirChooser", "FileChooser", "DirectoryBox",
                "SubDirectoriesBox", "KavaFileBox", "VersionBox", "BuildBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    DirFileChooserChanged()

    scriptDialog.ShowDialog(False)
Beispiel #4
0
def __main__(*args):
    global scriptDialog
    global settings
    global defaultLocation
    global outputBox
    global sceneBox

    defaultLocation = ""

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit CelAction Job To Deadline")
    scriptDialog.SetIcon(
        os.path.join(RepositoryUtils.GetRootDirectory(), 'custom', 'plugins',
                     'CelAction', 'CelAction.ico'))

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

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

    scriptDialog.AddControlToGrid("OutputLabel", "LabelControl",
                                  "Output Folder", 2, 0,
                                  "The output path to render to.", False)
    scriptDialog.AddSelectionControlToGrid("OutputBox",
                                           "FileSaverControl",
                                           "",
                                           "PNG Files (*.png);;All Files (*)",
                                           2,
                                           1,
                                           colSpan=5)

    scriptDialog.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  3, 0,
                                  "The list of frames for the normal job.",
                                  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.AddControlToGrid("WidthLabel", "LabelControl", "Width", 4, 0,
                                  "Resolution Width", False)
    scriptDialog.AddRangeControlToGrid("WidthBox", "RangeControl", 1920, 1,
                                       1000000, 0, 1, 4, 1)
    scriptDialog.AddControlToGrid("HeightLabel", "LabelControl", "Height", 4,
                                  2, "Resolution Height", False)
    scriptDialog.AddRangeControlToGrid("HeightBox", "RangeControl", 1080, 1,
                                       1000000, 0, 1, 4, 3)

    scriptDialog.AddControlToGrid(
        "AlphaLabel", "LabelControl", "Alpha", 5, 0,
        "If this option is enabled, the images with have alpha embedded.",
        False)
    scriptDialog.AddSelectionControlToGrid("AlphaBox", "CheckBoxControl", True,
                                           "", 5, 1, "", "")
    scriptDialog.AddControlToGrid(
        "LevelSplitLabel", "LabelControl", "Level Split", 5, 2,
        "If this option is enabled, the output images with be split into the levels.",
        False)
    scriptDialog.AddSelectionControlToGrid("LevelSplitBox", "CheckBoxControl",
                                           False, "", 5, 3, "", "")

    scriptDialog.AddControlToGrid("FramePaddingLabel", "LabelControl",
                                  "Frame Padding", 6, 0,
                                  "This is the number of padding on frames.",
                                  False)
    scriptDialog.AddRangeControlToGrid("FramePaddingBox", "RangeControl", 4, 1,
                                       10, 0, 1, 6, 1)

    scriptDialog.AddControlToGrid(
        "RenderSeparatorLabel", "LabelControl", "Render Separator", 6, 2,
        "This is the character(s) to separate filename from frame padding.",
        False)
    scriptDialog.AddControlToGrid("RenderSeparatorBox", "TextControl", ".", 6,
                                  3)

    scriptDialog.EndGrid()

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

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

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "FramesBox", "ChunkSizeBox",
                "SceneBox", "OutputBox", "HeightBox", "WidthBox", "AlphaBox",
                "LevelSplitBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    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 #6
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 #7
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)
def __main__():
    global scriptDialog
    global settings
    scriptDialog = DeadlineScriptDialog()
    selectedJobs = MonitorUtils.GetSelectedJobs()

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

    job = selectedJobs[0]
    if job.JobStatus != "Suspended" and job.JobStatus != "Completed" and job.JobStatus != "Failed":
        scriptDialog.ShowMessageBox(
            "Cannot transfer this job because it is " + job.JobStatus +
            ". Only completed, suspended, or failed jobs may be transferred.",
            "Error")
        return

    transferJobID = job.JobId
    transferJobName = job.JobName
    frameList = job.JobFrames
    chunkSize = job.JobFramesPerTask

    scriptDialog.SetTitle("Transfer Job")

    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.", False)
    scriptDialog.AddControlToGrid("NameBox", "TextControl",
                                  "Transfer of " + transferJobName, 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.AddControlToGrid("FramesLabel", "LabelControl", "Frame List",
                                  10, 0, "The list of frames to render.",
                                  False)
    scriptDialog.AddControlToGrid("FramesBox", "TextControl", frameList, 10, 1)

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 11, 0,
        "This is the number of frames that will be rendered at a time for each job task.",
        False)
    scriptDialog.AddRangeControlToGrid("ChunkSizeBox", "RangeControl",
                                       chunkSize, 1, 1000000, 0, 1, 11, 1)
    scriptDialog.EndGrid()

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

    scriptDialog.AddControlToGrid(
        "RepositoryLabel", "LabelControl", "New Repository", 1, 0,
        "The repository root path, or the proxy server and port (in the format proxy:port).",
        False)
    scriptDialog.AddSelectionControlToGrid("RepositoryBox",
                                           "TextControl",
                                           "",
                                           "",
                                           1,
                                           1,
                                           colSpan=2)
    scriptDialog.AddControlToGrid(
        "RepositoryLabel", "LabelControl", "New Certificate", 2, 0,
        "The path to the certificate if using a proxy server that requires it.",
        False)
    scriptDialog.AddSelectionControlToGrid("CertificateBox",
                                           "TextControl",
                                           "",
                                           "",
                                           2,
                                           1,
                                           colSpan=2)
    changeRepoButton = scriptDialog.AddControlToGrid("ChangeRepoButton",
                                                     "ButtonControl",
                                                     "Change Repository",
                                                     1,
                                                     3,
                                                     expand=False)
    changeRepoButton.ValueModified.connect(ChangeRepoButtonPressed)

    scriptDialog.AddSelectionControlToGrid("CompressBox", "CheckBoxControl",
                                           False,
                                           "Compress Files During Transfer", 3,
                                           1)
    scriptDialog.AddSelectionControlToGrid(
        "SuspendBox", "CheckBoxControl", False,
        "Suspend Remote Job After Transfer", 3, 2)

    scriptDialog.AddSelectionControlToGrid("EmailBox", "CheckBoxControl",
                                           False,
                                           "Email Results After Transfer", 4,
                                           1)
    scriptDialog.AddSelectionControlToGrid("RemoveBox", "CheckBoxControl",
                                           False,
                                           "Remove Local Job After Transfer",
                                           4, 2)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid("DummyLabel1", 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", "MachineListBox", "LimitGroupBox",
                "OnJobCompleteBox", "SubmitSuspendedBox", "RepositoryBox",
                "CertificateBox", "SuspendBox", "RemoveBox", "EmailBox",
                "CompressBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    jobTypeChanged(None)

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

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

    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("Microstation Options")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "MicroStation Options",
                                  0,
                                  0,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "OperationLabel", "LabelControl", "Operation", 1, 0,
        "The operation that will be performed in this MicroStation job.",
        False)
    operationControl = scriptDialog.AddComboControlToGrid(
        "OperationBox",
        "ComboControl",
        MSOP_AnimationRender,
        MicroStationOperations,
        1,
        1,
        expand=True)
    operationControl.ValueModified.connect(OperationChanged)

    scriptDialog.AddControlToGrid(
        "ColorLabel", "LabelControl", "Color Model", 1, 2,
        "The type of Color to use for the render output.", False)
    scriptDialog.AddComboControlToGrid("ColorBox",
                                       "ComboControl",
                                       CL_RGB,
                                       ColorModels,
                                       1,
                                       3,
                                       expand=True)

    scriptDialog.AddControlToGrid(
        "ModeLabel", "LabelControl", "Mode", 2, 0,
        "The mode which applies to the selected operation.", False)
    modeControl = scriptDialog.AddComboControlToGrid("ModeBox",
                                                     "ComboControl",
                                                     RM_Luxology,
                                                     RenderModes,
                                                     2,
                                                     1,
                                                     expand=True)
    modeControl.ValueModified.connect(ModeChanged)

    scriptDialog.AddSelectionControlToGrid(
        "SubmitFileBox",
        "CheckBoxControl",
        False,
        "Submit File(s) With Job",
        2,
        2,
        "If enabled, the design (and/or settings) file will be submitted to the Deadline Repository along with the Job.",
        colSpan=2)

    scriptDialog.AddControlToGrid(
        "DesignLabel", "LabelControl", "Design File(s)", 3, 0,
        "The path to the MicroStation Design File(s), or SMI Script to use for this Job.",
        False)
    inputBox = scriptDialog.AddSelectionControlToGrid(
        "DesignBox",
        "MultiFileBrowserControl",
        "",
        "MicroStation DGN File (*.dgn);;All Files (*)",
        3,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid(
        "SettingsLabel", "LabelControl", "Settings File", 4, 0,
        "The operation-specific Settings file for this Job.", False)
    settingsControl = scriptDialog.AddSelectionControlToGrid(
        "SettingsBox",
        "FileBrowserControl",
        "",
        "Save Multiple Script Files (*.sm);;Print Definition Files (*.pset);;DWG Settings Files (*.dws);;Script File (*.scr);;Script File As Text (*.txt);;Visual Basic File (*.mvba);;All Files (*)",
        4,
        1,
        colSpan=3)
    settingsControl.ValueModified.connect(UpdateUIStatus)

    # add GUI options for .mvba right here. (Module and Subm)
    scriptDialog.AddControlToGrid(
        "ModuleLabel", "LabelControl", "Module (.mvba)", 5, 0,
        "The name of the Module to use within the selected .mvba project file.",
        False)
    scriptDialog.AddControlToGrid("ModuleBox", "TextControl", "", 5, 1)
    scriptDialog.AddControlToGrid(
        "SubModuleLabel", "LabelControl", "Sub/Function (.mvba)", 5, 2,
        "The name of the Submodule to use within the specified module.", False)
    scriptDialog.AddControlToGrid("SubModuleBox", "TextControl", "", 5, 3)
    scriptDialog.AddControlToGrid(
        "KeyinLabel", "LabelControl", "Key-in Args (.mvba)", 6, 0,
        "Any additional arguments to pass to the .mvba script.", False)
    scriptDialog.AddControlToGrid("KeyinBox", "TextControl", "", 6, 1)
    scriptDialog.AddControlToGrid(
        "ViewLabel", "LabelControl", "View Number", 7, 0,
        "The view number on which to perform the operation.", False)
    scriptDialog.AddRangeControlToGrid("ViewBox", "RangeControl", 1, 1, 8, 0,
                                       1, 7, 1)

    scriptDialog.AddControlToGrid(
        "SavedViewLabel", "LabelControl", "View Name", 7, 2,
        "The name of the Saved View or View Group to apply before rendering.",
        False)
    scriptDialog.AddControlToGrid("SavedViewBox",
                                  "TextControl",
                                  "",
                                  7,
                                  3,
                                  expand=True)

    scriptDialog.AddControlToGrid(
        "XLabel", "LabelControl", "Output Size X", 8, 0,
        "The X component of the output size. Set to 0 to use current value, or maintain aspect ratio.",
        False)
    scriptDialog.AddRangeControlToGrid("XBox", "RangeControl", 0, 0, 999999999,
                                       0, 1, 8, 1)
    scriptDialog.AddControlToGrid(
        "YLabel", "LabelControl", "Output Size Y", 8, 2,
        "The Y component of the output size. Set to 0 to use current value, or maintain aspect ratio.",
        False)
    scriptDialog.AddRangeControlToGrid("YBox", "RangeControl", 0, 0, 999999999,
                                       0, 1, 8, 3)

    scriptDialog.AddControlToGrid(
        "EnvironmentLabel", "LabelControl", "Environment", 9, 0,
        "The name of the Environment Setup to use for rendering.", False)
    scriptDialog.AddControlToGrid("EnvironmentBox", "TextControl", "", 9, 1)
    scriptDialog.AddControlToGrid("RenderSetupLabel", "LabelControl",
                                  "Render Setup", 9, 2,
                                  "The name of the Render Setup to use.",
                                  False)
    scriptDialog.AddControlToGrid("RenderSetupBox", "TextControl", "", 9, 3)

    scriptDialog.AddControlToGrid(
        "LightSetupLabel", "LabelControl", "Light Setup", 10, 0,
        "The name of the Light Setup to use for rendering.", False)
    scriptDialog.AddControlToGrid("LightSetupBox", "TextControl", "", 10, 1)

    scriptDialog.AddControlToGrid("FrameLabel", "LabelControl", "Frame List",
                                  11, 0, "The list of Frames to render.",
                                  False)
    scriptDialog.AddControlToGrid("FrameBox", "TextControl", "", 11, 1)
    scriptDialog.AddControlToGrid(
        "ChunkLabel", "LabelControl", "Task Size", 11, 2,
        "The number of Frames (or items) that will be processed at a time for each Task.",
        False)
    scriptDialog.AddRangeControlToGrid("ChunkBox", "RangeControl", 1, 1, 9999,
                                       0, 1, 11, 3)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output Path", 12, 0,
        "The path to the output file for this Job. File type will vary based on the selected Operation and Mode.",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputBox",
                                           "FileSaverControl",
                                           "",
                                           "All Files (*)",
                                           12,
                                           1,
                                           colSpan=3)

    scriptDialog.AddSelectionControlToGrid(
        "ConvertToUNCBox",
        "CheckBoxControl",
        False,
        "Convert Network Paths to UNC",
        13,
        1,
        "If enabled, Deadline will attempt to replace Mapped Network Drives with UNC Paths.",
        colSpan=3)

    scriptDialog.AddSelectionControlToGrid(
        "DgnReadOnlyBox",
        "CheckBoxControl",
        True,
        "Submit .dgn Scene as Read-Only",
        14,
        1,
        "If enabled, Deadline will submit the selected .dgn scene as read-only.",
        colSpan=3)

    scriptDialog.EndGrid()

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

    settings = ("DepartmentBox", "PoolBox", "SecondaryPoolBox", "GroupBox",
                "PriorityBox", "LimitGroupBox", "OnJobCompleteBox",
                "MachineListBox", "SubmitSuspendedBox", "IsBlacklistBox",
                "OperationBox", "ColorBox", "ViewBox", "OutputBox", "XBox",
                "YBox", "SavedViewBox", "EnvironmentBox", "RenderSetupBox",
                "LightSetupBox", "ModeBox", "SettingsBox", "DesignBox",
                "FrameBox", "ChunkBox", "ConvertToUNCBox", "DgnReadOnlyBox",
                "ModuleBox", "SubModuleBox", "KeyinBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    UpdateUIStatus()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.AddControlToGrid( "ChunkSizeLabel", "LabelControl", "Frames Per Task", 5, 0, "This is the number of frames that will be rendered at a time for each job task.", False )
    scriptDialog.AddRangeControlToGrid( "ChunkSizeBox", "RangeControl", 1, 1, 1000000, 0, 1, 5, 1 )
    scriptDialog.AddControlToGrid( "RendererLabel", "LabelControl", "Renderer", 5, 2, "The Maya renderer to use. If you select 'File', the renderer defined in the scene file will be used, but renderer specific options will not be set by Deadline.", False )
    rendererBox = scriptDialog.AddComboControlToGrid( "RendererBox", "ComboControl", "File", ("File","3delight","Arnold","FinalRender","Gelato","Maxwell","MayaKrakatoa","MayaHardware","MayaHardware2","MayaSoftware","MayaVector","MentalRay","OctaneRender","Redshift","Renderman","RendermanRIS","Renderman22","Turtle","Vray","Iray"), 5, 3 )
    rendererBox.ValueModified.connect( RendererChanged )

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.AddControlToGrid( "GPUsSelectDevicesLabel", "LabelControl", "Select GPU Devices", 15, 0, "A comma separated list of the GPU devices to use specified by device Id. 'GPUs Per Task' will be ignored.", False )
    GPUsSelectDevicesBox = scriptDialog.AddControlToGrid( "GPUsSelectDevicesBox", "TextControl", "", 15, 1 )
    GPUsSelectDevicesBox.ValueModified.connect(GPUsSelectDevicesChanged)
    
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "MayaMonitor", DraftRequested, ProjectManagementOptions, failOnNoTabs=False )
    
    scriptDialog.EndTabControl()
    
    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid( "HSpacer1", 0, 0 )
    submitButton = scriptDialog.AddControlToGrid( "SubmitButton", "ButtonControl", "Submit", 0, 1, expand=False )
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid( "CloseButton", "ButtonControl", "Close", 0, 2, expand=False )
    # Make sure all the project management connections are closed properly
    closeButton.ValueModified.connect(integration_dialog.CloseProjectManagementConnections)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    settings = ( "DepartmentBox","CategoryBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","MachineLimitBox","IsBlacklistBox","MachineListBox","LimitGroupBox","SceneBox","FramesBox","ChunkSizeBox","VersionBox","BuildBox","ProjectBox", "OutputBox", "RendererBox", "SubmitSceneBox", "MayaBatchBox","LocalRenderingBox","CpusBox","StrictErrorCheckingBox","StartupScriptBox","OverrideSizeBox","WidthSizeRange","HeightSizeRange","FileUsesLegacyRenderLayersBox","CommandLineBox","UseCommandLineBox","RenderSetupIncludeLightsBox" )
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    GPUsPerTaskChanged()
    GPUsSelectDevicesChanged()
    IRayUseCPUsChanged()
    VersionChanged()
    RendererChanged()
    MayaBatchChanged()
    AutoMemoryLimitChanged()
    VRayAutoMemoryChanged()
    ScriptJobChanged()
    
    scriptDialog.ShowDialog( False )
Beispiel #12
0
def __main__( *args ):
    global scriptDialog
    global settings
    
    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle( "Submit CSi SAFE Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'CSiSAFE' ) )

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

    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "CSi SAFE Data File(s)", 1, 0, "The CSi SAFE Data File to be processed.", False )
    scriptDialog.AddSelectionControlToGrid( "SceneBox", "MultiFileBrowserControl", "", "CSi SAFE Files (*.FDB);;Microsoft Access Files (*.MDB);;Microsoft Excel Files (*.XLS);;CSi SAFE Text Files (*.$2K *.F2K)", 1, 1, colSpan=2 )
    
    OverrideOutput = scriptDialog.AddSelectionControlToGrid( "OverrideOutput", "CheckBoxControl", False, "Override Output Directory", 2, 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", "", "", 2, 1, colSpan=2 )
    scriptDialog.SetEnabled( "OutputDirectoryBox", False )

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

    scriptDialog.AddTabPage("Advanced Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator4", "SeparatorControl", "Analysis/Design/Detailing Option", 0, 0, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "RunTypeLabel", "LabelControl", "Run Method", 1, 0, "Choose a run combination option.", False )
    RunType = scriptDialog.AddComboControlToGrid( "RunType", "ComboControl", "Run Analysis", ( "Disabled", "Run Analysis", "Run Analysis & Design", "Run Analysis, Design & Detailing" ), 1, 1 )
    RunType.ValueModified.connect(RunTypeChanged)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator5", "SeparatorControl", "Process/Solver Options", 0, 0, colSpan=3 )
    
    scriptDialog.AddControlToGrid( "ProcessLabel", "LabelControl", "Process Selection", 1, 0, "Choose to execute inside of the existing SAFE 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", "Multithreaded Solver" ), 2, 1 )
    SolverType.ValueModified.connect(SolverTypeChanged)

    scriptDialog.AddSelectionControlToGrid( "Always32bitBox", "CheckBoxControl", False, "Force 32bit Process", 3, 0, "Force analysis to be calculated in 32 bit even when the computer is 64 bit.", colSpan=2 )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator6", "SeparatorControl", "Report Option", 0, 0, colSpan=3 )

    scriptDialog.AddSelectionControlToGrid( "CreateReportBox", "CheckBoxControl", False, "Create Report", 1, 0, "Create a report based on the current report settings in the model file." )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator7", "SeparatorControl", "Export Options", 0, 0, colSpan=3 )

    scriptDialog.AddControlToGrid( "FileExportLabel", "LabelControl", "File Export", 1, 0, "File export a Microsoft Access, Microsoft Excel, or text file.", False )
    FileExportType = scriptDialog.AddComboControlToGrid( "FileExportType", "ComboControl", "Disabled", ( "Disabled", "Microsoft Access (.mdb)", "Microsoft Excel (.xls)", "Text file (.txt)" ), 1, 1 )
    FileExportType.ValueModified.connect(FileExportTypeChanged)

    scriptDialog.AddControlToGrid( "DBNamedSetLabel", "LabelControl", "DB Named Set (required)", 2, 0, "The name of the database tables named set that defines the tables to be exported. This parameter is required.", False )
    scriptDialog.AddControlToGrid( "DBNamedSet", "TextControl", "", 2, 1, colSpan=2 )

    scriptDialog.AddControlToGrid( "DBGroupedSetLabel", "LabelControl", "DB Group Set (optional)", 3, 0, "The specified group sets the selection for the exported tables. This parameter is optional. If it is not specified, the group ALL is assumed.", False )
    scriptDialog.AddControlToGrid( "DBGroupSet", "TextControl", "", 3, 1, colSpan=2 )
    scriptDialog.EndGrid()

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

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

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator9", "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.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","RunType","ProcessType","SolverType","Always32bitBox","CreateReportBox","FileExportType","DBNamedSet","DBGroupSet","DeletionType","IncludeDataFileBox","CompressOutputBox","VersionBox")

    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    
    scriptDialog.Shown.connect( InitializeDialog )

    scriptDialog.ShowDialog( True )
Beispiel #13
0
def __main__():
    global scriptDialog
    global portNumberInfoLabel
    global settings

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.EndGrid()

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

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

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

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

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

    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.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Arnold Options",
                                  0,
                                  0,
                                  colSpan=3)

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

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output File (optional)", 2, 0,
        "The output file. If left blank, Arnold will save the output to the location defined in the .ass file.",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "OutputBox",
        "FileSaverControl",
        "",
        "EXR (*.exr);;JPG (*.jpg);;PNG (*.png);;TIFF (*.tif);;All Files (*)",
        2,
        1,
        colSpan=2)

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

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 4,
                                  0, "The version of Arnold to render with.",
                                  False)
    scriptDialog.AddComboControlToGrid("VersionBox", "ComboControl", "Release",
                                       ("Beta", "Release"), 4, 1)
    scriptDialog.AddSelectionControlToGrid(
        "LocalRendering", "CheckBoxControl", False, "Enable Local Rendering",
        4, 2,
        "If enabled, the frames will be rendered locally, and then copied to their final network location. This requires the output path to be specified."
    )

    scriptDialog.AddControlToGrid(
        "BuildLabel", "LabelControl", "Build To Force", 5, 0,
        "You can force 32 or 64 bit rendering with this option.", False)
    scriptDialog.AddComboControlToGrid("BuildBox", "ComboControl", "None",
                                       ("None", "32bit", "64bit"), 5, 1)
    disableFrameInterpretation = scriptDialog.AddSelectionControlToGrid(
        "DisableFrameInterpretation", "CheckBoxControl", False,
        "Disable Frame Interpretation", 5, 2,
        "If enabled, Deadline won't try to interpret if there's frame padding in the input file, allowing version numbers in the input file."
    )
    disableFrameInterpretation.ValueModified.connect(
        DisableFrameInterpretationChanged)

    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(
        "VerboseLabel", "LabelControl", "Verbosity", 7, 0,
        "The verbosity level for the render output.", False)
    scriptDialog.AddRangeControlToGrid("VerboseBox", "RangeControl", 4, 0, 6,
                                       0, 1, 7, 1)

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

    scriptDialog.AddTabPage("Advanced Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "Additional Plugin Folders (Optional)",
                                  0,
                                  0,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "PluginLabel1", "LabelControl", "Plugin Folder 1", 1, 0,
        "Specify up to three additional plugin folders that Arnold should use when rendering.",
        False)
    scriptDialog.AddSelectionControlToGrid("PluginBox1",
                                           "FolderBrowserControl", "", "", 1,
                                           1)

    scriptDialog.AddControlToGrid(
        "PluginLabel2", "LabelControl", "Plugin Folder 2", 2, 0,
        "Specify up to three additional plugin folders that Arnold should use when rendering.",
        False)
    scriptDialog.AddSelectionControlToGrid("PluginBox2",
                                           "FolderBrowserControl", "", "", 2,
                                           1)

    scriptDialog.AddControlToGrid(
        "PluginLabel3", "LabelControl", "Plugin Folder 3", 3, 0,
        "Specify up to three additional plugin folders that Arnold should use when rendering.",
        False)
    scriptDialog.AddSelectionControlToGrid("PluginBox3",
                                           "FolderBrowserControl", "", "", 3,
                                           1)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "ArnoldMonitor",
                                          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", "LocalRendering", "ThreadsBox", "VersionBox",
                "BuildBox", "DisableFrameInterpretation", "VerboseBox",
                "CommandLineBox", "PluginBox1", "PluginBox2", "PluginBox3",
                "AutoFramesBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    SceneBoxChanged(None)
    DisableFrameInterpretationChanged(None)
    scriptDialog.ShowDialog(False)
def __main__(*args):
    global scriptDialog
    global portNumberInfoLabel
    global portNumberLabel
    global portNumberBox
    global settings

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Setup V-Ray DBR With Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('VraySpawner'))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "V-Ray Spawner/Standalone Options",
                                  14,
                                  0,
                                  colSpan=3)

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

    scriptDialog.AddControlToGrid("ApplicationLabel", "LabelControl",
                                  "Application", 16, 0,
                                  "The plugin application that will be used.",
                                  False)
    applicationBox = scriptDialog.AddComboControlToGrid(
        "ApplicationBox", "ComboControl", "Select One", [
            "Select One", "3ds Max", "3ds Max (RT)", "Cinema 4D", "Maya",
            "Modo", "Rhino", "SketchUp", "Softimage", "Standalone"
        ], 16, 1)
    applicationBox.ValueModified.connect(PopulateDropDowns)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version",
                                  17, 0, "The version of the application.",
                                  False)
    scriptDialog.AddComboControlToGrid("VersionBox", "ComboControl",
                                       "Select an Application First... ",
                                       ["Select an Application First... "], 17,
                                       1)

    portNumberLabel = scriptDialog.AddControlToGrid(
        "PortNumberLabel", "LabelControl", "Port Number", 18, 0,
        "Where available, override the default TCP Port Number used. V-Ray Standalone Default: 20207.",
        False)
    portNumberBox = scriptDialog.AddRangeControlToGrid("PortNumberBox",
                                                       "RangeControl", 20207,
                                                       1024, 65535, 0, 1, 18,
                                                       1)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    portNumberInfoLabel = scriptDialog.AddControlToGrid(
        "PortNumberInfoLabel", "LabelControl", "", 0, 0,
        "Where available, override the default TCP Port Number used. V-Ray Standalone Default: 20207.",
        False)
    scriptDialog.AddHorizontalSpacerToGrid("HSpacer1", 0, 1)
    submitButton = scriptDialog.AddControlToGrid("SubmitButton",
                                                 "ButtonControl",
                                                 "Submit",
                                                 0,
                                                 2,
                                                 expand=False)
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                3,
                                                expand=False)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()

    PopulateDropDowns(None)

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

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

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit Unreal Swarm Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('UnrealSwarm'))

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

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

    scriptDialog.AddControlToGrid("SwarmCountLabel", "LabelControl",
                                  "Swarm Count", 2, 0,
                                  "The number of Swarm Agents to start.",
                                  False)
    scriptDialog.AddRangeControlToGrid("SwarmCountBox", "RangeControl", 1, 1,
                                       20, 0, 1, 2, 1)

    scriptDialog.AddControlToGrid(
        "AgentGroupLabel", "LabelControl", "Agent Group Name", 3, 0,
        "The Name of the agent group that the machine will belong to.", False)
    scriptDialog.AddControlToGrid("AgentGroupBox",
                                  "TextControl",
                                  "Default",
                                  3,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "AllowedRemoteAgentGroupLabel", "LabelControl",
        "Allowed Remote Agent Group", 4, 0,
        "The name of the agent group jobs can be distributed to.", False)
    scriptDialog.AddControlToGrid("AllowedRemoteAgentGroupBox",
                                  "TextControl",
                                  "DefaultDeployed",
                                  4,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "AllowedRemoteAgentNamesLabel", "LabelControl",
        "Allowed Remote Agent Names", 5, 0,
        "The remote machine filter string ( ' ', ',' or ';' delimited ).",
        False)
    scriptDialog.AddControlToGrid("AllowedRemoteAgentNamesBox",
                                  "TextControl",
                                  "RENDER*",
                                  5,
                                  1,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "CoordinatorRemotingHostLabel", "LabelControl",
        "Coordinator Remoting Host", 6, 0,
        "The name of the machine hosting the coordinator.", False)
    scriptDialog.AddControlToGrid("CoordinatorRemotingHostBox",
                                  "TextControl",
                                  "RENDER-01",
                                  6,
                                  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(scriptDialog.closeEvent)

    scriptDialog.EndGrid()

    settings = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "IsBlacklistBox", "MachineListBox",
                "LimitGroupBox", "VersionBox", "SwarmCountBox",
                "AgentGroupBox", "AllowedRemoteAgentGroupBox",
                "AllowedRemoteAgentNamesBox", "CoordinatorRemotingHostBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    scriptDialog.ShowDialog(True)
def __main__( *args ):
    global scriptDialog
    global settings
    
    scriptDialog = DeadlineScriptDialog()

    scriptDialog.SetTitle( "Submit CSi ETABS Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'CSiETABS' ) )

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

    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "CSi ETABS Data File(s)", 1, 0, "The CSi ETABS Data File to be processed.", False )
    scriptDialog.AddSelectionControlToGrid( "SceneBox", "MultiFileBrowserControl", "", "CSi ETABS Files (*.EDB);;Microsoft Access Files (*.MDB);;Microsoft Excel Files (*.XLS);;CSi ETABS Text Files (*.$ET *.E2K)", 1, 1, colSpan=2 )
    
    OverrideOutput = scriptDialog.AddSelectionControlToGrid( "OverrideOutput", "CheckBoxControl", False, "Override Output Directory", 2, 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", "", "", 2, 1, colSpan=2 )
    scriptDialog.SetEnabled( "OutputDirectoryBox", False )

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

    scriptDialog.AddTabPage("Advanced Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator4", "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( "DesignCompositeBeam", "CheckBoxControl", False, "Composite Beam Design", 3, 0, "Perform composite beam design after the analysis has completed." )
    scriptDialog.AddSelectionControlToGrid( "DesignShearWall", "CheckBoxControl", False, "Shear Wall Design", 3, 1, "Peform shear wall design after analysis has completed." )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator5", "SeparatorControl", "Deletion Option", 0, 0, colSpan=3 )

    scriptDialog.AddSelectionControlToGrid("DeleteAnalysisBox", "CheckBoxControl", False, "Delete Analysis Results", 1, 0, "Choose to delete the analysis results if required." )
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "Separator6", "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.", False )
    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","DesignSteelFrame","DesignConcreteFrame","DesignCompositeBeam","DesignShearWall","DeleteAnalysisBox","IncludeDataFileBox","CompressOutputBox","CommandLineArgs","VersionBox")
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    
    scriptDialog.Shown.connect( InitializeDialog )

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

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

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

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl", "Nuke File", 1,
                                  0, "The Nuke script to be rendered.", False)
    scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "MultiFileBrowserControl",
        "",
        "Nuke Files (*.nk *.nk4 *.nuke *.nuke4);;All Files (*)",
        1,
        1,
        colSpan=3)

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

    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.AddSelectionControlToGrid(
        "SubmitSceneBox",
        "CheckBoxControl",
        False,
        "Submit Nuke Script File With Job",
        3,
        2,
        "If this option is enabled, the scene file will be submitted with the job, and then copied locally to the slave machine during rendering.",
        colSpan=2)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 4,
                                  0, "The version of Nuke to render with.",
                                  False)
    versionBox = scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "11.3",
        ("6.0", "6.1", "6.2", "6.3", "6.4", "7.0", "7.1", "7.2", "7.3", "7.4",
         "8.0", "8.1", "8.2", "8.3", "8.4", "9.0", "10.0", "10.5", "11.0",
         "11.1", "11.2", "11.3"), 4, 1)
    versionBox.ValueModified.connect(VersionChanged)
    scriptDialog.EndGrid()

    scriptDialog.EndTabPage()

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

    scriptDialog.AddControlToGrid(
        "WriteNodeLabel", "LabelControl", "Write Node(s) To Render", 1, 0,
        "A comma separated list of the write node(s) to render. This is optional and left blank, ALL write nodes will be rendered.",
        False)
    scriptDialog.AddControlToGrid("WriteNodeBox",
                                  "TextControl",
                                  "",
                                  1,
                                  1,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "ViewsLabel", "LabelControl", "View(s) To Render", 2, 0,
        "A comma separated list of the views to render. This is optional and can be left blank.",
        False)
    scriptDialog.AddControlToGrid("ViewsBox",
                                  "TextControl",
                                  "",
                                  2,
                                  1,
                                  colSpan=4)

    scriptDialog.AddControlToGrid(
        "RameUseLabel", "LabelControl", "Max RAM Usage (MB)", 3, 0,
        "The maximum RAM usage (in MB) to be used for rendering. Set to 0 to not enforce a maximum amount of RAM.",
        False)
    scriptDialog.AddRangeControlToGrid("RamUseBox", "RangeControl", 0, 0,
                                       64000, 0, 1, 3, 1)
    scriptDialog.AddControlToGrid(
        "StackSizeLabel", "LabelControl", "Min Stack Size (MB)", 3, 2,
        "The minimum stack size (in MB) to be used for rendering. Set to 0 to not enforce a minimum stack size.",
        False)
    scriptDialog.AddRangeControlToGrid("StackSizeBox", "RangeControl", 0, 0,
                                       64000, 0, 1, 3, 3)

    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 4, 0,
        "The number of threads to use for rendering. Set to 0 to have Nuke automatically determine the optimal thread count.",
        False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 4, 1)
    scriptDialog.AddControlToGrid(
        "RenderModeLabel", "LabelControl", "Render mode", 4, 2,
        "The mode used for rendering the nuke file.", False)
    scriptDialog.AddComboControlToGrid("ResolutionModeBox",
                                       "ComboControl",
                                       "Use Scene Settings",
                                       DisplayOptions,
                                       4,
                                       3,
                                       expand=False,
                                       colSpan=3)

    useGpuBox = scriptDialog.AddSelectionControlToGrid(
        "UseGpuBox",
        "CheckBoxControl",
        False,
        "Use GPU For Rendering",
        5,
        0,
        "If Nuke should also use the GPU for rendering.",
        False,
        colSpan=2)
    useGpuBox.ValueModified.connect(UseGPUChanged)
    scriptDialog.AddControlToGrid(
        "GpuOverrideLabel", "LabelControl", "GPU Override", 5, 2,
        "The GPU that Nuke should use if you are using the GPU for rendering. ( Used for Nuke 8 and higher. ).",
        False)
    scriptDialog.AddRangeControlToGrid("GpuOverrideBox", "RangeControl", 0, 0,
                                       15, 0, 1, 5, 3)

    batchCheckBox = scriptDialog.AddSelectionControlToGrid(
        "UseBatchModeBox",
        "CheckBoxControl",
        True,
        "Use Batch Mode",
        6,
        0,
        "This uses the Nuke plugin's Batch Mode. It keeps the Nuke script loaded in memory between frames, which reduces the overhead of rendering the job.",
        "",
        colSpan=2)
    batchCheckBox.ValueModified.connect(BatchModeChanged)
    scriptDialog.AddSelectionControlToGrid(
        "UseNukeXBox",
        "CheckBoxControl",
        False,
        "Render With NukeX",
        6,
        2,
        "If checked, NukeX will be used instead of just Nuke.",
        False,
        colSpan=2)

    scriptDialog.AddSelectionControlToGrid(
        "EnforceRenderOrderBox",
        "CheckBoxControl",
        False,
        "Enforce Render Order",
        7,
        0,
        "Forces Nuke to obey the render order of Write nodes.",
        False,
        colSpan=2)
    scriptDialog.AddSelectionControlToGrid(
        "ContinueOnErrorBox",
        "CheckBoxControl",
        False,
        "Continue On Error",
        7,
        2,
        "Enable to allow Nuke to continue rendering if it encounters an error.",
        False,
        colSpan=2)

    scriptDialog.AddSelectionControlToGrid(
        "IsMovieBox",
        "CheckBoxControl",
        False,
        "Is Movie Render",
        8,
        0,
        "If checked, Deadline will render as a single chunk in Batch Mode, instead of rendering each frame separately. This is necessary for movie renders, otherwise only the last frame is written to the output file.",
        False,
        colSpan=2)
    scriptDialog.AddSelectionControlToGrid(
        "ForceReloadPluginBox",
        "CheckBoxControl",
        False,
        "Reload Plugin Between Tasks",
        8,
        2,
        "If checked, Nuke will force all memory to be released before starting the next task, but this can increase the overhead time between tasks.",
        False,
        colSpan=2)

    PerformProfilerBox = scriptDialog.AddSelectionControlToGrid(
        "PerformanceProfilerBox",
        "CheckBoxControl",
        False,
        "Use Performance Profiler",
        9,
        0,
        "If checked, Nuke will profile the performance of the Nuke script whilst rendering and create a *.xml file for later analysis.",
        False,
        colSpan=2)
    PerformProfilerBox.ValueModified.connect(PerformProfilerChanged)

    scriptDialog.AddControlToGrid(
        "PerformanceProfilerDirLabel",
        "LabelControl",
        "XML Directory",
        10,
        0,
        "The directory on the network where the performance profile *.xml files will be saved.",
        False,
        colSpan=1)
    scriptDialog.AddSelectionControlToGrid("PerformanceProfilerDirBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           10,
                                           1,
                                           colSpan=4)

    scriptDialog.AddControlToGrid("Separator7",
                                  "SeparatorControl",
                                  "Script Job Options",
                                  11,
                                  0,
                                  colSpan=5)
    scriptDialog.AddControlToGrid(
        "ScriptJobLabel",
        "LabelControl",
        "Script Jobs use Batch Mode and do not force a particular render.",
        12,
        0,
        colSpan=5)
    scriptJobBox = scriptDialog.AddSelectionControlToGrid(
        "ScriptJobBox",
        "CheckBoxControl",
        False,
        "Submit A Nuke Script Job (Python)",
        13,
        0,
        "Enable this option to submit a custom Python script job. This Python script will be executed with the Nuke scene file that is specified.",
        colSpan=5)
    scriptJobBox.ValueModified.connect(ScriptJobChanged)

    scriptDialog.AddControlToGrid("ScriptFileLabel", "LabelControl",
                                  "Python Script File", 14, 0,
                                  "The Python script file to use.", False)
    scriptDialog.AddSelectionControlToGrid("ScriptFileBox",
                                           "FileBrowserControl",
                                           "",
                                           "Python Script Files (*.py)",
                                           14,
                                           1,
                                           colSpan=4)

    scriptDialog.EndGrid()

    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "NukeMonitor",
                                          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 = ("DepartmentBox", "CategoryBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "MachineLimitBox", "IsBlacklistBox",
                "MachineListBox", "LimitGroupBox", "SceneBox", "FramesBox",
                "ChunkSizeBox", "VersionBox", "ThreadsBox", "RamUseBox",
                "SubmitSceneBox", "WriteNodeBox", "ViewsBox", "UseNukeXBox",
                "StackSizeBox", "UseBatchModeBox", "ContinueOnErrorBox",
                "ResolutionModeBox", "ForceReloadPluginBox",
                "EnforceRenderOrderBox", "UseGpuBox", "GpuOverrideBox",
                "PerformanceProfilerBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    UseGPUChanged(None)
    BatchModeChanged(None)
    VersionChanged(None)
    PerformProfilerChanged(None)
    ScriptJobChanged(None)

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

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

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

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

    scriptDialog.AddControlToGrid(
        "SceneLabel", "LabelControl", "Maxwell File", 1, 0,
        "The Maxwell files to be rendered. Can be a single file, or a sequence of files.",
        False)

    sceneBox = scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Maxwell Files (*.mxs);;All files (*)",
        1,
        1,
        colSpan=3)
    sceneBox.ValueModified.connect(SceneBoxChanged)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl", "Version", 2,
                                  0, "The version of Maxwell to render with.",
                                  False)
    versionBox = scriptDialog.AddComboControlToGrid("VersionBox",
                                                    "ComboControl", "2",
                                                    ("2", "3", "4"), 2, 1)
    versionBox.ValueModified.connect(VersionBoxChanged)
    scriptDialog.AddControlToGrid(
        "VerbosityLabel", "LabelControl", "Verbosity", 2, 2,
        "Set the amount of information that Maxwell should output while rendering.",
        False)
    scriptDialog.AddComboControlToGrid(
        "VerbosityBox", "ComboControl", "All",
        ("None", "Errors", "Warnings", "Info", "All"), 2, 3)

    singleFileBox = scriptDialog.AddSelectionControlToGrid(
        "SingleFileBox", "CheckBoxControl", False, "Single Frame Job", 3, 1,
        "This should be checked if you're submitting a single Maxwell file only."
    )
    singleFileBox.ValueModified.connect(SingleFileBoxChanged)
    scriptDialog.AddControlToGrid("BuildLabel", "LabelControl",
                                  "Build To Force", 3, 2,
                                  "Force 32 bit or 64 bit rendering.", False)
    scriptDialog.AddComboControlToGrid("BuildBox", "ComboControl", "None",
                                       ("None", "32bit", "64bit"), 3, 3)

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

    scriptDialog.AddControlToGrid(
        "ChunkSizeLabel", "LabelControl", "Frames Per Task", 5, 0,
        "This is the number of frames that will be rendered at a time for each job task.",
        False)
    scriptDialog.AddRangeControlToGrid("ChunkSizeBox", "RangeControl", 1, 1,
                                       1000000, 0, 1, 5, 1)
    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 5, 2,
        "The number of threads to use for rendering.", False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 256,
                                       0, 1, 5, 3)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Additional Options")

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator9",
                                  "SeparatorControl",
                                  "Cooperative Rendering",
                                  0,
                                  0,
                                  colSpan=3)

    coopBox = scriptDialog.AddSelectionControlToGrid(
        "CoopBox", "CheckBoxControl", False, "Cooperative Rendering", 1, 0,
        "If enabled, multiple jobs will be submitted to Deadline, each with a different seed. You can then use Maxwell to combine the resulting output after the rendering has completed.",
        False)
    coopBox.ValueModified.connect(CoopBoxChanged)
    separateCoopJobsBox = scriptDialog.AddSelectionControlToGrid(
        "SeparateCoopJobsBox", "CheckBoxControl", False,
        "Split Co-op Renders Into Separate Jobs", 1, 1,
        "If enabled, co-op renders will be split up into separate jobs. This is required if rendering an animation instead of a single Maxwell file.",
        False)
    separateCoopJobsBox.ValueModified.connect(SeparateCoopJobsChanged)
    scriptDialog.AddHorizontalSpacerToGrid("AOHSpacer1", 1, 2)

    scriptDialog.AddControlToGrid("AutoComputeSamplingEmptyLabel",
                                  "LabelControl", "", 2, 0, "", False)
    scriptDialog.AddSelectionControlToGrid(
        "AutoComputeSamplingBox", "CheckBoxControl", False,
        "Adjust Sampling Overrides For Cooperative Rendering", 2, 1,
        "Enable to adjust the Sampling Level overrides below for each individual render so that the merged results have the Sampling Levels specified."
    )

    scriptDialog.AddControlToGrid(
        "CoopJobsLabel", "LabelControl", "Number Of Co-op Renders", 3, 0,
        "The number of co-op renders to submit to Deadline.", False)
    scriptDialog.AddRangeControlToGrid("CoopJobsBox",
                                       "RangeControl",
                                       2,
                                       2,
                                       1000000,
                                       0,
                                       1,
                                       3,
                                       1,
                                       expand=False)

    autoMergeBox = scriptDialog.AddSelectionControlToGrid(
        "AutoMergeBox", "CheckBoxControl", False, "Auto-Merge Files", 4, 0,
        "Enable if you want Deadline to use Maxwell to merge the results from the co-op jobs.",
        False)
    autoMergeBox.ValueModified.connect(AutoMergeChanged)
    scriptDialog.AddSelectionControlToGrid(
        "FailOnMissingFilesBox", "CheckBoxControl", True,
        "Fail On Missing Intermediate Files", 4, 1,
        "Enable to have the merge job fail if there are co-op results that are missing.",
        False)

    scriptDialog.AddSelectionControlToGrid(
        "DeleteFilesBox", "CheckBoxControl", False,
        "Delete Intermediate Files", 5, 1,
        "Enable to have Deadline automatically delete the individual co-op results after merging the final result.",
        False)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator10",
                                  "SeparatorControl",
                                  "Output Options",
                                  0,
                                  0,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "MxiLabel", "LabelControl", "Output MXI File (optional)", 1, 0,
        "Optionally configure the output path for the MXI file which can be used to resume the render later. Note that this is required for co-op rendering though.",
        False)
    scriptDialog.AddSelectionControlToGrid("MxiBox", "FileSaverControl", "",
                                           "MXI (*.mxi);;All files (*)", 1, 1)

    scriptDialog.AddControlToGrid(
        "OutputLabel", "LabelControl", "Output Image File (optional)", 2, 0,
        "Optionally configure the output path for the image file.", False)
    scriptDialog.AddSelectionControlToGrid(
        "OutputBox", "FileSaverControl", "",
        "PNG (*.png);;Targa (*.tga);;JPG (*.jpg);;TIFF (*.tif);;JPG2000 (*.jp2);;HDR (*.hdr);;EXR (*.exr);;PSD (*.psd);;BMP (*.bmp);;PPM (*.ppm);;PBM (*.pbm);;PGM (*.pgm);;All files (*)",
        2, 1)

    scriptDialog.AddControlToGrid("CameraLabel", "LabelControl",
                                  "Render Camera (optional)", 3, 0,
                                  "Optionally choose which camera to render.",
                                  False)
    scriptDialog.AddControlToGrid("CameraBox", "TextControl", "", 3, 1)

    scriptDialog.AddSelectionControlToGrid(
        "LocalRenderingBox",
        "CheckBoxControl",
        False,
        "Enable Local Rendering",
        4,
        0,
        "If enabled, the mxi file and/or the image file will be rendered to a local file and copied to the network after rendering is complete. Note that this requires you to specify an mxi and/or an image path in the submitter.",
        colSpan=2)
    scriptDialog.AddSelectionControlToGrid(
        "ResumeBox",
        "CheckBoxControl",
        False,
        "Resume From MXI File If It Exists (requires Maxwell 2.5.1 or later)",
        5,
        0,
        "Requires Maxwell 2.5.1. If enabled, Maxwell will use the specified MXI file to resume the render if it exists. If you suspend the job in Deadline, it will pick up from where it left off when it resumes.",
        colSpan=2)
    scriptDialog.EndGrid()

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

    overrideTimeCheck = scriptDialog.AddSelectionControlToGrid(
        "OverrideTime", "CheckBoxControl", False, "Override Time", 1, 0,
        "Enable to override the Time setting in the Maxwell file.", False)
    overrideTimeCheck.ValueModified.connect(OverrideTimeChanged)
    scriptDialog.AddRangeControlToGrid("OverrideTimeBox", "RangeControl", 10,
                                       1, 9999999, 2, 1, 1, 1,
                                       "The Time override value (minutes).")

    overrideSamplingCheck = scriptDialog.AddSelectionControlToGrid(
        "OverrideSampling", "CheckBoxControl", False,
        "Override Sampling Level", 2, 0,
        "Enable to override the Sampling setting in the Maxwell file.", False)
    overrideSamplingCheck.ValueModified.connect(OverrideSamplingChanged)
    scriptDialog.AddRangeControlToGrid("OverrideSamplingBox", "RangeControl",
                                       10, 0, 50, 2, 1, 2, 1)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid(
        "Separator11",
        "SeparatorControl",
        "Extra Sampling (requires Maxwell 3.1 or later)",
        0,
        0,
        colSpan=4)

    overrideExtraSamplingCheck = scriptDialog.AddSelectionControlToGrid(
        "OverrideExtraSampling",
        "CheckBoxControl",
        False,
        "Override Extra Sampling",
        1,
        0,
        "If the extra sampling settings should be overridden.",
        False,
        colSpan=2)
    overrideExtraSamplingCheck.ValueModified.connect(
        OverrideExtraSamplingChanged)
    extraSamplingEnabledCheck = scriptDialog.AddSelectionControlToGrid(
        "ExtraSamplingEnabled",
        "CheckBoxControl",
        False,
        "Enabled",
        1,
        2,
        "If extra sampling is enabled.",
        False,
        colSpan=2)
    extraSamplingEnabledCheck.ValueModified.connect(
        OverrideExtraSamplingChanged)

    scriptDialog.AddControlToGrid("ExtraSamplingLevelLabel", "LabelControl",
                                  "Sampling Level", 2, 0,
                                  "The extra sampling level.", False)
    scriptDialog.AddRangeControlToGrid("ExtraSamplingLevelBox", "RangeControl",
                                       10, 0, 50, 2, 1, 2, 1)
    scriptDialog.AddSelectionControlToGrid(
        "ExtraSamplingInvertMask",
        "CheckBoxControl",
        False,
        "Invert Mask",
        2,
        2,
        "If the extra sampling alpha mask must be inverted.",
        False,
        colSpan=2)

    scriptDialog.AddControlToGrid("ExtraSamplingMaskLabel", "LabelControl",
                                  "Mask", 3, 0, "The extra sampling mask.",
                                  False)
    maskBox = scriptDialog.AddComboControlToGrid(
        "ExtraSamplingMaskBox", "ComboControl", "Alpha",
        ("Custom Alpha", "Alpha", "Bitmap"), 3, 1)
    maskBox.ValueModified.connect(OverrideExtraSamplingChanged)
    scriptDialog.AddControlToGrid(
        "ExtraSamplingCustomAlphaLabel", "LabelControl", "Custom Alpha", 3, 2,
        "The custom alpha name that will be used for the extra sampling mask (if Mask is set to Custom Alpha).",
        False)
    scriptDialog.AddControlToGrid("ExtraSamplingCustomAlphaBox", "TextControl",
                                  "", 3, 3)

    scriptDialog.AddControlToGrid(
        "ExtraSamplingBitmapLabel", "LabelControl", "Bitmap File", 4, 0,
        "The bitmap file that will be used for the extra sampling mask (if Mask is set to Bitmap).",
        False)
    scriptDialog.AddSelectionControlToGrid("ExtraSamplingBitmapBox",
                                           "FileBrowserControl",
                                           "",
                                           "All files (*)",
                                           4,
                                           1,
                                           colSpan=3)
    scriptDialog.EndGrid()

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

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

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "MaxwellMonitor",
                                          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", "ThreadsBox", "CoopJobsBox", "BuildBox",
                "AutoMergeBox", "DeleteFilesBox", "VersionBox", "VerbosityBox",
                "OverrideTime", "OverrideTimeBox", "OverrideSampling",
                "OverrideSamplingBox", "MxiBox", "ResumeBox", "OutputBox",
                "SingleFileBox", "AutoComputeSamplingBox", "LocalRenderingBox",
                "SeparateCoopJobsBox", "FailOnMissingFilesBox",
                "OverrideExtraSampling", "ExtraSamplingEnabled",
                "ExtraSamplingLevelBox", "ExtraSamplingInvertMask",
                "ExtraSamplingMaskBox", "ExtraSamplingCustomAlphaBox",
                "ExtraSamplingBitmapBox")

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

    VersionBoxChanged(None)
    SceneBoxChanged(None)
    SingleFileBoxChanged(None)
    CoopBoxChanged(None)
    AutoMergeChanged(None)
    SeparateCoopJobsChanged(None)
    OverrideTimeChanged(None)
    OverrideSamplingChanged(None)
    OverrideExtraSamplingChanged(None)

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

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Setup VRED Cluster Job With Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('VREDCluster'))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Cluster Options",
                                  14,
                                  0,
                                  colSpan=3)

    scriptDialog.AddControlToGrid(
        "ClusterCountLabel", "LabelControl", "Cluster Count", 15, 0,
        "The number of tasks/maximum number of slaves to create in the cluster. Default: 1",
        False)
    scriptDialog.AddRangeControlToGrid("ClusterCountBox", "RangeControl", 1, 1,
                                       100, 0, 1, 15, 1)

    scriptDialog.AddControlToGrid(
        "PortLabel", "LabelControl", "Port Number", 16, 0,
        "The port number to be used. Default: 8889. Ensure firewall is open.",
        False)
    scriptDialog.AddRangeControlToGrid("PortBox", "RangeControl", 8889, 1024,
                                       65535, 0, 1, 16, 1)

    scriptDialog.AddControlToGrid("VersionLabel", "LabelControl",
                                  "VRED Version", 17, 0,
                                  "The VRED application version to use.",
                                  False)
    scriptDialog.AddComboControlToGrid("VersionBox",
                                       "ComboControl", "11.0 (2019)",
                                       versionOptions.keys(), 17, 1)
    scriptDialog.EndGrid()

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

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

    scriptDialog.ShowDialog(False)
Beispiel #22
0
def __main__(*args):
    global scriptDialog
    global settings
    global jobOptionsDialog
    global frameList
    global framesPerTask
    global submittedFromMonitor
    global imageRender
    global outputFile
    global rndFileName

    submittedFromMonitor = not bool(args)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    ImageBoxChanged()

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

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

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Submit Cinema 4D Job To Deadline")
    scriptDialog.SetIcon(scriptDialog.GetIcon('Cinema4D'))

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

    scriptDialog.AddControlToGrid("SceneLabel", "LabelControl",
                                  "Cinema 4D File", 1, 0,
                                  "The scene file to be rendered.", False)
    scriptDialog.AddSelectionControlToGrid("SceneBox",
                                           "MultiFileBrowserControl",
                                           "",
                                           "Cinema 4D Files (*.c4d)",
                                           1,
                                           1,
                                           colSpan=3)

    scriptDialog.AddControlToGrid(
        "TakeLabel", "LabelControl", "Take Name", 2, 0,
        "The name of the take to render. This is optional, and if left blank, it will default to the current take.",
        False)
    scriptDialog.AddControlToGrid("TakeBox", "TextControl", "", 2, 1)
    scriptDialog.AddControlToGrid(
        "ThreadsLabel", "LabelControl", "Threads", 2, 2,
        "The number of threads to use for rendering.", False)
    scriptDialog.AddRangeControlToGrid("ThreadsBox", "RangeControl", 0, 0, 16,
                                       0, 1, 2, 3)

    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.AddControlToGrid("VersionLabel", "LabelControl", "Version", 4,
                                  0,
                                  "The version of Cinema 4D to render with.",
                                  False)
    versionBox = scriptDialog.AddComboControlToGrid(
        "VersionBox", "ComboControl", "19",
        ("12", "13", "14", "15", "16", "17", "18", "19", "20"), 4, 1)
    versionBox.ValueModified.connect(VersionBoxChanged)
    scriptDialog.AddSelectionControlToGrid(
        "UseBatchPluginBox",
        "CheckBoxControl",
        True,
        "Use Batch Plugin",
        4,
        2,
        "If checked, the Cinema 4D batch plugin will be used to render Cinema 4D jobs, which keeps the scene file loaded in memory between tasks.",
        colSpan=1)
    scriptDialog.AddSelectionControlToGrid(
        "NoOpenGLBox",
        "CheckBoxControl",
        False,
        "Don't Load OpenGL",
        4,
        3,
        "If you are not using the Hardware OpenGL renderer, checking this option reduces the Cinema 4D startup time.",
        colSpan=1)

    scriptDialog.AddControlToGrid(
        "BuildLabel", "LabelControl", "Build To Force", 5, 0,
        "You can force 32 or 64 bit rendering with this option.", False)
    scriptDialog.AddComboControlToGrid("BuildBox", "ComboControl", "None",
                                       ("None", "32bit", "64bit"), 5, 1)
    scriptDialog.AddSelectionControlToGrid(
        "SubmitSceneBox",
        "CheckBoxControl",
        False,
        "Submit Cinema 4D Scene",
        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.",
        colSpan=2)

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Advanced Options")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "Cinema 4D Output Options",
                                  0,
                                  0,
                                  colSpan=5)

    useDefaultBox = scriptDialog.AddSelectionControlToGrid(
        "UseDefaultOutputBox",
        "CheckBoxControl",
        True,
        "Use Default Output From Scene",
        1,
        0,
        "Enable this option to use the output path defined in the scene file.",
        False,
        colSpan=2)
    useDefaultBox.ValueModified.connect(UseDefaultOutputChanged)

    scriptDialog.AddControlToGrid(
        "OutputPrefixLabel", "LabelControl", "Filename Prefix", 1, 2,
        "If overriding the output, this is the file name prefix.", False)
    scriptDialog.AddControlToGrid("OutputPrefixBox",
                                  "TextControl",
                                  "",
                                  1,
                                  3,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "OutputFolderLabel", "LabelControl", "Output Folder", 2, 0,
        "If overriding the output, this is the folder that the frames will be saved to.",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputFolderBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           2,
                                           1,
                                           colSpan=4)

    useDefaultMPBox = scriptDialog.AddSelectionControlToGrid(
        "UseDefaultMPOutputBox",
        "CheckBoxControl",
        True,
        "Use Default Multipass Output From Scene",
        4,
        0,
        "Enable this option to use the multipass output path defined in the scene file.",
        False,
        colSpan=2)
    useDefaultMPBox.ValueModified.connect(UseDefaultMPOutputChanged)

    scriptDialog.AddControlToGrid(
        "OutputMPPrefixLabel", "LabelControl", "MP Filename Prefix", 4, 2,
        "If overriding the multipass output, this is the file name prefix.",
        False)
    scriptDialog.AddControlToGrid("OutputMPPrefixBox",
                                  "TextControl",
                                  "",
                                  4,
                                  3,
                                  colSpan=2)

    scriptDialog.AddControlToGrid(
        "OutputMPFolderLabel", "LabelControl", "MP Output Folder", 5, 0,
        "If overriding the multipass output, this is the folder that the frames will be saved to.",
        False)
    scriptDialog.AddSelectionControlToGrid("OutputMPFolderBox",
                                           "FolderBrowserControl",
                                           "",
                                           "",
                                           5,
                                           1,
                                           colSpan=4)

    scriptDialog.AddSelectionControlToGrid(
        "LocalRenderingBox", "CheckBoxControl", False,
        "Enable Local Rendering", 6, 0,
        "If enabled, the frames will be rendered locally, and then copied to their final network location.",
        False)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator7",
                                  "SeparatorControl",
                                  "Script Job Options",
                                  7,
                                  0,
                                  colSpan=4)
    scriptDialog.AddControlToGrid(
        "ScriptJobLabel1",
        "LabelControl",
        "Script Jobs use the Cinema 4D Batch plugin, and do not force a particular render.",
        8,
        0,
        colSpan=2)
    scriptJobBox = scriptDialog.AddSelectionControlToGrid(
        "ScriptJobBox",
        "CheckBoxControl",
        False,
        "Submit A Cinema4D Script Job (Python)",
        9,
        0,
        "Enable this option to submit a custom Python script job. This script will be applied to the scene file that is specified.",
        colSpan=2)
    scriptJobBox.ValueModified.connect(ScriptJobChanged)

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

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("GPUSeparator",
                                  "SeparatorControl",
                                  "Redshift GPU Options",
                                  11,
                                  0,
                                  colSpan=3)

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

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

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

    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", "ThreadsBox", "VersionBox", "BuildBox",
                "SubmitSceneBox", "UseDefaultOutputBox", "OutputFolderBox",
                "OutputPrefixBox", "UseDefaultMPOutputBox",
                "OutputMPFolderBox", "OutputMPPrefixBox", "LocalRenderingBox",
                "UseBatchPluginBox", "NoOpenGLBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    VersionBoxChanged()
    UseDefaultOutputChanged(None)
    UseDefaultMPOutputChanged(None)
    ScriptJobChanged(None)
    GPUsPerTaskChanged()
    GPUsSelectDevicesChanged()

    scriptDialog.ShowDialog(False)
Beispiel #25
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

    dialogWidth = 450
    dialogHeight = 0

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

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

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

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

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

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

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

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

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

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

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

    if showWindow:
        scriptDialog.ShowDialog(True)
    else:
        connectWithVNC()
def __main__( *args ):
    global scriptDialog
    global settings
    
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit Draft Tile Assembly Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'DraftTileAssembler' ) )
    
    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( "Separator1", "SeparatorControl", "Draft Tile Assembler Options", 0, 0, colSpan=3 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid( "SceneLabel", "LabelControl", "Input Config File", 0, 0,  "The tile assembler config file that contains information about the tile files and the final image.", False )
    scriptDialog.AddSelectionControlToGrid( "SceneBox", "FileBrowserControl", "", "All Files (*)", 0, 1, colSpan=3 )

    scriptDialog.AddSelectionControlToGrid( "MissingBox", "CheckBoxControl", True, "Error on Missing Files", 1, 0, "If enabled, an error will occur if one or more input tiles are missing.", colSpan=2 )
    scriptDialog.AddSelectionControlToGrid( "CleanupBox", "CheckBoxControl", False, "Cleanup Tiles", 1, 2, "If enabled, The tiles will be cleaned up after assembly is completed.", colSpan=2 )
    scriptDialog.AddSelectionControlToGrid( "MissingBackgroundBox", "CheckBoxControl", True, "Error on Missing Background", 2, 0, "If enabled, an error will occur if the background is specified and the file does not exist.", colSpan=2 )
    scriptDialog.EndGrid()
    
    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid( "HSpacer2", 0, 0 )
    submitButton = scriptDialog.AddControlToGrid( "SubmitButton", "ButtonControl", "Submit", 0, 1, expand=False )
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid( "CloseButton", "ButtonControl", "Close", 0, 2, expand=False )
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()
    
    settings = ("DepartmentBox","CategoryBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","MachineLimitBox","IsBlacklistBox","MachineListBox","LimitGroupBox","SceneBox","MissingBox", "CleanupBox", "MissingBackgroundBox")
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    scriptDialog.ShowDialog( False )
def __main__( *args ):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle( "Submit RIB Job To Deadline" )
    scriptDialog.SetIcon( scriptDialog.GetIcon( 'RIB' ) )
    
    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 )
    scriptDialog.AddHorizontalSpacerToGrid("RHSpacer1", 2, 2 )

    scriptDialog.AddControlToGrid( "RendererLabel", "LabelControl", "Renderer", 3, 0, "The renderer that will be used to render the RIB files. ", False )
    scriptDialog.AddComboControlToGrid( "RendererBox", "ComboControl", "3delight", ("3delight","Air","Aqsis","BMRT","Entropy","Pixie","RenderDotC","RenderMan","RenderPipe"), 3, 1 )

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

    scriptDialog.AddControlToGrid( "CommandLineLabel", "LabelControl", "Additional Arguments", 5, 0, "Specify additional command line arguments you would like to pass to the RIB renderer. See the documentation for your particular RIB renderer for additional arguments. ", False )
    scriptDialog.AddControlToGrid( "CommandLineBox", "TextControl", "", 5, 1, colSpan=2 )
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "RibMonitor", 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","RendererBox","CommandLineBox" )
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    SceneFileChanged( None )
    
    scriptDialog.ShowDialog( False )
Beispiel #29
0
def __main__(*args):
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog

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

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

    scriptDialog.AddControlToGrid(
        "SceneLabel", "LabelControl", "Input MI File", 1, 0,
        "This needs to be on a network location, since Rendition often saves the output file(s) relative to the input MI file location.",
        False)
    scriptDialog.AddSelectionControlToGrid(
        "SceneBox",
        "FileBrowserControl",
        "",
        "Mental Image Files (*.mi *.mi2);;All Files (*)",
        1,
        1,
        colSpan=3)

    scriptDialog.AddControlToGrid("OutputLabel", "LabelControl",
                                  "Output File (Optional)", 2, 0,
                                  "Optionally override the output file.",
                                  False)
    outputBox = scriptDialog.AddSelectionControlToGrid(
        "OutputBox",
        "FileSaverControl",
        "",
        "Bitmap (*.bmp);;EXR (*.exr);;GIF (*.gif);;IFF (*.iff);;JPG (*.jpg);;PNG (*.png);;Targa (*.tga);;TIFF (*.tif);;All Files (*)",
        2,
        1,
        colSpan=3)

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

    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.AddSelectionControlToGrid("SkipBox", "CheckBoxControl", True,
                                           "Skip Existing Frames", 4, 2,
                                           "Enable to skip existing frames.")

    scriptDialog.AddControlToGrid(
        "CommandLabel", "LabelControl", "Command Line Args", 5, 0,
        "Additional command line arguments to pass to Rendition during rendering. ",
        False)
    scriptDialog.AddControlToGrid("CommandBox",
                                  "TextControl",
                                  "",
                                  5,
                                  1,
                                  colSpan=3)
    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()

    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs(scriptDialog,
                                          "RenditionMonitor",
                                          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",
                "FramesBox", "ChunkSizeBox", "SkipBox", "BuildBox",
                "CommandBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

    scriptDialog.ShowDialog(False)
Beispiel #30
0
def __main__():
    global AFTER_EFFECTS_VERSIONS
    global scriptDialog
    global settings
    global ProjectManagementOptions
    global DraftRequested
    global integration_dialog
    
    scriptDialog = DeadlineScriptDialog()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.AddControlToGrid( "ChunkSizeLabel", "LabelControl", "Frames Per Task", 4, 0, "This is the number of frames that will be rendered at a time for each job task.", False )
    scriptDialog.AddRangeControlToGrid( "ChunkSizeBox", "RangeControl", 1, 1, 1000000, 0, 1, 4, 1 )
    scriptDialog.AddSelectionControlToGrid( "MultiProcess", "CheckBoxControl", False, "Use Multi-Process Rendering", 4, 2, "Enable to use multiple processes to render multiple frames simultaneously." )

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

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

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

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

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

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

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

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    
    integration_dialog = IntegrationUI.IntegrationDialog()
    integration_dialog.AddIntegrationTabs( scriptDialog, "AfterEffectsMonitor", DraftRequested, ProjectManagementOptions, failOnNoTabs=False )
    
    scriptDialog.EndTabControl()
    
    scriptDialog.AddGrid()
    scriptDialog.AddHorizontalSpacerToGrid( "HSpacer1", 0, 0 )
    submitButton = scriptDialog.AddControlToGrid( "SubmitButton", "ButtonControl", "Submit", 0, 1, expand=False )
    submitButton.ValueModified.connect(SubmitButtonPressed)
    closeButton = scriptDialog.AddControlToGrid( "CloseButton", "ButtonControl", "Close", 0, 2, expand=False )
    # Make sure all the project management connections are closed properly
    closeButton.ValueModified.connect(integration_dialog.CloseProjectManagementConnections)
    closeButton.ValueModified.connect(scriptDialog.closeEvent)
    scriptDialog.EndGrid()
    
    #might need to add some settings here for the memory management options
    settings = ("DepartmentBox","CategoryBox","PoolBox","SecondaryPoolBox","GroupBox","PriorityBox","MachineLimitBox","IsBlacklistBox","MachineListBox","LimitGroupBox","SceneBox","FramesBox","ChunkSizeBox","VersionBox","ArgsBox","MemoryManagement","ImageCachePercentage", "MaxMemoryPercentage", "CompBox", "MultiProcess", "SubmitSceneBox", "OutputBox", "MissingLayers", "MissingEffects", "MissingFootage", "FailOnWarnings", "LocalRendering", "OverrideFailOnExistingAEProcess", "FailOnExistingAEProcess")
    scriptDialog.LoadSettings( GetSettingsFilename(), settings )
    scriptDialog.EnabledStickySaving( settings, GetSettingsFilename() )
    
    CompChanged(None)
    VersionChanged(None)
    MultiMachineChanged(None)
    OverrideButtonPressed(None)
    MemoryManageChanged(None)
    
    #check if memory management is enabled
    if(not bool(scriptDialog.GetValue("MemoryManagement"))):
        scriptDialog.SetEnabled("ImageCachePercentage", False)
        scriptDialog.SetEnabled("MaxMemoryPercentage", False)
    
    scriptDialog.ShowDialog(False)