Ejemplo n.º 1
0
    def createShotManager(self):
        self.win = pm.window(title='SHOT MANAGER', w=300, h=200)
        form = pm.formLayout(numberOfDivisions=100)

        pane = pm.paneLayout(p=form, configuration='horizontal2')
        self.infoWidget = InfoWidget()
        self.infoWidget.createInfo(pane)
        self.infoWidget.putItemInfo(self.itemMData)
        self.compListWidget = ComponentListWidget()
        self.compListWidget.projectName = self.projectName
        self.compListWidget.createList(pane)

        b1 = pm.button(p=form,
                       label='Update',
                       h=40,
                       w=80,
                       c=self.updateCallback)
        b2 = pm.button(p=form, label='Close', h=40, w=80, c=self.closeCallback)

        pm.formLayout(form,
                      edit=True,
                      attachForm=[(pane, 'left', 5), (pane, 'top', 5),
                                  (pane, 'right', 5), (b1, 'left', 30),
                                  (b1, 'bottom', 5), (b2, 'right', 30),
                                  (b2, 'bottom', 5)],
                      attachControl=[(pane, 'bottom', 5, b1)],
                      attachPosition=[],
                      attachNone=())

        pm.showWindow(self.win)
        self.compListWidget.refreshList(itemMData=self.itemMData)
Ejemplo n.º 2
0
    def createAssetPrompt(self):
        form = pm.setParent(q=True)
        f = pm.formLayout(form, e=True, width=150)

        col2 = pm.columnLayout(p=f, adjustableColumn=True)
        nsField = pm.textFieldGrp('nsFieldPrompt', l='Name Space', tx='ref')
        refModeField = pm.optionMenuGrp(l='Assemble Mode')
        pm.menuItem(l='reference')
        pm.menuItem(l='cache')
        pm.menuItem(l='import')
        pm.menuItem(l='copy')
        pane = pm.paneLayout(p=col2,
                             configuration='top3',
                             ps=[(1, 20, 80), (2, 80, 80), (3, 100, 20)])
        folderTreeWidget = FolderTreeWidget()
        folderTreeWidget.createFolderTree(pane)
        folderTreeWidget.projectName = self.projectName
        folderTreeWidget.type = 'asset'
        folderTreeWidget.getFolderTree()

        itemListWidget = ItemListBase()
        itemListWidget.projectName = self.projectName
        itemListWidget.createList(pane)
        itemListWidget.refreshList(path=[], task=['uvs', 'rig'])

        infoWidget = InfoWidget()
        infoWidget.createInfo(pane)

        folderTreeWidget.itemListWidget = itemListWidget
        folderTreeWidget.itemListWidget.type = 'asset'
        folderTreeWidget.itemListWidget.task = ['uvs', 'rig']
        itemListWidget.infoWidget = infoWidget

        b1 = pm.button(p=f, l='Cancel', c='pm.layoutDialog( dismiss="Abort" )')
        b2 = pm.button(
            p=f,
            l='OK',
            c=lambda x: self.createAssetCallBack(itemListWidget.selectedItem))

        spacer = 5
        top = 5
        edge = 5
        pm.formLayout(form,
                      edit=True,
                      attachForm=[(col2, 'right', edge), (col2, 'top', top),
                                  (col2, 'left', edge), (b1, 'right', edge),
                                  (b1, 'bottom', edge), (b2, 'left', edge),
                                  (b2, 'bottom', edge)],
                      attachNone=[],
                      attachControl=[],
                      attachPosition=[(b1, 'right', spacer, 90),
                                      (b2, 'left', spacer, 10)])
Ejemplo n.º 3
0
    def createBrowser(self):
        win = pm.window(w=200)

        form = pm.formLayout(numberOfDivisions=100)
        col2 = pm.columnLayout(p=form, adjustableColumn=True)
        allowedAreas = ['right', 'left']
        pm.dockControl(label='BROWSER', w=200, area='left', content=win, allowedArea=allowedAreas)

        self.projectSelectWidget = ProjectSelectWidget()
        self.projectSelectWidget.createProjectSelect(col2)

        pm.rowLayout(nc=3, adj=1)
        self.typeOpt = pm.optionMenuGrp(label='Item Type', changeCommand=self.changeTypeCallback, cat=[[1,'left',5],[2,'left',-80]])
        types = ['asset', 'shot', 'model', 'uvs', 'texture', 'blendShape', 'rig', 'layout', 'animation',
                 'shotFinalizing', 'lightining', 'render']
        for assetType in types:
            pm.menuItem(label=assetType)

        pm.symbolButton(image=r'D:/JOBS/PIPELINE/pipeExemple/scenes/icons/small.png', c=lambda x, y=2: self.changeViewCallback(y))
        pm.symbolButton(image=r'D:/JOBS/PIPELINE/pipeExemple/scenes/icons/big.png', c=lambda x, y=1: self.changeViewCallback(y))

        pane = pm.paneLayout(p=form, configuration='top3', ps=[(1, 20, 80), (2, 80, 80), (3, 100, 20)], shp = 0)

        self.folderTreeWidget = FolderTreeWidget('asset')
        self.folderTreeWidget.createFolderTree(pane)
        self.folderTreeWidget.getFolderTree()

        self.itemListWidget = ItemListWidget()
        self.itemListWidget.createList(pane)
        self.itemListWidget.refreshList(path=[], task='asset')

        self.infoWidget = InfoWidget()
        self.infoWidget.createInfo(pane)

        self.folderTreeWidget.itemListWidget = self.itemListWidget
        self.folderTreeWidget.itemListWidget.type = 'asset'
        self.folderTreeWidget.itemListWidget.task = 'asset'
        self.projectSelectWidget.folderTreeWidget = self.folderTreeWidget
        self.projectSelectWidget.itemListWidget = self.itemListWidget
        self.itemListWidget.infoWidget = self.infoWidget

        pm.formLayout(form, edit=True,
                      attachForm=[(pane, 'left', 5), (pane, 'bottom', 5), (pane, 'right', 5),
                                  (col2, 'top', 5), (col2, 'left', 5), (col2, 'right', 5)],
                      attachControl=[(pane, 'top', 5, col2)],
                      attachPosition=[],
                      attachNone=()
                      )

        pm.showWindow()
Ejemplo n.º 4
0
        def createAssetPrompt(self):
            form = pm.setParent(q=True)
            f = pm.formLayout(form, e=True, width=150)

            col2 = pm.columnLayout(p=f, adjustableColumn=True)
            pane = pm.paneLayout(p=col2, configuration='top3', ps=[(1, 20, 80), (2, 80, 80), (3, 100, 20)])
            folderTreeWidget = FolderTreeWidget()
            print 'ok'
            folderTreeWidget.createFolderTree(pane)
            print 'ok2'
            folderTreeWidget.projectName = database.getCurrentProject()
            folderTreeWidget.type = 'asset'
            folderTreeWidget.getFolderTree()

            itemListWidget = ItemListBase()
            itemListWidget.projectName = database.getCurrentProject()
            itemListWidget.createList(pane)
            itemListWidget.refreshList(path=[], task='asset')

            infoWidget = InfoWidget()
            infoWidget.createInfo(pane)

            folderTreeWidget.itemListWidget = itemListWidget
            folderTreeWidget.itemListWidget.type = 'asset'
            folderTreeWidget.itemListWidget.task = 'asset'
            itemListWidget.infoWidget = infoWidget

            b1 = pm.button(p=f, l='Cancel', c='pm.layoutDialog( dismiss="Abort" )')
            b2 = pm.button(p=f, l='OK', c=lambda x: self.createAssetCallBack(itemListWidget.selectedItem))

            spacer = 5
            top = 5
            edge = 5
            pm.formLayout(form, edit=True,
                          attachForm=[(col2, 'right', edge), (col2, 'top', top), (col2, 'left', edge), (b1, 'right', edge),
                                      (b1, 'bottom', edge), (b2, 'left', edge), (b2, 'bottom', edge)], attachNone=[],
                          attachControl=[], attachPosition=[(b1, 'right', spacer, 90), (b2, 'left', spacer, 10)])
Ejemplo n.º 5
0
class ShotManager:
    def __init__(self, itemMData):
        self.itemMData = itemMData
        self.infoWidget = None
        self.compListWidget = None
        self.projectName = None

    def createShotManager(self):
        self.win = pm.window(title='SHOT MANAGER', w=300, h=200)
        form = pm.formLayout(numberOfDivisions=100)

        pane = pm.paneLayout(p=form, configuration='horizontal2')
        self.infoWidget = InfoWidget()
        self.infoWidget.createInfo(pane)
        self.infoWidget.putItemInfo(self.itemMData)
        self.compListWidget = ComponentListWidget()
        self.compListWidget.projectName = self.projectName
        self.compListWidget.createList(pane)

        b1 = pm.button(p=form,
                       label='Update',
                       h=40,
                       w=80,
                       c=self.updateCallback)
        b2 = pm.button(p=form, label='Close', h=40, w=80, c=self.closeCallback)

        pm.formLayout(form,
                      edit=True,
                      attachForm=[(pane, 'left', 5), (pane, 'top', 5),
                                  (pane, 'right', 5), (b1, 'left', 30),
                                  (b1, 'bottom', 5), (b2, 'right', 30),
                                  (b2, 'bottom', 5)],
                      attachControl=[(pane, 'bottom', 5, b1)],
                      attachPosition=[],
                      attachNone=())

        pm.showWindow(self.win)
        self.compListWidget.refreshList(itemMData=self.itemMData)

    def closeCallback(self, *args):
        pm.deleteUI(self.win)

    def updateCallback(self, *args):
        info = pm.fileInfo.keys()
        if 'code' in info and 'task' in info:
            code = pm.fileInfo['code']
            task = pm.fileInfo['task']

            if code and task:
                if code == self.itemMData['code'] and task == self.itemMData[
                        'task']:
                    check.sceneRefCheck(silent=True)
                    pm.deleteUI(self.win)
                    return

        resp = pm.confirmDialog(
            title='File not open',
            message='Do you want to open this file for updating?',
            button=['Open', "Don't Open", 'Cancel'],
            defaultButton='Save',
            cancelButton='Cancel',
            dismissString='Cancel')
        if resp == 'Open':
            version.open(task=self.itemMData['task'],
                         code=self.itemMData['code'],
                         type=self.itemMData['type'])
            check.sceneRefCheck(silent=True)
            pm.deleteUI(self.win)
Ejemplo n.º 6
0
    def createAssetPrompt(self):
        form = pm.setParent(q=True)
        f = pm.formLayout(form, e=True, width=150)
        col2 = pm.columnLayout(p=f, adjustableColumn=True)
        pm.rowLayout(nc=3, adj=1)
        self.typeOpt = pm.optionMenuGrp(label='Item Type',
                                        changeCommand=self.changeTypeCallback,
                                        cat=[[1, 'left', 5], [2, 'left', -80]])
        pm.menuItem(label='asset')
        pm.menuItem(label='shot')
        pm.menuItem(divider=True)
        typesAsset = database.getAllTasks('asset')
        for assetType in typesAsset:
            pm.menuItem(label=assetType)
        pm.menuItem(divider=True)
        typesShot = database.getAllTasks('shot')
        for assetType in typesShot:
            pm.menuItem(label=assetType)

        pm.symbolButton(
            image=r'D:/JOBS/PIPELINE/pipeExemple/scenes/icons/small.png',
            c=lambda x, y=2: self.changeViewCallback(y))
        pm.symbolButton(
            image=r'D:/JOBS/PIPELINE/pipeExemple/scenes/icons/big.png',
            c=lambda x, y=1: self.changeViewCallback(y))

        pane = pm.paneLayout(p=form,
                             configuration='top3',
                             ps=[(1, 20, 80), (2, 80, 80), (3, 100, 20)],
                             shp=0)

        self.folderTreeWidget = FolderTreeWidget('asset')
        self.folderTreeWidget.createFolderTree(pane)
        self.folderTreeWidget.getFolderTree()

        self.itemListWidget = ItemListWidget()
        self.itemListWidget.createList(pane)
        self.itemListWidget.refreshList(path=[], task='asset')

        self.infoWidget = InfoWidget()
        self.infoWidget.createInfo(pane)

        self.folderTreeWidget.itemListWidget = self.itemListWidget
        self.folderTreeWidget.itemListWidget.type = 'asset'
        self.folderTreeWidget.itemListWidget.task = 'asset'
        self.itemListWidget.infoWidget = self.infoWidget

        b1 = pm.button(p=f, l='Cancel', c='pm.layoutDialog( dismiss="Abort" )')
        b2 = pm.button(
            p=f,
            l='OK',
            c=lambda x: self.okCallback(self.itemListWidget.selectedItem))

        pm.formLayout(form,
                      edit=True,
                      attachForm=[(pane, 'left', 5), (pane, 'bottom', 5),
                                  (pane, 'right', 5), (col2, 'top', 5),
                                  (col2, 'left', 5), (col2, 'right', 5),
                                  (b1, 'right', 5), (b1, 'bottom', 5),
                                  (b2, 'left', 5), (b2, 'bottom', 5)],
                      attachControl=[(pane, 'top', 5, col2)],
                      attachPosition=[(b1, 'right', 5, 90),
                                      (b2, 'left', 5, 10)],
                      attachNone=())
Ejemplo n.º 7
0
class itemBrowser:
    def __init__(self):
        self.projectSelectWidget = None
        self.folderTreeWidget = None
        self.itemListWidget = None
        self.infoWidget = None
        self.createBrowser()
        self.typeOpt = None

    def createBrowser(self):
        win = pm.window(w=200)

        form = pm.formLayout(numberOfDivisions=100)
        col2 = pm.columnLayout(p=form, adjustableColumn=True)
        allowedAreas = ['right', 'left']
        pm.dockControl(label='BROWSER',
                       w=200,
                       area='left',
                       content=win,
                       allowedArea=allowedAreas)

        self.projectSelectWidget = ProjectSelectWidget()
        self.projectSelectWidget.createProjectSelect(col2)

        pm.rowLayout(nc=3, adj=1)
        self.typeOpt = pm.optionMenuGrp(label='Item Type',
                                        changeCommand=self.changeTypeCallback,
                                        cat=[[1, 'left', 5], [2, 'left', -80]])
        pm.menuItem(label='asset')
        pm.menuItem(label='shot')
        pm.menuItem(divider=True)
        typesAsset = database.getAllTasks('asset')
        for assetType in typesAsset:
            pm.menuItem(label=assetType)
        pm.menuItem(divider=True)
        typesShot = database.getAllTasks('shot')
        for assetType in typesShot:
            pm.menuItem(label=assetType)

        pm.symbolButton(
            image=r'D:/JOBS/PIPELINE/pipeExemple/scenes/icons/small.png',
            c=lambda x, y=2: self.changeViewCallback(y))
        pm.symbolButton(
            image=r'D:/JOBS/PIPELINE/pipeExemple/scenes/icons/big.png',
            c=lambda x, y=1: self.changeViewCallback(y))

        pane = pm.paneLayout(p=form,
                             configuration='top3',
                             ps=[(1, 20, 80), (2, 80, 80), (3, 100, 20)],
                             shp=0)

        self.folderTreeWidget = FolderTreeWidget('asset')
        self.folderTreeWidget.createFolderTree(pane)
        self.folderTreeWidget.getFolderTree()

        self.itemListWidget = ItemListWidget()
        self.itemListWidget.createList(pane)
        self.itemListWidget.refreshList(path=[], task='asset')

        self.infoWidget = InfoWidget()
        self.infoWidget.createInfo(pane)

        self.folderTreeWidget.itemListWidget = self.itemListWidget
        self.folderTreeWidget.itemListWidget.type = 'asset'
        self.folderTreeWidget.itemListWidget.task = 'asset'
        self.projectSelectWidget.folderTreeWidget = self.folderTreeWidget
        self.projectSelectWidget.itemListWidget = self.itemListWidget
        self.itemListWidget.infoWidget = self.infoWidget

        pm.formLayout(form,
                      edit=True,
                      attachForm=[(pane, 'left', 5), (pane, 'bottom', 5),
                                  (pane, 'right', 5), (col2, 'top', 5),
                                  (col2, 'left', 5), (col2, 'right', 5)],
                      attachControl=[(pane, 'top', 5, col2)],
                      attachPosition=[],
                      attachNone=())

        pm.showWindow()

    def changeTypeCallback(self, newTaskToSearch, *args):
        assetType = database.getTaskType(newTaskToSearch)

        self.itemListWidget.type = assetType

        self.folderTreeWidget.type = assetType
        self.folderTreeWidget.getFolderTree()

        self.itemListWidget.task = newTaskToSearch
        self.itemListWidget.refreshList(path=self.itemListWidget.path,
                                        task=self.itemListWidget.task)

    def changeViewCallback(self, opt):
        self.itemListWidget.viewOption = opt
        self.itemListWidget.refreshList(path=self.itemListWidget.path,
                                        task=self.itemListWidget.task)