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

    scriptDialog = DeadlineScriptDialog()

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.AddControlToGrid(
        "MachineListLabel", "LabelControl", "Machine List", 6, 0,
        "Use the Machine Limit to specify the maximum number of machines that can render your job at one time. Specify 0 for no limit.",
        False)
    scriptDialog.AddControlToGrid("MachineListBox", "MachineListControl", "",
                                  6, 1)
    scriptDialog.AddSelectionControlToGrid("IsBlacklistBox", "CheckBoxControl",
                                           False,
                                           "Machine List Is A Blacklist", 6, 2,
                                           "")

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

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

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

    scriptDialog.EndTabPage()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.EndGrid()
    scriptDialog.EndTabPage()
    scriptDialog.EndTabControl()

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

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

    DirFileChooserChanged()
    EnableSplitChanged()
    ClusterTypeChanged()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator4",
                                  "SeparatorControl",
                                  "Media Encoder Options",
                                  0,
                                  0,
                                  colSpan=3)

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

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

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

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

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

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

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

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

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

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

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

    scriptDialog.EndTabControl()

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

    settings = ("CategoryBox", "DepartmentBox", "PoolBox", "SecondaryPoolBox",
                "GroupBox", "PriorityBox", "LimitGroupBox", "OnJobCompleteBox",
                "MachineListBox", "SubmitSuspendedBox", "IsBlacklistBox",
                "VersionBox", "FileExtBox", "AmeInputDirectoryBox",
                "AmeOutputDirectoryBox", "InputBox", "OutputBox", "PresetBox",
                "OverwriteCheckBox", "SubmitEPRCheckBox")
    scriptDialog.LoadSettings(GetSettingsFilename(), settings)
    scriptDialog.EnabledStickySaving(settings, GetSettingsFilename())

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

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

    dialogWidth = 450
    dialogHeight = 0

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

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

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

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

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

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

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

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

    settingsChanged()

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

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

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

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

        # If errors prevent auto-connect from working, just display the window.
        if autoConnect:
            connectWithRDC()
        else:
            scriptDialog.ShowDialog(True)
Beispiel #4
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)
def __main__():
    global scriptDialog
    global settings

    scriptDialog = DeadlineScriptDialog()
    scriptDialog.SetTitle("Script UI Example")

    scriptDialog.AddTabControl("Example Tab Control", 0, 0)

    scriptDialog.AddTabPage("Tab Page 1 : Deadline Controls")
    scriptDialog.AddGroupBox("GroupBox1", "Deadline Job Controls", True)
    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.EndGroupBox(False)
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Tab Page 2 : Simple Controls")
    scriptDialog.AddGroupBox("GroupBox2", "Other UI Controls", True)
    scriptDialog.AddGrid()

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

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

    scriptDialog.AddControlToGrid("MultiLineTextLabel",
                                  "LabelControl",
                                  "Multi Line",
                                  2,
                                  0,
                                  expand=False)
    scriptDialog.AddControlToGrid("MultiLineTextBox",
                                  "MultiLineTextControl",
                                  "One Line\rAnother Line",
                                  2,
                                  1,
                                  "",
                                  colSpan=2)

    scriptDialog.AddControlToGrid("RangeLabel",
                                  "LabelControl",
                                  "Select A Number",
                                  3,
                                  0,
                                  expand=False)
    scriptDialog.AddRangeControlToGrid("RangeBox", "RangeControl", 50.0, 0.0,
                                       100.0, 1, 5.0, 3, 1)
    scriptDialog.AddSelectionControlToGrid("CheckBox", "CheckBoxControl",
                                           False, "This is a Check Box", 3, 2)

    scriptDialog.AddControlToGrid("SliderLabel",
                                  "LabelControl",
                                  "Select A Number",
                                  4,
                                  0,
                                  expand=False)
    scriptDialog.AddRangeControlToGrid("SliderBox",
                                       "SliderControl",
                                       50,
                                       0,
                                       100,
                                       0,
                                       1,
                                       4,
                                       1,
                                       colSpan=2)

    scriptDialog.AddControlToGrid("ComboLabel",
                                  "LabelControl",
                                  "Select An Item",
                                  5,
                                  0,
                                  expand=False)
    scriptDialog.AddComboControlToGrid(
        "ComboBox", "ComboControl", "2008",
        ("2007", "2008", "2009", "2010", "2011"), 5, 1)
    scriptDialog.AddControlToGrid(
        "LinkLabel", "LabelControl",
        "<a href=\"http://www.thinkboxsoftware.com\">www.thinkboxsoftware.com</a>",
        5, 2)

    scriptDialog.AddControlToGrid("ColorLabel",
                                  "LabelControl",
                                  "Select A Color",
                                  6,
                                  0,
                                  expand=False)
    scriptDialog.AddControlToGrid("ColorBox", "ColorControl",
                                  scriptDialog.CreateColorObject(255, 0, 0), 6,
                                  1)

    scriptDialog.AddControlToGrid("ProgressLabel",
                                  "LabelControl",
                                  "Progress",
                                  7,
                                  0,
                                  expand=False)
    scriptDialog.AddRangeControlToGrid("ProgressBox", "ProgressBarControl", 1,
                                       1, 100, 0, 0, 7, 1)
    progressButton = scriptDialog.AddControlToGrid("ProgressButton",
                                                   "ButtonControl",
                                                   "Increment", 7, 2)
    progressButton.ValueModified.connect(ProgressButtonPressed)
    scriptDialog.EndGrid()

    scriptDialog.AddGrid()
    scriptDialog.AddRadioControlToGrid("RadioOne", "RadioControl", True,
                                       "Radio One", "RadioGroup", 0, 0)
    scriptDialog.AddRadioControlToGrid("RadioTwo", "RadioControl", False,
                                       "Radio Two", "RadioGroup", 0, 1)
    scriptDialog.AddRadioControlToGrid("RadioThree", "RadioControl", False,
                                       "Radio Three", "RadioGroup", 0, 2)
    scriptDialog.AddRadioControlToGrid("RadioFour", "RadioControl", False,
                                       "Radio Four", "RadioGroup", 0, 3)
    scriptDialog.EndGrid()
    scriptDialog.EndGroupBox(False)
    scriptDialog.EndTabPage()

    scriptDialog.AddTabPage("Tab Page 3 : Browsers")
    scriptDialog.AddGrid()
    scriptDialog.AddControlToGrid("Separator3",
                                  "SeparatorControl",
                                  "Browsers",
                                  0,
                                  0,
                                  colSpan=2)

    scriptDialog.AddControlToGrid("FolderLabel",
                                  "LabelControl",
                                  "Select Folder",
                                  1,
                                  0,
                                  expand=False)
    scriptDialog.AddSelectionControlToGrid("FolderBox", "FolderBrowserControl",
                                           "", "", 1, 1)

    scriptDialog.AddControlToGrid("FileLabel",
                                  "LabelControl",
                                  "Select File",
                                  2,
                                  0,
                                  expand=False)
    # File Filter demonstrates how to control the file formats to be selected - Text or All Files
    scriptDialog.AddSelectionControlToGrid(
        "FileBox", "FileBrowserControl", "",
        "Text Files (*.txt);;All Files (*.*)", 2, 1)

    scriptDialog.AddControlToGrid("SaveFileLabel",
                                  "LabelControl",
                                  "Save File",
                                  3,
                                  0,
                                  expand=False)
    # File Filter demonstrates how to control the file formats to be selected - Text or All Files
    scriptDialog.AddSelectionControlToGrid(
        "SaveFileBox", "FileSaverControl", "",
        "Text Files (*.txt);;All Files (*.*)", 3, 1)

    scriptDialog.AddControlToGrid("MultiFileLabel",
                                  "LabelControl",
                                  "Multi File",
                                  4,
                                  0,
                                  expand=False)
    scriptDialog.AddSelectionControlToGrid("MultiFileBox",
                                           "MultiFileBrowserControl", "",
                                           "All Files (*.*)", 4, 1)

    scriptDialog.AddControlToGrid("MultiLineFolderLabel",
                                  "LabelControl",
                                  "Multi Line Folder",
                                  5,
                                  0,
                                  expand=False)
    scriptDialog.AddSelectionControlToGrid(
        "MultiLineFolderBox", "MultiLineMultiFolderBrowserControl", "", "", 5,
        1)

    scriptDialog.AddControlToGrid("MultiLineFileLabel",
                                  "LabelControl",
                                  "Multi Line File",
                                  6,
                                  0,
                                  expand=False)
    scriptDialog.AddSelectionControlToGrid("MultiLineFileBox",
                                           "MultiLineMultiFileBrowserControl",
                                           "", "All Files (*.*)", 6, 1)
    scriptDialog.EndGrid()

    scriptDialog.EndTabPage()
    scriptDialog.EndTabControl()

    scriptDialog.AddGrid()
    dialogButton = scriptDialog.AddControlToGrid("DialogButton",
                                                 "ButtonControl",
                                                 "Dialog",
                                                 0,
                                                 0,
                                                 expand=False)
    dialogButton.ValueModified.connect(DialogButtonPressed)
    popupButton = scriptDialog.AddControlToGrid("PopupButton",
                                                "ButtonControl",
                                                "Popup",
                                                0,
                                                1,
                                                expand=False)
    popupButton.ValueModified.connect(PopupButtonPressed)
    closeButton = scriptDialog.AddControlToGrid("CloseButton",
                                                "ButtonControl",
                                                "Close",
                                                0,
                                                2,
                                                expand=False)
    closeButton.ValueModified.connect(CloseButtonPressed)
    scriptDialog.AddHorizontalSpacerToGrid("DummySpacer1", 0, 3)
    scriptDialog.EndGrid()

    scriptDialog.ShowDialog(True)