本文整理汇总了Python中maya.cmds.dockControl函数的典型用法代码示例。如果您正苦于以下问题:Python dockControl函数的具体用法?Python dockControl怎么用?Python dockControl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dockControl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self) :
#check to see if the window exists:
if cmds.window("Box2DTool", exists = True):
cmds.deleteUI("Box2DTool")
#create the window:
window = cmds.window("Box2DTool", title = 'Box2D Tool', sizeable = False)
#create the main layout:
cmds.columnLayout(columnWidth = 300, adjustableColumn = False, columnAttach = ('both', 10))
#make dockable:
allowedAreas = ['right', 'left']
cmds.dockControl( 'Box2D Tool', area='left', content=window, allowedArea=allowedAreas )
self.dim=cmds.floatFieldGrp('dim', numberOfFields=2, label='Dimension', extraLabel='pixel', value1=5, value2=1 )
self.dim=cmds.floatFieldGrp('friction', numberOfFields=1, label='Friction', value1=0.2 )
self.dim=cmds.floatFieldGrp('restitution', numberOfFields=1, label='restitution', value1=0.0 )
self.dim=cmds.floatFieldGrp('density', numberOfFields=1, label='density', value1=0.0 )
cmds.separator()
self.dim=cmds.floatFieldGrp('rotation', numberOfFields=1, label='rotation', value1=0.0 )
cmds.separator()
cmds.optionMenuGrp( "bodyType",l='Body Type' )
cmds.menuItem(label='b2_staticBody');
cmds.menuItem(label='b2_kinematicBody');
cmds.menuItem(label='b2_dynamicBody');
cmds.button(label = "PlaceBlock", w = 100, h = 25, c = self.placeBlock)
cmds.separator()
cmds.button( label='Export', command=self.export )
示例2: open
def open():
'''
just a shortcut method to construct and display main window
'''
window = MainWindow.getInstance()
if cmds.control(MainWindow.DOCK_NAME,q=True,exists=True):
cmds.control(MainWindow.DOCK_NAME,e=True,visible=True)
else:
cmds.dockControl(MainWindow.DOCK_NAME,l=window.createWindowTitle(),content=MainWindow.WINDOW_NAME,
area='right',allowedArea=['right', 'left'],
width=window.preferedWidth.get(),
floating=window.preferedFloating.get(),
visibleChangeCommand=window.visibilityChanged)
if window.preferedFloating.get():
cmds.window(MainWindow.DOCK_NAME,e=True,
topEdge=window.preferedTop.get(),leftEdge=window.preferedLeft.get(),
w=window.preferedWidth.get(),h=window.preferedHeight.get())
Utils.silentCheckForUpdates()
# bring tab to front; evaluate lazily as sometimes UI can show other errors and this command somehow fails
cmds.evalDeferred(lambda *args: cmds.dockControl(MainWindow.DOCK_NAME,e=True,r=True));
# a bit of a fake, but can't find a better place for an infrequent save
LayerEvents.layerAvailabilityChanged.addHandler(window.savePrefs, MainWindow.DOCK_NAME)
return window
示例3: dock
def dock(window):
main_window = None
for obj in QtWidgets.qApp.topLevelWidgets():
if obj.objectName() == "MayaWindow":
main_window = obj
if not main_window:
raise ValueError("Could not find the main Maya window.")
# Deleting existing dock
print "Deleting existing dock..."
if self._dock:
self._dock.setParent(None)
self._dock.deleteLater()
if self._dock_control:
if cmds.dockControl(self._dock_control, query=True, exists=True):
cmds.deleteUI(self._dock_control)
# Creating new dock
print "Creating new dock..."
dock = Dock(parent=main_window)
dock_control = cmds.dockControl(label=window.windowTitle(), area="right",
visible=True, content=dock.objectName(),
allowedArea=["right", "left"])
dock.layout().addWidget(window)
self._dock = dock
self._dock_control = dock_control
示例4: vrayReUI
def vrayReUI():
if cmds.dockControl('vrayRendElem', exists=True):
cmds.deleteUI('vrayRendElem', ctl=True)
awVrayRETools = cmds.loadUI (f = 'Q:/Tools/maya/2012/scripts/python/UI/awRenderElem.ui')
awVrayREPane = cmds.paneLayout (cn = 'single', parent = awVrayRETools)
awVrayDock = cmds.dockControl ( 'vrayRendElem',allowedArea = ("right","left"), area = "right", floating = False ,con = awVrayRETools, label = 'Render Element tools')
vrayUpdateUI()
示例5: win
def win(self,**kwargs):
if mc.window(self.window,ex=True):mc.deleteUI(self.window,window=True)
if mc.dockControl(self.dock,ex=True):mc.deleteUI(self.dock)
#if mc.workspaceControl(self.dock,ex=True): mc.deleteUI(self.dock)
#mc.workspaceControl(self.dock,dockToPanel=['rcTools','left',1],label=self.name,floating=False)
mc.window(self.window,t=self.name,dc=['topLeft','bottomLeft'],w=350)#,nde=True
mc.formLayout(w=self.rowWidth)
mc.dockControl(self.dock,area='left',content=self.window,label=self.name,floating=False,**kwargs)
示例6: mainWindow
def mainWindow(configData, assetsList, modules):
layoutWidth = 450
#check if the window already exists, if it does delete it.
if cmds.window( 'pipeline', exists = True ):
cmds.deleteUI( 'pipeline' )
cmds.window( 'pipeline' )
# create the base layouts for the UI
form = cmds.formLayout( 'pipeline_mainFormLayout' )
tabs = cmds.tabLayout('pipeline_mainTabsLayout', innerMarginWidth=5, innerMarginHeight=5)
cmds.formLayout( form, edit=True, attachForm=((tabs, 'top', 0), (tabs, 'left', 0), (tabs, 'bottom', 0), (tabs, 'right', 0)) )
# tab one contents start here
tabOne = cmds.scrollLayout( horizontalScrollBarThickness=16, verticalScrollBarThickness=16)
cmds.rowColumnLayout( 'pipeline_TabOne', width = layoutWidth, numberOfColumns = 1 )
cmds.text( 'pipeline_tabOne_heading', label = 'manage pipline here' )
# use the module names to create the work flow catagories
for module in modules:
# becuase the name of hte module is a string, use __import__ method to import it.
currentModule = __import__(module)
reload(currentModule)
#based of the setting in config, create the module or not
if module + '=True' in configData:
currentModule.FMlayout(layoutWidth,configData,assetsList)
cmds.setParent( '..' )
if module + '=False' in configData:
currentModule.disabledMessage()
cmds.setParent('..'), cmds.setParent('..')
# tab two starts here, it contains the options from the config file
tabTwo = cmds.rowColumnLayout( width = layoutWidth, numberOfColumns = 1 )
#cmds.text( label = 'This is intenationally blank.' )
cmds.text( label = '' )
# loop over the config data, creating relevant checkboxes and textfields
for data in configData:
dataName, dataType, property = pipe_func.findDataType(data)
#print dataName
if dataType == 'booleanData':
if property == 'True':
propertyValue = True
if property == 'False':
propertyValue = False
cmds.checkBox( dataName + 'CB', label = dataName, value = propertyValue)
if dataType == 'string':
cmds.text( label = dataName )
cmds.textField( dataName + 'TF', text = property, width = (layoutWidth -100) )
# the save button goes here
cmds.button( label = 'Save settings', command = lambda arg : pipe_func.saveOptionsSettings(configData) )
cmds.setParent('..'), cmds.setParent('..')
# tab names
cmds.tabLayout( tabs, edit=True, tabLabel=((tabOne, 'pipeline'), (tabTwo, 'Options')) )
# This line docks the window as tool palette or utility window, so it sits nicey nice at the side
if cmds.dockControl( 'pipeline', exists = True ):
cmds.deleteUI( 'pipeline' )
cmds.dockControl( 'pipeline', label = 'Fire Monkeys Pipline Manager', area='right', content='pipeline', allowedArea='right' )
示例7: endLayout
def endLayout(self):
# cmds.window( gMainWindow, edit=True, widthHeight=(900, 777) )
if self.subdialog:
cmds.showWindow(self.winName)
elif self.dock:
allowedAreas = ["right", "left"]
cmds.dockControl(self.winName, l=self.title, area="left", content=self.winName, allowedArea=allowedAreas)
else:
cmds.showWindow(self.winName)
示例8: reset_screen
def reset_screen():
"""
Hide all main window docks.
"""
for name in config['WINDOW_RESET_DOCKS']:
try:
cmds.dockControl(name, e=True, vis=False)
except RuntimeError:
pass
示例9: open
def open():
global synoptic_window
synoptic_window = Synoptic(getMayaWindow())
synoptic_window.show()
if (cmds.dockControl('synoptic_dock', q=1, ex=1)):
cmds.deleteUI('synoptic_dock')
allowedAreas = ['right', 'left']
synoptic_dock = cmds.dockControl('synoptic_dock',aa=allowedAreas, a='left', content=SYNOPTIC_WIDGET_NAME, label='Synoptic View', w=350)
示例10: dockWindow
def dockWindow(window):
dWindow = "moduleManagerDockedWindow"
if cmds.dockControl(dWindow, exists=1):
cmds.deleteUI(dWindow)
formLayout = str(cmds.formLayout(parent=window))
cmds.dockControl(dWindow, allowedArea="all", content=formLayout, area="right", label=self.title)
cmds.control(window, p=formLayout, e=1, w=310)
cmds.setParent('..')
示例11: deleteDock
def deleteDock(self):
obscured = mc.dockControl('shotDock', q = True, io = True)
docked = mc.dockControl('shotDock', q = True, fl = True)
if obscured and not docked:
try:
mc.evalDeferred("mc.deleteUI('shotDock')")
print "Cleared Dock"
except:
pass
示例12: moveDock
def moveDock(self): # Update dock location information
if cmds.dockControl(self.GUI['dock'], q=True, fl=True):
self.setLocation("float")
self.purgeGUI()
self.buildFloatLayout()
else:
area = cmds.dockControl(self.GUI['dock'], q=True, a=True)
self.setLocation(area)
self.purgeGUI()
self.buildDockLayout()
示例13: __init__
def __init__(self):
if mc.layout(self.layoutname, query=True, exists=True) == True:
mc.deleteUI(self.layoutname, lay=True)
if mc.layout(self.layoutname, query=True, exists=True) != True:
self.windowName = mc.loadUI(f=self._UI_File)
mc.showWindow(self.windowName)
allowedAreas = ['right', 'left']
self.layout=mc.dockControl(area='right', content=self.windowName, l='SP_2012', w=390, h=490, allowedArea=allowedAreas)
self.layoutname=mc.dockControl(self.layout,q=1,fpn=1)
示例14: __init__
def __init__(self, dock = False):
self.window = mc.window(title = "Task Info", width = 420, height = 600)
mc.setParent(self.window)
mc.columnLayout(adjustableColumn=True)
if dock:
mc.dockControl(l = "Import Asset", area = 'right', content = self.window, allowedArea = ['right', 'left'] )
else:
mc.showWindow(self.window)
示例15: savePrefs
def savePrefs(self):
if cmds.dockControl(MainWindow.DOCK_NAME,exists=True):
self.preferedFloating.set(cmds.dockControl(MainWindow.DOCK_NAME,q=True,floating=True))
self.preferedWidth.set(cmds.dockControl(MainWindow.DOCK_NAME,q=True,w=True))
if cmds.window(MainWindow.DOCK_NAME,exists=True):
self.preferedWidth.set(cmds.window(MainWindow.DOCK_NAME,q=True,w=True))
self.preferedHeight.set(cmds.window(MainWindow.DOCK_NAME,q=True,h=True))
self.preferedTop.set(cmds.window(MainWindow.DOCK_NAME,q=True,topEdge=True))
self.preferedLeft.set(cmds.window(MainWindow.DOCK_NAME,q=True,leftEdge=True))