Graphics

 View Only
Expand all | Collapse all

Script to a scene to call up a group and add another scene to the sequencer when created

  • 1.  Script to a scene to call up a group and add another scene to the sequencer when created

    Posted 03-02-2015 20:24

    I'm trying to have a scene that will it is put into the sequencer it will create a group in that location and add another scene to that group. To go further, it will look at a text field in its scene to determine the number of scenes to create while changing their datalinq keys.

    But first, I have to get it to create a group and call up another scene into that group. Does anyone have any examples of this?

    This is what I have. It will create the new group (but not name it NewG) and then hang the program.

    dim BaseTakeItem as xpBaseTakeItem

    dim NewG as string

    dim NewGroup as xpTakeItemGroup

    'get current item by name

    'Engine.Sequencer.GetFocusedTakeItem(BaseTakeItem)

    'create a group after the story

    Engine.Sequencer.CreateGroup(NewG, BaseTakeItem, NewGroup)

    'put Another Scene into the group

    dim Template as xpScene

    dim Page as xpTakeItem

    Engine.GetSceneByName("Another Scene", Template)

    Engine.Sequencer.CreateTakeItem(Template, NewGroup, page)



    Does anyone have any ideas or examples of adding a scene to the sequencer?

    Thank you!



  • 2.  RE: Script to a scene to call up a group and add another scene to the sequencer when created

    Posted 03-02-2015 22:53
    I put your script into a Keyboard Macro and fixed a few issues, and it now creates a take item/group..

    Check the docs on the CreateGroup call, the second parameter requires an xpTakeItemGroup, not an xpBaseTakeItem. A group can not be created in the middle of an existing group, it needs to be created at the end of an existing group.

    Also, the line where you GetSceneByName, should have a false at the end to indicate you don't want it to create a copy of a template, but you want to get a handle to the original template which is to then be inserted onto the sequencer..

    I'm not sure this will work inside of an existing scene (like OnOnline or anywhere like that; as it's probably not safe to be modifying the sequencer in the middle of a scene going online; but it should be ok on a Keyboard Macro script).

    `dim BaseTakeItem as xpBaseTakeItem

    dim CurrentItem as xpTakeItem

    dim CurrentGroup as xpTakeItemGroup

    dim NewG as string

    dim NewGroup as xpTakeItemGroup

    Engine.Sequencer.GetFocusedTakeItem(BaseTakeItem)

    CurrentItem = BaseTakeItem

    CurrentItem.GetGroup(CurrentGroup)

    Engine.Sequencer.CreateGroup("New Group", CurrentGroup, NewGroup)

    dim Template as xpScene

    dim Page as xpTakeItem

    Engine.GetSceneByName("LOWERTHIRD", Template, False)

    Engine.Sequencer.CreateTakeItem(Template, NewGroup, page)

    `

    #XPression


  • 3.  RE: Script to a scene to call up a group and add another scene to the sequencer when created

    Posted 03-04-2015 13:16
    Thank you for your help!

    #XPression