def create( layout ) : print 'Creating Script Editor' container = pm.paneLayout( configuration='horizontal2', p=layout ) top_layout = pm.verticalLayout( p=container ) bottom_layout = pm.verticalLayout( p=container ) cmdreporter = pm.cmdScrollFieldReporter( p=top_layout ) cmdexecuter = pm.cmdScrollFieldExecuter( sourceType='python', sln=True, bgc=(0.2,0.2,0.2), p=bottom_layout ) top_layout.redistribute() bottom_layout.redistribute() return container
def create(layout): print 'Creating Script Editor' container = pm.paneLayout(configuration='horizontal2', p=layout) top_layout = pm.verticalLayout(p=container) bottom_layout = pm.verticalLayout(p=container) cmdreporter = pm.cmdScrollFieldReporter(p=top_layout) cmdexecuter = pm.cmdScrollFieldExecuter(sourceType='python', sln=True, bgc=(0.2, 0.2, 0.2), p=bottom_layout) top_layout.redistribute() bottom_layout.redistribute() return container
def dock(mainWindow): """ Show dockable window args mainWindow : QtGui.QMainWindow return None """ mainWindow.setObjectName('sampleWindowObject') DOCK_NAME = "dock_name" from pymel import all as pm if pm.dockControl(DOCK_NAME, q=True, ex=1): pm.deleteUI(DOCK_NAME) if pm.window('dummyWindow', q=True, ex=1): pm.deleteUI('dummyWindow') # Create dummy window object to keep the layout pm.window('dummyWindow') pm.columnLayout() floatingLayout = pm.paneLayout( configuration='single', w=300) pm.setParent('..') # Create new dock pm.dockControl( DOCK_NAME, aa=['right', 'left'], a='right', fl=False, con=floatingLayout, label="Sample Dock", w=300) # Parent QMainWindow object to the layout pm.control('sampleWindowObject', e=True, parent=floatingLayout)
def main(dock=False): """ main """ global checkerWin try: checkerWin.close() except: pass sel = cmds.ls(sl=True, long=True) if len(sel) == 0: sel = "" else: sel = sel[0] checkerWin = ModelChecker(sel) checkerWin.setObjectName("checker_mainWindow") if dock is True: from pymel import all as pm if pm.dockControl('model_checker_dock', q=True, ex=1): pm.deleteUI('model_checker_dock') floatingLayout = pm.paneLayout(configuration='single', w=700) pm.dockControl( 'model_checker_dock', aa=['right', 'left'], a='right', fl=False, con=floatingLayout, label="Model Checker", w=300) pm.control('checker_mainWindow', e=True, parent=floatingLayout) else: checkerWin.show() checkerWin.raise_()
def dock(mainWindow): """ Show dockable window args mainWindow : QtWidgets.QMainWindow return None """ mainWindow.setObjectName('sampleWindowObject') DOCK_NAME = "dock_name" from pymel import all as pm if pm.dockControl(DOCK_NAME, q=True, ex=1): pm.deleteUI(DOCK_NAME) if pm.window('dummyWindow', q=True, ex=1): pm.deleteUI('dummyWindow') # Create dummy window object to keep the layout pm.window('dummyWindow') pm.columnLayout() floatingLayout = pm.paneLayout(configuration='single', w=300) pm.setParent('..') # Create new dock pm.dockControl(DOCK_NAME, aa=['right', 'left'], a='right', fl=False, con=floatingLayout, label="Sample Dock", w=300) # Parent QMainWindow object to the layout pm.control('sampleWindowObject', e=True, parent=floatingLayout)
def main(dock=False): """ main """ global checkerWin try: checkerWin.close() except: pass sel = cmds.ls(sl=True, long=True) if len(sel) == 0: sel = "" else: sel = sel[0] checkerWin = ModelChecker(sel) checkerWin.setObjectName("checker_mainWindow") if dock is True: from pymel import all as pm if pm.dockControl('model_checker_dock', q=True, ex=1): pm.deleteUI('model_checker_dock') floatingLayout = pm.paneLayout(configuration='single', w=700) pm.dockControl('model_checker_dock', aa=['right', 'left'], a='right', fl=False, con=floatingLayout, label="Model Checker", w=300) pm.control('checker_mainWindow', e=True, parent=floatingLayout) else: checkerWin.show() checkerWin.raise_()
def create(): global TH_P_WIDGETS init() layerchannel.cleanup() if (pm.dockControl(TH_P_DOCK, exists=True)): pm.deleteUI(TH_P_DOCK) if (pm.window(TH_P_WIN, exists=True)): pm.deleteUI(TH_P_WIN) TH_P_WIDGETS['window'] = pm.window(TH_P_WIN) TH_P_WIDGETS['main'] = pm.paneLayout(configuration='vertical3', staticWidthPane=1) TH_P_WIDGETS['tabs'] = pm.tabLayout(p=TH_P_WIDGETS['main'], width=274, height=100) TH_P_WIDGETS['column1'] = pm.verticalLayout(p=TH_P_WIDGETS['main'], height=100) TH_P_WIDGETS['column2'] = pm.verticalLayout(p=TH_P_WIDGETS['main']) # tabs ########################################################################################## # shelves TH_P_WIDGETS['tab_shelves'] = pm.verticalLayout(p=TH_P_WIDGETS['tabs']) TH_P_WIDGETS['tabs'].setTabLabel((TH_P_WIDGETS['tab_shelves'], 'Shelves')) shelves.create(TH_P_WIDGETS['tab_shelves']) TH_P_WIDGETS['tab_shelves'].redistribute() # renaming TH_P_WIDGETS['tab_renaming'] = pm.verticalLayout(p=TH_P_WIDGETS['tabs']) renaming.create(TH_P_WIDGETS['tab_renaming']) TH_P_WIDGETS['tabs'].setTabLabel( (TH_P_WIDGETS['tab_renaming'], 'Renaming')) TH_P_WIDGETS['tab_renaming'].redistribute() # script editor TH_P_WIDGETS['tab_scripteditor'] = pm.verticalLayout( p=TH_P_WIDGETS['tabs']) TH_P_WIDGETS['tabs'].setTabLabel( (TH_P_WIDGETS['tab_scripteditor'], 'Script Editor')) scripteditor.create(TH_P_WIDGETS['tab_scripteditor']) TH_P_WIDGETS['tab_scripteditor'].redistribute() """ # column1 ########################################################################################## # layer editor / channel box TH_P_WIDGETS[ 'channellayer' ] = pm.verticalLayout( p=TH_P_WIDGETS[ 'column1' ] ) layerchannel.create( TH_P_WIDGETS[ 'channellayer' ] ) TH_P_WIDGETS[ 'channellayer' ].redistribute() # column2 ########################################################################################## # outliner TH_P_WIDGETS[ 'outliner' ] = pm.verticalLayout( p=TH_P_WIDGETS[ 'column2' ] ) outliner.create( TH_P_WIDGETS[ 'outliner' ] ) TH_P_WIDGETS[ 'outliner' ].redistribute() TH_P_WIDGETS[ 'tabs' ].setSelectTabIndex( 1 ) TH_P_WIDGETS[ 'column1' ].redistribute() TH_P_WIDGETS[ 'column2' ].redistribute() """ TH_P_WIDGETS['dock_panel'] = pm.dockControl(TH_P_DOCK, label='th_panel', area='right', allowedArea=['left', 'right'], sizeable=True, w=540, content=TH_P_WIDGETS['window'])
def create() : global TH_P_WIDGETS init() layerchannel.cleanup() if( pm.dockControl( TH_P_DOCK, exists=True ) ) : pm.deleteUI( TH_P_DOCK ) if( pm.window( TH_P_WIN, exists=True ) ) : pm.deleteUI( TH_P_WIN ) TH_P_WIDGETS[ 'window' ] = pm.window( TH_P_WIN ) TH_P_WIDGETS[ 'main' ] = pm.paneLayout( configuration='vertical3', staticWidthPane=1, paneSize=(3, 0, 100) ) TH_P_WIDGETS[ 'tabs' ] = pm.tabLayout( p=TH_P_WIDGETS[ 'main' ], width=274, height=100 ) TH_P_WIDGETS[ 'column1' ] = pm.verticalLayout( p=TH_P_WIDGETS[ 'main' ], width=100, height=100 ) TH_P_WIDGETS[ 'column2' ] = pm.verticalLayout( p=TH_P_WIDGETS[ 'main' ], width=10 ) # tabs ########################################################################################## # shelves TH_P_WIDGETS[ 'tab_shelves' ] = pm.verticalLayout( p=TH_P_WIDGETS['tabs'] ) TH_P_WIDGETS[ 'tabs' ].setTabLabel( ( TH_P_WIDGETS[ 'tab_shelves' ], 'Shelves' ) ) shelves.create( TH_P_WIDGETS[ 'tab_shelves' ] ) TH_P_WIDGETS[ 'tab_shelves' ].redistribute() # renaming TH_P_WIDGETS[ 'tab_renaming' ] = pm.verticalLayout( p=TH_P_WIDGETS['tabs'] ) renaming.create( TH_P_WIDGETS[ 'tab_renaming' ] ) TH_P_WIDGETS[ 'tabs' ].setTabLabel( ( TH_P_WIDGETS[ 'tab_renaming' ], 'Renaming' ) ) TH_P_WIDGETS[ 'tab_renaming' ].redistribute() # script editor TH_P_WIDGETS[ 'tab_scripteditor' ] = pm.verticalLayout( p=TH_P_WIDGETS['tabs'] ) TH_P_WIDGETS[ 'tabs' ].setTabLabel( ( TH_P_WIDGETS[ 'tab_scripteditor' ], 'Script Editor' ) ) scripteditor.create( TH_P_WIDGETS[ 'tab_scripteditor' ] ) TH_P_WIDGETS[ 'tab_scripteditor' ].redistribute() # column1 ########################################################################################## # layer editor / channel box TH_P_WIDGETS[ 'channellayer' ] = pm.verticalLayout( p=TH_P_WIDGETS[ 'column1' ] ) layerchannel.create( TH_P_WIDGETS[ 'channellayer' ] ) TH_P_WIDGETS[ 'channellayer' ].redistribute() # column2 ########################################################################################## # outliner TH_P_WIDGETS[ 'outliner' ] = pm.verticalLayout( p=TH_P_WIDGETS[ 'column2' ] ) outliner.create( TH_P_WIDGETS[ 'outliner' ] ) TH_P_WIDGETS[ 'outliner' ].redistribute() TH_P_WIDGETS[ 'tabs' ].setSelectTabIndex( 1 ) TH_P_WIDGETS[ 'column1' ].redistribute() TH_P_WIDGETS[ 'column2' ].redistribute() TH_P_WIDGETS[ 'dock_panel' ] = pm.dockControl( TH_P_DOCK, label='th_panel', area='right', allowedArea=[ 'left', 'right' ], sizeable=True, w=540, content=TH_P_WIDGETS[ 'window' ] )