Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/349.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Maya Python中更改文本的位置_Python_User Interface_Maya - Fatal编程技术网

如何在Maya Python中更改文本的位置

如何在Maya Python中更改文本的位置,python,user-interface,maya,Python,User Interface,Maya,我正在使用python在maya中制作gui,但我在这方面是新手,我不知道如何使用python更改maya中文本的位置 代码: import maya.cmds as cmds # Make a new window window = cmds.window( title="Render", iconName='BTD', widthHeight= (500,500),titleBar=True,minimizeButton=True,maximizeButton=True ) cmds.c

我正在使用python在maya中制作gui,但我在这方面是新手,我不知道如何使用python更改maya中文本的位置

代码:

import maya.cmds as cmds

# Make a new window

window = cmds.window( title="Render", iconName='BTD', widthHeight=
(500,500),titleBar=True,minimizeButton=True,maximizeButton=True )
cmds.columnLayout( adjustableColumn=True)

form = cmds.formLayout()
tabs = cmds.tabLayout(innerMarginWidth=10, innerMarginHeight=10)
cmds.formLayout(form,edit=True,attachForm=((tabs, 'top', 0), (tabs, 'left', 
0), (tabs, 'bottom', 0), (tabs, 'right', 0)) )
child1 = cmds.rowColumnLayout(numberOfColumns=2)
cmds.button(label='1')
cmds.button(label='2')
cmds.button(label='3')  
cmds.setParent( '..' )


child2 = cmds.rowColumnLayout(numberOfColumns=1)
cmds.text("Output Directory",width = 50,height=50,font = "boldLabelFont")
cmds.text("Notify on job completion",width = 200,height=50,font = 
"boldLabelFont")
cmds.setParent( '..' )


child3 = cmds.rowColumnLayout(numberOfColumns=2)
cmds.button(label='7')
cmds.button(label='8')
cmds.button(label='9')
cmds.setParent( '..' )

cmds.tabLayout( tabs, edit=True, tabLabel=((child1, 'General'), (child2, 
'Advanced'),(child3, 'Job Software')) )
cmds.setParent( '..' )

cmds.showWindow( window )
输出

预期产出

有什么概念像给文本指定x轴和y轴


请告诉我如何使用python在maya中进行格式化,这只是您必须添加的
align
属性,它接受
left
right
center
中的一个。如果未设置,默认情况下,它是
center

   cmds.text("Output Directory",width=50, height=50,font="boldLabelFont", align='left')

它只是您必须添加的
align
属性,它接受
left
right
center
中的一个。如果未设置,默认情况下,它是
center

   cmds.text("Output Directory",width=50, height=50,font="boldLabelFont", align='left')

我想在选项卡布局外设置提交按钮如何操作?align=left将文本推到最左边,但我想打印两个空格,然后打印文本。有x轴和y轴这样的概念吗?我通常尝试使用
cmds.window
,因为它不太灵活,如果您想缩进,您可以使用空白作为“输出目录”或选项卡
\tOutput Directory
我想在选项卡布局外设置提交按钮如何操作?align=left将文本推到最左边,但我想打印两个空格,然后再打印文本。有没有像x轴和y轴这样的概念?我通常尝试使用
cmds.window
,因为它不太灵活,如果你想
缩进
,你可以使用空白作为“输出目录”或选项卡
\tOutput目录