Maya timeline controls UI


#1

I am trying to add the timeline and range sliders from Maya to a UI in Python. According to the docs, this would be the rangeControl and timePort commands. However, when I build this small UI example I get an empty window:

from maya import cmds

cmds.window(w=500, h=75, title="Timeline Controls UI")
clayt = cmds.columnLayout(adjustableColumn=True)
cmds.rangeControl('myRangeSlider', parent=clayt)
cmds.timePort('myTimePort', parent=clayt)
cmds.showWindow()

Thoughts?


#2

Turns out that the issue is not with either of the two widgets, but with the layout…

Bad:

cmds.window( w=500, h=60, title=“Timeline Controls UI” )
cl = cmds.columnLayout(adjustableColumn=True)
cmds.timePort( ‘myTimePort’, parent=cl, backgroundColor=(0,1,0) )
cmds.rangeControl( ‘myRangeSlider’, minRange=0, maxRange=60, parent=cl, backgroundColor=(1,0,0))
cmds.showWindow()

Good:

cmds.window( w=500, h=60 )
fl = cmds.frameLayout(labelVisible=False)
cmds.timePort( ‘myTimePort’, parent=fl, backgroundColor=(0,1,0) )
cmds.rangeControl( ‘myRangeSlider’, minRange=0, maxRange=60, parent=fl, backgroundColor=(1,0,0))
cmds.showWindow()

53%20PM