0
파이썬으로 스크립트를 작성하기 시작한 이래로이 문제가 발생했습니다.크기 조정 가능 창 명령 python-maya
주 "창"명령에 "너비"및 "높이"플래그를 추가해도 크기는 최근 조작에 따라 항상 조정됩니다. . 무슨 뜻인지 알 겠어?
항상 너비와 높이 플래그를 입력 한 것과 동일한 크기를 제공하지 않습니까?
무엇이 문제입니까?
Windows와 작업 할 때 항상 조정해야하기 때문에 꽤 큰 플래그를 사용하고 싶지 않습니다.
어쩌면이 이상한 행동의 진정한 이유가 무엇일까요 ??
내가 상관없이 내가 윈도우의 모서리를 드래그하여 크기를 조정 몇 번이나 내 창을 열려면...
, 여기 내 파이썬 코드 필요한 경우 ...
import maya.cmds as cmds
def createGUI():
#If the window already exists, it will delete it.
if cmds.window('myWindow',exists=True):
cmds.deleteUI('myWindow')
#Creation window command
winControl=cmds.window('myWindow',title='BookShelf Generator',resizeToFitChildren=True, sizeable=False) #s=False does not allow the user to change the size of the window
#Windows Layout
#Top Part
#Header image
cmds.rowColumnLayout(w=400)
cmds.image(image='/home/s4915717/Stefano_Feltre_Scripting/artefacts/Images/UIheader02.png')
cmds.setParent("..")
cmds.columnLayout(adjustableColumn=True,rowSpacing=0)
cmds.frameLayout(label='BookShelf Options',collapsable=False, mw=5, mh=5)
cmds.text(label='Modify the value on the interace to create different aspect of the BookShelf.', align='center', height = 20)
cmds.separator(height=5)
cmds.columnLayout()
#Center Part
ShelfSizeControl=cmds.intSliderGrp(label='Shelfs Size',minValue=5.0,maxValue=200.0, value=50.0,field=True)
NumShelfsColumnControl = cmds.intSliderGrp(label='Num Shelfs Column', minValue=1, maxValue=10, value=3,field=True)
NumShelfsRowControl = cmds.intSliderGrp(label='Num Shelfs Row', minValue=1, maxValue=10, value=3,field=True)
GapShelfsColumnControl = cmds.intSliderGrp(label='Gap Column Shelfs', minValue=10, maxValue=50, value=10,field=True)
GapShelfsRowControl = cmds.intSliderGrp(label='Gap Row Shelfs', minValue=1, maxValue=30, value=1,field=True)
GapBooksControl = cmds.intSliderGrp(label='Gap Books', minValue=0, maxValue=1, value=0,field=True) #da controllare il valore massimo
cmds.text(label='Books Direction', align='center', height = 20)
DirectionControl = cmds.radioCollection()
Direction0 = cmds.radioButton(label='Front',align='left')
Direction1 = cmds.radioButton(label='Back',align='center')
Direction2 = cmds.radioButton(label='Random',align='right')
cmds.radioCollection(DirectionControl, edit=True, select=Direction0)
cmds.columnLayout(adjustableColumn=True,rowSpacing=0)
cmds.separator(height=5)
#Bottom Part
#cmds.shelfButton(annotation='BookShelf Generator - Stefano Feltre', image = "commandButton.png", l='BookShelf', p='Custom', imageOverlayLabel='Spider', overlayLabelBackColor=(.6, .6, .6, .6), command=str("from SpiderGen import gui;reload(gui);gui.createUI()"))
#vedere come caricare un bottone nel custom
#Signature
cmds.text(label='Stefano Feltre - 2017', w=400, h=30, font="smallPlainLabelFont")
#This command make appear the window
cmds.showWindow(winControl)
createGUI()
"showwindow"명령 뒤에 추가 할 MEL 코드를 찾았습니다.
if (`window -q -ex $winName`) deleteUI $winName;
window -t "BookShelf Generator" $winName;
showWindow $winName;
window -e -wh 150 200 $winName;
감사합니다. : D –
기쁘게 그 work'd .. 제발 표식을 허용 답변 및 upvote입니다 :) – Achayan
나는 아직 upvote 수 없다 ... 나는 명성에 11, 15 필요 ... 그리고 난 어떻게 생각 해봐야 겠어. 대답 ^^ " –