def ui(self):
'''
Launch a UI to display the marks that were recorded.
'''
with utl.MlUi('ml_stopwatchReport', 'Stopwatch Report', width=400, height=400, info='''This is the report from the stopwatch you just ran.
Adjust the start frame, and then press the frame buttons to jump to that frame.
The fields on the right can be used for notes.''', menu=False) as win:
self.uiSlider = mc.intSliderGrp(field=True, label='Start Frame', value=self.startFrame,
minValue=((-0.5*self.frameMarks[-1])+self.startFrame), maxValue=(self.frameMarks[-1]/2)+self.startFrame,
fieldMinValue=-1000, fieldMaxValue=1000,
changeCommand=self.uiUpdateStartFrame)
self.frameRateField = mc.intFieldGrp(label='Frame Rate', value1=self.frameRate, enable1=False, extraLabel='fps', annotation='')
mc.scrollLayout()
mc.rowColumnLayout(numberOfColumns=3, columnWidth=[(1, 50), (2, 80), (3, 340)])
mc.text('Frame')
mc.text('Duration')
mc.text('Notes')
for i in range(3):
mc.separator(style='single', height=15)
self.uiButton = list()
for i in range(len(self.frameMarks)):
#frame button
frame = self.frameMarks[i]+self.startFrame
self.uiButton.append(mc.button(label=str(frame), annotation='Go to frame %i' % frame,command='import maya.cmds;maya.cmds.currentTime(%i,edit=True)' % frame))
#duration text
if i:
mc.text(label=str(self.frameMarks[i]-self.frameMarks[i-1]))
else:
mc.text(label='Start')
#notes field
mc.textField()
#add the stop
mc.text(label='')
mc.text(label='Stop')
mc.setParent('..')
mc.setParent('..')
#next and prev buttons!
mc.paneLayout(configuration='vertical2',separatorThickness=1)
mc.button(label='<< Previous', command=self.previousFrame, annotation='Go to the previous frame in the list.')
mc.button(label='Next >>', command=self.nextFrame, annotation='Go to the next frame in the list.')
评论列表
文章目录