Graphics

 View Only
  • 1.  Taking another Take ID based on Current Take ID

    Posted 05-15-2017 04:04
    Hi Forum users,

    I'm hoping this is a simple script, but I haven't been able to get it to work yet. Here's what I'm trying to do:

    We have a sponsor loop playing out of the sequencer. They are just instances of the same scene, and using an excel spreadsheet with datalinq we are using the volatile material script to change the material path on each item (excel sheet says "Joeys Plumbing" so it loads "Joeys Plumbing.jpg" into the volatile material). Items play through a group, set to autoplay each item for 10sec. Seems to be working smoothly. Each game there could be between 50-75 sponsors.

    Now, to complicate the matter, there is a second sponsor loop, going through another framebuffer, and using the same technique to create the materials. (the purpose here is a corner bug sponsor loop that must match a full-screen sponsor loop on the other channel.) We have a dashboard panel which fires the two groups at the same time, and the groups autoplay as expected. In theory, it seems like those two loops would stay in sync forever. But in practice, we noticed a bit of drifting after a couple hours. Also, not much flexibility if we need to jump around the loop at all.

    So, I'm trying to write a script on the fullscreen sponsor scene that would do the following:

    - get its own take ID (On framebuffer 2)
    - Add 1000 (So if it's take ID 2056, use the number 3056, which would be the corresponding corner graphic))
    - take that ID online as well (on framebuffer 1)

    The goal here is that we would only fire one group, and the script would always take its corresponding item in the other group. Hence, staying in sync forever. This would also give more flexibility if we needed to jump around the group at any time.

    As a bonus, I'd also like to allow the script to check if a text field is empty [the sponsor name from datalinq] and if it's empty, take ID 2001 (which would start the loop over again.) This is just a safety measure for the inevitable scenario when there are not enough entries in excel to match the items in the sequencer.

    Any pointers in the right direction is appreciated. Thanks very much!


  • 2.  RE: Taking another Take ID based on Current Take ID

    Posted 05-15-2017 04:05
    Also, sorry for the wonky title, it's been a long day...
    #XPression


  • 3.  RE: Taking another Take ID based on Current Take ID

    Posted 05-15-2017 12:56
    Here you go. This should be put into the OnOnline script.

    dim layer, chan as Integer
    dim output as xpOutputFramebuffer
    dim takeitem as xpBaseTakeItem
    dim othertakeitem as xpBaseTakeItem

    ' Find what chan/layer this scene is on
    if self.GetOnline(chan, layer) then
    ' Get the output framebuffer object
    if engine.GetOutputFramebuffer(chan, output) then
    ' Get the take item representing this scene
    if output.GetTakeItemOnLayer(layer, takeitem) then
    if engine.Sequencer.GetTakeItemByID(takeitem.ID + 1000, othertakeitem) then
    othertakeitem.execute
    end if
    end if
    end if
    end if

    #XPression


  • 4.  RE: Taking another Take ID based on Current Take ID

    Posted 05-15-2017 13:30

    Hey there,

    I think this is a way you could do it. You could put this in the onOnline of the primary sponsor scene. Get the framebuffer and layer of the main scene. Then get the basetakeitem.ID, add 1000 to that and put that scene of its own framebuffer or layer. I feel like there is a way to do this in one scene using datalinq, but I dont know enough about the scene to suggest a method.

    I havent tested the below code myself, but I have scenes and GPIs that access sequencer and outputframebuffers in this way.
    Hope it helps.

    Mike



    ' Get framebuffer with your primary scene on it, 0=FB1, 1=FB2
    dim framebuffer as xpOutputFrameBuffer
    engine.GetOutputFrameBuffer(0,framebuffer)

    ' Get the sponsor scene as xpBaseTakeItem using the layer of that framebuffer to find it
    dim SponsorTI, CornerBugTI as xpBaseTakeItem
    framebuffer.GetTakeItemOnLayer(0,SponsorTI)
    dim SponsorScene as xpScene

    ' Do the math to get the corner bug ID
    dim CornerBugID as long
    CornerBugID = Clng(SponsorTI.ID) + 1000

    ' Get sponsor scene as xpScene can check the text field
    framebuffer.GetSceneOnLayer (0,SponsorScene)
    dim TextObjectToTest as xpBaseObject
    SponsorScene.GetObjectByName("TextObjectToTest",TextObjectToTest)

    ' If the text field is blank, reset corner bug takeid to 2001, your default
    if TextObjectToTest.Text = "" then
    CornerBugID = 2001
    end if

    ' Get Sequencer from Engine and get the cornerbug take item
    dim Sequencer as xpSequencer
    Sequencer = Engine.Sequencer
    Sequencer.GetTakeItemByID(CornerBugID,CornerBugTI)

    ' Set framebuffer and layer of cornerbug then put it online
    CornerBugTI.FrameBufferIndex = 1
    CornerBugTI.Layer = 0
    CornerBugTI.Execute()

    #XPression


  • 5.  RE: Taking another Take ID based on Current Take ID

    Posted 05-16-2017 04:24

    Thanks Brian, I've almost got it working. I added a bit of code to get it to fire the first item if the text field is empty. But sisnce I'm using a dissolve transition, there is a bit of a jump as I believe it's basically trying to take two items at once. Is ther any way around that?




    dim layer, chan as Integer
    dim output as xpOutputFramebuffer
    dim takeitem as xpBaseTakeItem
    dim othertakeitem as xpBaseTakeItem
    dim fisttakeitem as xpBaseTakeItem
    dim sponsor as xptextobject

    self.getobjectbyname ("Sponsor Name", sponsor)
    engine.Sequencer.GetTakeItemByID(2001, fisttakeitem)


    if sponsor.text = "" then
    fisttakeitem.execute
    else
    ' Find what chan/layer this scene is on
    if self.GetOnline(chan, layer) then
    ' Get the output framebuffer object
    if engine.GetOutputFramebuffer(chan, output) then
    ' Get the take item representing this scene
    if output.GetTakeItemOnLayer(layer, takeitem) then

    if engine.Sequencer.GetTakeItemByID(takeitem.ID + 1000, othertakeitem) then

    othertakeitem.execute
    end if
    end if
    end if
    end if
    end if

    #XPression