Graphics

 View Only
  • 1.  Play Scene Director through a Script

    Posted 11-11-2020 11:14

    I'm trying to add a script on the Keyboard Mapping to be able to trigger a Scene Director so I can "activate" that Scene Director with a keyboard shortcut.

    Is there a simple script that will trigger a Scene Director in my Message?

     

    Thank you!



  • 2.  RE: Play Scene Director through a Script

    Posted 11-11-2020 14:59

    Hey Paulo- 

    In the "Keyboard/GPI Mapping" area, you should be able to drag a "Script Action" into the Project Shortcuts.  Then, you'll edit the script action (Sub OnKeyPress) to do something like this...

    Option 1, if you always want to play a scene director from a particular scene:

    dim Scene as xpScene

    dim sd as xpSceneDirector

    Engine.GetSceneByName("ExampleScene", Scene, false)

    Scene.GetSceneDirectorByName("ExampleSceneDirector", sd)

    sd.play

     

    Option 2, if you want to play a particular scene director for whatever scene is on framebuffer 1, layer 1:

    dim output as xpOutputFrameBuffer

    dim onlineScene as xpScene

    dim sd as xpSceneDirector

    engine.Getoutputframebuffer(0, output)

    output.GetSceneonlayer(1, onlineScene)

    onlineScene.GetSceneDirectorByName("ExampleSceneDirector", sd)

    sd.Play

     

    Once you get a script working, you can assign a keyboard shortcut to this GPI/Script Action.  Let me know if you have issues!

     

    Bo


    #XPression


  • 3.  RE: Play Scene Director through a Script

    Posted 11-23-2020 06:41

    Thanks a lot Bo!

    I was able to get the second script right, the one that plays anything that is on the Frame Buffer. It was very useful on the show.

    But I couldn't get the first one to work, I've tried a few different variations and nothing.

    Any idea of what could have happened? Did you get the same script to work on your machine?


    #XPression


  • 4.  RE: Play Scene Director through a Script

    Posted 01-13-2021 14:10

    Hey,

    I think the problem with the first one is that you need to put the scene on-air as well. Try this. 

    Dim Scene as xpScene
    dim sd as xpSceneDirector


    Engine.GetSceneByName("YOUR SCENE NAME", Scene,False)

    Scene.SetOnline(1,0,0)

    Scene.GetSceneDirectorByName("SceneDirector1", sd)

    sd.play()


    #XPression