Graphics

 View Only
  • 1.  Trigger inputbox using radio button

    Posted 08-02-2017 23:58
    Hey All:

    Working on a project where I want to pop an inputbox whenever I change the radio button selection on a text object. When I add the script to OnSetText, the inputbox pops up twice (!) when selecting the take item in the sequence, then again when the radio buttons are clicked and AGAIN when I take the scene online.

    Any thoughts? I've tried putting the script in OnAddText and OnSetLine and it doesn't seem to run at all, but maybe I'm missing a step somewhere?

    Many thanks!

    CJ


  • 2.  RE: Trigger inputbox using radio button

    Posted 08-03-2017 01:01
    The OnSetText script runs each time the scene is generated for preview (so when selecting it in sequencer or when changing any data).
    The scripts are supposed to be designed such that they finish executing immediately and do not block execution (i.e. popup an input box or anything); so this is not something we recommend doing. Is it something you could accomplish using a custom dashboard panel instead?

    #XPression


  • 3.  RE: Trigger inputbox using radio button

    Posted 08-03-2017 15:39
    Hmmm...Dashboard is a great thought.

    The popup is for a score update that happens really quickly (the graphic needs to play to air about 5 seconds after the score change happens in the game). The complications are that there are 10 possible scores to change (kinda like a baseball box score) and the amount of the change is not really set or predictable (it could change by 1, 2 or 3). I need the scoreboard to reveal with the old scores, then the updated score to flash on. My first attempt worked, but was very manual and slower than I would like, so I'm trying to make the scene a bit smarter for v2 :-)

    For future reference, when do OnAddText and OnSetLine fire?

    #XPression


  • 4.  RE: Trigger inputbox using radio button

    Posted 08-03-2017 17:27
    Those two scripts are trigger via external API applications that call AddLine() or SetLine() in the xpTextObject.

    I would suggest you post a question in the dashboard forum and they might be able to help you set something up. I would think some sort onscreen grid in dashboard that you could fill the scores into, and then a button next to it that triggers the graphic to play. This of course assumes you have a license for datalinq, which would be required for XPression to pull the scores from the Dashboard grid.
    #XPression


  • 5.  RE: Trigger inputbox using radio button

    Posted 08-03-2017 18:19
    Cool...this might end up being the long-term solution, but I am already pretty far down the road integrating the show via datalinq/Excel so I'm working now on implementing a similar flow, but using Excel rather than dashboard to fire the change.
    #XPression


  • 6.  RE: Trigger inputbox using radio button

    Posted 08-04-2017 16:38

    Here is where I ended up...it's working pretty well, but tends to crash if I try to break it by running the scene over and over. Running under our normal workflow (once every 10 mins or so) it seems fine. Any thoughts on ways I could make this more robust?



    dim outputTakeItem as xpBaseTakeItem
    dim outputFBIndex as integer
    dim outputLayer as integer
    dim outputFB as xpOutputFramebuffer
    dim outputScene as xpScene
    dim scoreUpdateSD as xpSceneDirector

    dim objectName as String
    dim objectBaseName as String
    dim scoreObj as xpTextObject
    dim UpdateObj as xpTextObject

    engine.Sequencer.GetFocusedTakeItem(outputTakeItem)
    outputFBIndex = outputTakeItem.FrameBufferIndex
    outputLayer = outputTakeItem.Layer
    Engine.GetOutputFramebuffer(outputFBIndex, outputFB)
    outputFB.GetSceneOnLayer(outputLayer, outputScene)

    objectName = Self.Name
    objectBaseName = (objectName.Remove(0,7))

    if outputScene.GetObjectByName("TXT--Score " & objectBaseName, scoreObj)
    end if

    if outputScene.GetObjectByName("Update " & objectBaseName, updateObj)
    end if

    if scoreObj.text <> updateObj.text
    if outputScene.getSceneDirectorByName(objectName,scoreUpdateSD)
    scoreUpdateSD.play
    end if
    end if

    #XPression


  • 7.  RE: Trigger inputbox using radio button

    Posted 08-04-2017 16:44
    If you send me the scene and let me know how to crash it, I can investigate. Something I find something like:scoreUpdate.PlayRange(0, scoreUpdate.Duration) is better because it will force to to play from frame 0 again, rather than just continue from where the scene director happens to be.
    #XPression


  • 8.  RE: Trigger inputbox using radio button

    Posted 08-04-2017 17:41
    Cool. I'll try that and send you a copy of the scene!

    Thanks, Brian!

    CJ

    #XPression