Graphics

 View Only
  • 1.  Move Sequencer by script

    Posted 09-17-2018 18:01
    Hi there,
    I need to set focus on the next item in the sequencer by a script.

    how can this be done?

    thanks
    Diego



  • 2.  RE: Move Sequencer by script

    Posted 09-17-2018 18:16

    Here is quick version; this works by using the XPression sequencers currently focused item. It takes the currently focused item and advances; it currently only works with the Take Item group that the focused item is within

    'define vars
    dim basetakeitem, nexttakeitem, nextfocus as xpbasetakeitem
    dim takeitem as xptakeitem
    dim takegroup as xptakeitemgroup

    'Get currently focused item in sequencer list
    engine.sequencer.GetFocusedTakeItem(basetakeitem)

    'Take currently focused item
    basetakeitem.execute

    'Advance sequencer
    takeitem = ctype(basetakeitem, xptakeitem)

    takeitem.GetGroup(takegroup)

    takegroup.getnexttakeitem(takeitem, nexttakeitem)

    nexttakeitem.setfocus

    #XPression


  • 3.  RE: Move Sequencer by script

    Posted 09-17-2018 18:41
    Thanks a lot! why is that you use xpbasetakeitem and xptakeitem? what are the differences?
    what is acheived doing this: takeitem = ctype(basetakeitem, xptakeitem)

    thanks
    diego



    #XPression


  • 4.  RE: Move Sequencer by script

    Posted 09-17-2018 19:08

    The difference between xptakeitem and xpbasetakeitem is the object members that are available

    Ctype is used to convert an expression to a different type(object for example) in the script I convert basetakeitem from a xpBaseTakeItem to a xpTakeItem

    https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/ctype-function

    hope this helps!


    #XPression


  • 5.  RE: Move Sequencer by script

    Posted 09-18-2018 03:20
    You don't actually need the CType. You can assign an xpBaseTakeItem directly to an xpTakeItem, assuming it actually is of that type.
    Or even better; you can eliminate the xpBaseTakeItem entirely and put an xpTakeItem directly in the call to GetFocusedTakeItem.
    It would make the script a lot shorter.


    engine.sequencer.GetFocusedTakeItem(takeitem)

    #XPression


  • 6.  RE: Move Sequencer by script

    Posted 09-18-2018 03:26
    The best way to do this is to add a RossTalk device to the Hardware Setup GPI menu. Then in the keyboard mapping menu you can drag a "Select Next Item" into the keyboard map tree. You can assign GPI #1 of the RossTalk board to trigger this "next item" action.

    Then a script like this will move the sequencer focus to the next item:


    dim gpiboard as xpGPIBoard
    engine.GetGPIBoard(0, gpiboard) ' Get first gpi board
    gpiboard.triggeraction(0) ' Trigger Pin 1 (0 is pin #1, 1 would be pin #2)

    #XPression


  • 7.  RE: Move Sequencer by script

    Posted 09-18-2018 03:55
    Awesome! I had this script saved from awhile ago; thanks for the feedback!
    #XPression


  • 8.  RE: Move Sequencer by script

    Posted 09-19-2018 18:21
    Thanks both for the help.

    regards
    Diego

    #XPression


  • 9.  RE: Move Sequencer by script

    Posted 09-21-2018 18:53
    Dear Bford, the script you described didnt work for me.
    i have a gpi board, i made the mapping in the keyboard map tree, but from the script i cant make it work.
    from dashboard, i send a gpi to gpi pin 1 and it works... so i assume that is the script not working.

    any help?

    thanks
    Diego


    #XPression


  • 10.  RE: Move Sequencer by script

    Posted 09-21-2018 19:04
    Where are you putting the script and how are you trying to trigger the script to run?
    #XPression


  • 11.  RE: Move Sequencer by script

    Posted 09-21-2018 20:00
    Im trying to automate by timecode 4 takeids... this is working, but i want to set focus on the next item that is coming. so when id 0001 becomes online, I want to set focus on id 0002 and so on.
    nothing is working. I tried this script in on online, and makes a weird behaviour in the sequenecer, changing the automation parameters of the takeids by itself..

    thanks
    Diego

    #XPression