當前位置: 首頁>>代碼示例>>Python>>正文


Python nukescripts.PythonPanel方法代碼示例

本文整理匯總了Python中nukescripts.PythonPanel方法的典型用法代碼示例。如果您正苦於以下問題:Python nukescripts.PythonPanel方法的具體用法?Python nukescripts.PythonPanel怎麽用?Python nukescripts.PythonPanel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nukescripts的用法示例。


在下文中一共展示了nukescripts.PythonPanel方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import nukescripts [as 別名]
# 或者: from nukescripts import PythonPanel [as 別名]
def __init__(self):
        nukescripts.PythonPanel.__init__(self, 'Shotgun notes', 'mlavoy')
        # CREATE KNOBS
        #open page in shotgun
        self.openShotgunButton= nuke.PyScript_Knob('openShotgun','openShotgun')
        #button for getting notes
        self.getNotesButton= nuke.PyScript_Knob('getNotes','getNotes')
        #update shotgun note status
        self.updateShotgunButton= nuke.PyScript_Knob('updateShotgun','updateShotgun')

        # ADD KNOBS
        self.addKnob(self.openShotgunButton)
        self.addKnob(self.getNotesButton)
        self.addKnob(self.updateShotgunButton)
        self.addKnob(nuke.Text_Knob('Notes','Notes'))
        self.notes=[]
        self.checkKnobs={} 
開發者ID:mlavoy,項目名稱:nukeScripts,代碼行數:19,代碼來源:addSGnotes.py

示例2: getAssets

# 需要導入模塊: import nukescripts [as 別名]
# 或者: from nukescripts import PythonPanel [as 別名]
def getAssets():
    selectedAssets=[]
    class TestPanel(nukescripts.PythonPanel):
        def __init__(self):
            super(TestPanel,self).__init__('select assetGizmos to import' )

            #list of assets
            assets=os.listdir(assetGizmos)
            assets.sort()
            for asset in assets:
                b=nuke.Boolean_Knob(asset)
                b.setFlag(nuke.STARTLINE)
                self.addKnob(b) 
            self._makeOkCancelButton()

        
    p = TestPanel()
    result=p.showModalDialog()

    if result:
        for k in p.knobs():
            if p.knobs()[k].Class()=='Boolean_Knob':
                if p.knobs()[k].value():
                    selectedAssets.append(k)
    return selectedAssets 
開發者ID:mlavoy,項目名稱:nukeScripts,代碼行數:27,代碼來源:findMissingAssetGizmos_forceManual.py

示例3: __init__

# 需要導入模塊: import nukescripts [as 別名]
# 或者: from nukescripts import PythonPanel [as 別名]
def __init__( self ):
        nukescripts.PythonPanel.__init__( self, 'Shot assembler', 'panel')
        self.reel = nuke.String_Knob("REEL","REEL","REEL_01")
        self.addKnob(self.reel)
        self.seq = nuke.String_Knob("SEQ","SEQ","010")
        self.addKnob(self.seq)
        self.shot = nuke.String_Knob("SHOT","SHOT","010")
        self.addKnob(self.shot)

        self.push = nuke.PyScript_Knob("ASSEMBLE","ASSEMBLE")
        self.addKnob(self.push) 
開發者ID:kiryha,項目名稱:AnimationDNA,代碼行數:13,代碼來源:shotAssembler.py

示例4: ShowDialog

# 需要導入模塊: import nukescripts [as 別名]
# 或者: from nukescripts import PythonPanel [as 別名]
def ShowDialog( self ):
		return nukescripts.PythonPanel.showModalDialog( self ) 
開發者ID:mlavoy,項目名稱:nukeScripts,代碼行數:4,代碼來源:SubmitNukeToDeadline_projectManager.py

示例5: __init__

# 需要導入模塊: import nukescripts [as 別名]
# 或者: from nukescripts import PythonPanel [as 別名]
def __init__( self, nodes ):
        nukescripts.PythonPanel.__init__( self, 'adjust all Knobs' )

        if not nodes:
            nuke.message('Nothing selected')
            return
        #GET KNOBS
        commonKnobNames=nodes[0].knobs()
        for n in nodes:
            commonKnobNames=set(commonKnobNames).intersection(n.knobs())
        commonKnobNames=set(commonKnobNames)
        print commonKnobNames
        commonKnobs=[]
        for ck in commonKnobNames:
            commonKnobs.append(nodes[0][ck])
        #ADD KNOBS
        availKnobs=[ 'ChannelMask_Knob','File_Knob', 'String_Knob', 'Int_Knob', 'Format_Knob', 'Tab_Knob', 'Script_Knob', 'PyScript_Knob', 'Text_Knob', 'WH_Knob', 'BBox_Knob', 'XYZ_Knob', 'Double_Knob', 'IArray_Knob', 'XY_Knob', 'Transform2d_Knob', 'MultiView_Knob', 'AColor_Knob', 'FrameExtentKnob', 'Menu_Knob', 'UV_Knob', 'Axis_Knob', 'Scale_Knob', 'MetaKeyFrame_Knob', 'RotoToolboxKnob', 'Radio_Knob', 'RotoKnob', 'Pulldown_Knob', 'LookupCurves_Knob', 'Color_Knob','Channel_Knob',  'Array_Knob', 'Boolean_Knob','GeoSelect_Knob', 'MultiArray_Knob','Multiline_Eval_String_Knob','Eval_String_Knob','Disable_Knob']
        omit=['icon','knobChanged','name','xpos','ypos','dopesheet','selected','note_font_size','indicators','matrix']
        exist=[]
        for ak in availKnobs:
            for knob in commonKnobs:
                k=''
                if knob.Class()==ak and not knob.name() in omit and knob.visible()  and not knob.name() in exist:
                    methodToCall = getattr(nuke,ak)
                    k=methodToCall(knob.name(),knob.name())
                    k.setName(knob.name())
                    print knob.name(),knob.value()
                    k.setValue(knob.value())
                    #print k.name(),knob.Class()
                if knob.Class()=='Enumeration_Knob' and not knob.name() in exist:
                    k=nuke.Enumeration_Knob(knob.name(),knob.name(),knob.values())
                    k.setName(knob.name())
                    k.setValue(knob.value())     
                if k:
                    print knob.name(),knob.Class()
                    self.addKnob(k)
                    k.setFlag(nuke.STARTLINE)
                    exist.append(knob.name()) 
開發者ID:mlavoy,項目名稱:nukeScripts,代碼行數:40,代碼來源:changeCommonKnobs.py

示例6: checkMultiOverwrite

# 需要導入模塊: import nukescripts [as 別名]
# 或者: from nukescripts import PythonPanel [as 別名]
def checkMultiOverwrite(file_names):
    """Asks the user if they want to overwrite an individual file, and supplies a "yes/no to all" box.
    
    If one or fewer file names is supplied, the dialog is skipped entirely.  Callers of this function
    will still need to check for files that are not in this set in case the underlying file system
    changes while the dialog is visible.
    @rtype:  (set(str), set(str))
    @return: A set of the file names to overwrite, and a set of those to leave
    @raise:  CancelledError if the user cancelled the operation
    """
    import nukescripts
    class OverwritePanel(nukescripts.PythonPanel):
        def __init__(self, file_names):
            super(OverwritePanel, self).__init__()
            self.text = nuke.Text_Knob('name', '', 'Overwrite files?')
            self.all = nuke.Boolean_Knob('all', 'check/uncheck all', True)
            self.all.setFlag(nuke.ENDLINE)
            self.div = nuke.Text_Knob('divider', '')
            self.file_knobs = []
            for fname in file_names:
                name = os.path.split(fname)[1]
                fknob = nuke.Boolean_Knob(fname, name, True)
                fknob.setFlag(nuke.ENDLINE)
                self.file_knobs.append(fknob)
            knobs = [self.text, self.all, self.div]
            knobs.extend(self.file_knobs)
            [self.addKnob(k) for k in knobs]
        def knobChanged(self, knob):
            if knob.name() == 'all':
                val = knob.value()
                [fknob.setValue(val) for fknob in self.file_knobs]
    
    # Don't do anything if there are one or fewer files
    if len(file_names) < 2:
        return set(), set()
    
    panel = OverwritePanel(file_names)
    if not panel.showModalDialog():
        raise CancelledError("Overwrite cancelled")
    overwrites = set()
    leaves = set()
    for fknob in panel.file_knobs:
        if fknob.value():
            overwrites.add(fknob.name())
        else:
            leaves.add(fknob.name())
    return overwrites, leaves

#------------------------------------------------------------------------------- 
開發者ID:geoffroygivry,項目名稱:CyclopsVFX-Unity,代碼行數:51,代碼來源:mari_bridge.py

示例7: __init__

# 需要導入模塊: import nukescripts [as 別名]
# 或者: from nukescripts import PythonPanel [as 別名]
def __init__(self, sequences):
        nukescripts.PythonPanel.__init__(self, 'Batch Renamer')

        self.seqs = sequences.values()

        # Try to set our window size based on our contents
        self.height = 270 + (len(self.seqs) * 40)
        self.length = 400
        for s in self.seqs:
            if 130 + len(s) * 7 > self.length:
                self.length = 130 + len(s) * 7
        self.setMinimumSize(self.length, self.height)

        # Create our header
        self.addKnob(nuke.Text_Knob('break', ''))
        self.addKnob(nuke.Text_Knob('header', 'Files to be modified:', ' '))

        # Dynamically add our source filepath text
        c = 1
        for s in self.seqs:
            self.addKnob(nuke.Text_Knob(str(c), '', s))
            c += 1

        # Create a string knob for our "Find" field
        self.addKnob(nuke.Text_Knob('break', ''))
        self.addKnob(nuke.String_Knob('find', 'Find this:', ''))

        # Dynamically add our preview "Find" text
        c = 1
        self.original_finds = {}
        for s in self.seqs:
            self.addKnob(nuke.Text_Knob('previewFind%s' % c, '', os.path.basename(s)))
            self.original_finds['previewFind%s' % c] = os.path.basename(s)
            c += 1

        # Create a string knob for our "Replace" field
        self.addKnob(nuke.Text_Knob('break', '', ' '))
        self.addKnob(nuke.String_Knob('replace', 'Replace with:', ''))

        # Dynamically add our preview "Replace" text
        c = 1
        self.original_replaces = {}
        for s in self.seqs:
            self.addKnob(nuke.Text_Knob('previewReplace%s' % c, '', os.path.basename(s)))
            self.original_replaces['previewReplace%s' % c] = os.path.basename(s)
            c += 1

        # Finally, create some dividers for the footer
        self.addKnob(nuke.Text_Knob('break', ''))
        self.addKnob(nuke.Text_Knob('break', '', ' ')) 
開發者ID:Kagarrache,項目名稱:nuke,代碼行數:52,代碼來源:batchrenamer.py

示例8: __init__

# 需要導入模塊: import nukescripts [as 別名]
# 或者: from nukescripts import PythonPanel [as 別名]
def __init__(self, fullFilePath, rename):
    
    self.rename = rename
    self.fullFilePath = fullFilePath

    if rename == False:
      self.namePanel = 'Create ToolSet'
      self.nameOkButton = 'Create'
    else:
      self.namePanel = 'Rename ToolSet'
      self.nameOkButton = 'Rename'
    
    nukescripts.PythonPanel.__init__( self, self.namePanel, 'uk.co.thefoundry.Toolset')
    
    # CREATE KNOBS
    self.userFolders = []
    fullPath = SHARED_TOOLSET_PATH
    self.buildFolderList(fullPath, '')


    self.menuItemChoice = nuke.CascadingEnumeration_Knob('menuItemChoice','SharedToolSets menu', ['root'] + self.userFolders )
    self.menuItemChoice.setTooltip("The menu location that the ToolSet will appear in. Specify 'root' to place the SharedToolSets in the main SharedToolSets menu.")
    self.menuPath = nuke.String_Knob('itemName', 'Menu item:')
    self.menuPath.setFlag(0x00001000)  
    self.menuPath.setTooltip("ToolSet name. Use the '/' character to create a new submenu for this ToolSet, eg to create a ToolSet named 'Basic3D' and place it in a new submenu '3D', type '3D/Basic3D'. Once created the 3D menu will appear in the ToolSet menu.")
    self.okButton = nuke.PyScript_Knob (self.nameOkButton.lower(), self.nameOkButton)
    #self.okButton.setToolTip("Create a ToolSet from the currently selected nodes with the given name")
    self.okButton.setFlag(0x00001000)
    self.cancelButton = nuke.PyScript_Knob ('cancel', 'Cancel')
    self.space = nuke.Text_Knob("space", "", "")
    self.infoText = nuke.Text_Knob('infoText', '<span style="color:orange">/ - create submenus,</span>',  '<span style="color:orange">example: newMenu/myNewToolSet</span>')

    # ADD KNOBS
    self.addKnob(self.menuItemChoice)
    self.addKnob(self.menuPath)
    self.addKnob(self.okButton)
    self.addKnob(self.cancelButton)
    self.addKnob(self.space)
    self.addKnob(self.infoText)

    if rename == True:
      toolSetPath = fullFilePath.replace(SHARED_TOOLSET_PATH + "/", '') 
      toolSetPath = toolSetPath.replace(".nk", '') 
      self.menuPath.setValue(toolSetPath)

  #COMMENT:  BUILD A LIST Of PRE_CREATED FOLDER LOCATIONS 
開發者ID:greenvfx,項目名稱:shared_toolsets,代碼行數:48,代碼來源:shared_toolsets.py


注:本文中的nukescripts.PythonPanel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。