0

Getting the current frame number of the source media from defaultsequence view mode

Hi there!

Is there a way to get the current frame number of the source media when we are in the "defaultsequence" view mode? The commands.frame() returns the global frame number. I've written a hotkey toggle to switch between "defaultsequence" view mode and the source media view mode which is working fine but when it switches to the source media view mode, it resets the frame number to the first frame of that media. I would like it to stay on the same frame while it switches between the two modes.

 

2 comments

  • 0
    Avatar
    Michael Kessler

    Bit of an older post, but I came across this and figured I knew the answer (in case you haven't figured it out or others are looking).

    I'm going to make a guess that you are using python, but there's Mu equivalents  you can find used in the timeline.mu.

    The package rv.extra_commands includes a sourceFrame command.  The Mu docs have the function signature:
    sourceFrame (int;
                 int atframe,
                 string root = nil)

    So if you do something similar to:
    rv.extra_commands.sourceFrame(rv.commands.frame())


    ...you should get the source frame like you requested; which you can then set the frame once you've switched views.

     

    Hope that helps.

  • 0
    Avatar
    Venu Krishnamurthy

    Hi Michael,

    Sorry about the late reply but thanks so much for the answer. That's exactly what I was looking for and it works like charm!

    Cheers,
    Venu.

Please sign in to leave a comment.