当前位置: 首页>>代码示例>>Python>>正文


Python cmds.dockControl函数代码示例

本文整理汇总了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 )
开发者ID:NCCA,项目名称:Box2DExport,代码行数:32,代码来源:Box2DTool.py

示例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
开发者ID:leandropim,项目名称:Tapp,代码行数:30,代码来源:mainwindow.py

示例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
开发者ID:tokejepsen,项目名称:pyblish-maya,代码行数:31,代码来源:lib.py

示例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()
开发者ID:ghost3d,项目名称:MayaTools,代码行数:7,代码来源:awVrayRenderElementHelper.py

示例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)
开发者ID:RobRuckus,项目名称:rcTools,代码行数:8,代码来源:rcMaya.py

示例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' )
开发者ID:ALstair,项目名称:styleExample,代码行数:58,代码来源:pipeline_mainWindow.py

示例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)
开发者ID:mcellteam,项目名称:gamer,代码行数:9,代码来源:mayaUI.py

示例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
开发者ID:arubertoson,项目名称:maya-mamprefs,代码行数:9,代码来源:layouts.py

示例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)
开发者ID:AtonLerin,项目名称:mgear,代码行数:9,代码来源:__init__.py

示例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('..')
开发者ID:Phoenyx,项目名称:TruemaxScriptPackage,代码行数:9,代码来源:manager.py

示例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            
开发者ID:sid2364,项目名称:Maya_Python,代码行数:9,代码来源:shotManager_Toonz_New.py

示例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()
开发者ID:internetimagery,项目名称:daily_pose,代码行数:10,代码来源:__init__.py

示例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)
开发者ID:wildparky,项目名称:spielenPipeline,代码行数:10,代码来源:model.py

示例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)
开发者ID:akoon,项目名称:OldPipeline,代码行数:10,代码来源:pipeline.py

示例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))
开发者ID:leandropim,项目名称:Tapp,代码行数:10,代码来源:mainwindow.py


注:本文中的maya.cmds.dockControl函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。