Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to change the tick span of the time slider without having to do it from Preference?

How to change the tick span of the time slider without having to do it from Preference?

amaterasu-qbb
Collaborator Collaborator
1,063 Views
2 Replies
Message 1 of 3

How to change the tick span of the time slider without having to do it from Preference?

amaterasu-qbb
Collaborator
Collaborator

It would be easier to understand if the tick span is displayed on the Time slider when you setkey every 3 frames, for example, 3.6.9. But it's not so easy to change from the Preferences to do this. Is there a way to change the tool (PySide) to do this?

キャプチャ31.PNG

By the way, the structure of the tool is
It consists of a QSpinBox and QSlider that allows you to change TickSpan. It works the same way as Lambert's Attribute Editor such as Diffuse.
I'd like to be able to change it in real-time while QSlider is running.
Image and original site.

image_02-2.png
https://kiwamiden.com/how-to-make-intslidergrp-modki-with-pyside

 

When you change the tick span from the Preference, you will get a command like this

timeControl -e -tsp `intFieldGrp -query -value1 timeLabelSpacing` $gPlayBackSlider;
// Result: TimeSlider|MainTimeSliderLayout|formLayout8|frameLayout2|timeControl1 //

 

I read kiwamiden and Pyside's GitHub but I didn't understand at all.

0 Likes
1,064 Views
2 Replies
Replies (2)
Message 2 of 3

stuzzz
Collaborator
Collaborator

 

# the variable widget is hardcoded. it seems to work fine but not sure it would for any cases. If not, we could investigate and find a way to find a pointer to the widget.

def myfunc(value):
    widget = "TimeSlider|MainTimeSliderLayout|formLayout8|frameLayout2|timeControl1"
    cmds.timeControl(widget, e=True, tsp=value)

# whatever is your widget but I create a new one to illustrate
slider = QSlider()
slider.show()
slider.valueChanged.connect(myfunc)

 

Message 3 of 3

amaterasu-qbb
Collaborator
Collaborator

Hi! @stuzzz ,

 

Sorry for not replying for a long time and I appreciate your help. 

 

My current environment.
Windows11 Pro (64 bit)
I am not sure if there is support for pyqt in Autodesk Maya 2024 Creative. I get the following error message.

# Error: NameError: file <maya console> line 8: name 'QSlider' is not defined

Only the UI is finished, so please follow this link.
https://forums.autodesk.com/t5/maya-programming/i-need-your-help-to-create-a-tick-span-changer-ui-ei...


Regards.

0 Likes