I'm embarrassed to say that this time I was able to get the code working with Bing Chat.
Originally, I needed help from you all. But unfortunately, no help came in time.
I am neither anti-AI nor pro-AI, but this was a good opportunity to take a fresh look at AI, and since there is talk that Autodesk Maya will someday have AI or not, I will watch it unfold.
Now, here is the code that works.
# -*- coding: utf-8 -*-
# tickspanChangeUI
import maya.cmds as cmds
import maya.mel
def tickspanChangeUI():
windowName = 'tickspanChangeUI'
if cmds.window( windowName, ex = True ):
cmds.deleteUI( windowName )
cmds.window( windowName )
v = getValue()
window = cmds.window( t = 'Tick Span' )
cmds.columnLayout( adj = True )
cmds.frameLayout( l = 'Tick Span' )
intSliderGrp = cmds.intSliderGrp( f = True, l = 'Tick Span', min = 0, max = 10, fmn = 0, fmx = 1000, v = v )
cmds.intSliderGrp( intSliderGrp, l = 'Tick Span', e = True, cc = lambda *args: changeOptionVar( value = cmds.intSliderGrp(intSliderGrp, q=True, v=True) ) )
cmds.showWindow( )
def getValue():
aPlayBackSliderPython = maya.mel.eval('$tmpVar=$gPlayBackSlider')
current_tickspan = cmds.timeControl(aPlayBackSliderPython, query=True, tickSpan=True)
return current_tickspan
def changeOptionVar( value = None ):
aPlayBackSliderPython = maya.mel.eval('$tmpVar=$gPlayBackSlider')
cmds.timeControl(aPlayBackSliderPython, edit=True, tickSpan=value)
tickspanChangeUI()
You can change it by dragging and undragging the slider or entering a number.
The Preferences do not reflect the numbers, but you can see that the UI controls them.
UI controls tick span
UI and Preference, the preferences do not reflect the numbers.
https://sl.bing.net/fetffv9hbfo (Bing Chat)
Thanks,