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.

Animation Bookmarks Python

Animation Bookmarks Python

joeJ7RUP
Explorer Explorer
2,847 Views
2 Replies
Message 1 of 3

Animation Bookmarks Python

joeJ7RUP
Explorer
Explorer

Are there python commands for the new Animation Bookmarks system in Maya 2020?  I'm looking to programmatically create bookmarks through python and something like a cmds.timeSliderBookmark('bookmark1', e=True, timeRangeStart=4, timeRangeEnd=64) would be super helpful.

 

When "echoing all commands" in the Script Editor, there does seem to be some behind-the-scenes python stuff happening.

if(checkAndLoadPlugin("timeSliderBookmark")){python("from maya.plugin.timeSliderBookmark.bookmarkManager import CreateBookmarkDialog; cb = CreateBookmarkDialog(); cb.show()");};

from maya.plugin.timeSliderBookmark.bookmarkManager import CreateBookmarkDialog; cb = CreateBookmarkDialog(); cb.show()

0 Likes
Accepted solutions (1)
2,848 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

Didn't find anything in the documentation yet but you can take a look at the timeSliderBookmark package located here: 

{MAYA2020_INSTALL_LOCATION}/Python/Lib/site-packages/maya/plugin/timeSliderBookmark

 

To create a time slider bookmark you'll find a createBookmark function in the timeSliderBookmark module of the package.

from maya.plugin.timeSliderBookmark.timeSliderBookmark import createBookmark
createBookmark(name="SomePrettyName", start=1, stop=100, color=(1, 0 ,0))

 This would create a bookmark named SomePrettyName. Starting at frame 1 to frame 100 with red as its color.

 

There are other functions like one to get the list of all existing bookmarks...

 

Hope this helps.

 

Cheers

0 Likes
Message 3 of 3

joeJ7RUP
Explorer
Explorer

Fantastic find!  Works perfectly, thank you.

0 Likes