Graphics

 View Only
  • 1.  script works on frame buffer 1 but not on frame buffer 2

    Posted 10-09-2015 22:50
    I built the following "macro" to trigger an animation each time our team scores a 3 pointer. It works perfectly when the scorebar is on fb1, but will not trigger when the scorebar is on fb2. Any suggestions?

    Thanks as always


  • 2.  RE: script works on frame buffer 1 but not on frame buffer 2

    Posted 10-09-2015 22:50
    dim scene as xpScene

    dim fb as xpOutputFramebuffer

    dim scenedir

    engine.GetOutputFramebuffer(0, fb)

    if fb.GetSceneOnLayer(0, scene) then

    if Scene.Name = "ScorebarOT" then

    if scene.GetSceneDirectorByName("macu3", scenedir) then

    if scenedir.position >= 150 then

    scenedir.PlayRange(150, 0)

    else

    scenedir.PlayRange(0, 150)

    end if

    end if

    end if

    end if

    #XPression


  • 3.  RE: script works on frame buffer 1 but not on frame buffer 2

    Posted 10-09-2015 22:54
    Change the GetOutputFramebuffer to "1,fb" instead of 0.

    #XPression


  • 4.  RE: script works on frame buffer 1 but not on frame buffer 2

    Posted 10-09-2015 23:03
    I was sooooo close. Thanks as usual Brian. I changed it to 2 thinking......fb2. Why does it have to be 1?

    #XPression


  • 5.  RE: script works on frame buffer 1 but not on frame buffer 2

    Posted 10-10-2015 02:40
    They start counting at 0.. 0 is the first output, 1 is the second, etc..

    It's a programmer thing ;)

    #XPression


  • 6.  RE: script works on frame buffer 1 but not on frame buffer 2

    Posted 10-10-2015 06:07
    friggin programmers. I remember we had a computer tech help build an audio snake and he started the numbering at 0. We hated him for that. Thanks Brian. It worked like a charm and now we can charge money every time a three pointer is scored. "Go Jazz"

    #XPression


  • 7.  RE: script works on frame buffer 1 but not on frame buffer 2

    Posted 03-01-2017 17:55
    In the above example, the animation plays but only if the scene is on Layer 0. "if fb.GetSceneOnLayer(0, scene) then". Is there a way to make this animation play on any layer rather than forcing my operator to put the scene on 0?
    #XPression


  • 8.  RE: script works on frame buffer 1 but not on frame buffer 2

    Posted 03-01-2017 18:11
    You would need to loop over the layers on the output. This example will check between layer 0 and 10 for the scene called "ScorebarOT".


    dim scene as xpScene
    dim fb as xpOutputFramebuffer
    dim scenedir as xpSceneDirector
    dim layer as integer

    engine.GetOutputFramebuffer(0, fb)
    for layer = 0 to 10
    if fb.GetSceneOnLayer(layer, scene) then
    if Scene.Name = "ScorebarOT" then
    if scene.GetSceneDirectorByName("macu3", scenedir) then
    if scenedir.position >= 150 then
    scenedir.PlayRange(150, 0)
    else
    scenedir.PlayRange(0, 150)
    end if
    end if
    end if
    end if
    next

    #XPression


  • 9.  RE: script works on frame buffer 1 but not on frame buffer 2

    Posted 03-01-2017 19:04
    sounds good, thank you Brian
    #XPression