nukescripts.panel_test

Package nukescripts :: Module panel_test |
[hide private]
[frames] | no frames]

# Source Code for Module nukescripts.panel_test

     1  # Copyright (c) 2009 The Foundry Visionmongers Ltd.  All Rights Reserved.
     2
     3  import nuke
     4
     5  singleLineInput = None
     6  filenameSearch = None
     7  clipnameSearch = None
     8  multilineTextInput = None
     9  notepad = None
    10  booleanCheckBox = None
    11  rgbColorChip = 0x0
    12  enumerationPulldown = "first second third"
    13  textFontPulldown = None
    14  expressionInput = "[python -eval 3*2]"
    15
    16 -def panel_example():
    17    p = nuke.Panel("Test Panel")
    18    p.addSingleLineInput("Single Line Input:", singleLineInput)
    19    p.addSingleLineInput("Second Line Input:", singleLineInput)
    20    p.addPasswordInput("Password Input:", singleLineInput)
    21    p.addFilenameSearch("Filename Search:", filenameSearch)
    22    p.addClipnameSearch("Clipname Search:", clipnameSearch)
    23    p.addMultilineTextInput("Multiline Text Input:", multilineTextInput)
    24    p.addNotepad("Notepad:", notepad)
    25    p.addBooleanCheckBox("Boolean Check Box:", booleanCheckBox)
    26    p.addRGBColorChip("RGB Color Chip:", rgbColorChip)
    27    p.addEnumerationPulldown("Enumeration Pulldown:", enumerationPulldown)
    28    p.addTextFontPulldown("Text Font Pulldown:", textFontPulldown)
    29    p.addExpressionInput("Expression Input:", expressionInput)
    30    p.addButton("Cancel")
    31    p.addButton("OK")
    32    result = p.show()
    33
    34    filenameVal= p.value("Filename Search:")
    35    if filenameVal is not None:
    36      print "filename:", filenameVal
    37
    38    colorVal = p.value("RGB Color Chip:")
    39    if colorVal is not None:
    40      print "rgbColorChip: ", hex(colorVal)
    41
    42    enumVal = p.value("Enumeration Pulldown:")
    43    if enumVal is not None:
    44      print "Enumeration Pulldown: ", enumVal
    45
    46    boolVal = p.value("Boolean Check Box:")
    47    if boolVal is not None:
    48      print "Boolean Check Box:", boolVal
    49
    50    textFontVal = p.value("Text Font Pulldown:")
    51    if textFontVal is not None:
    52      print "Text Font Pulldown:", textFontVal
    53
    54    exprVal = p.value("Expression Input:")
    55    if exprVal is not None:
    56      print "Expression Input:", exprVal
    57