Graphics

 View Only
  • 1.  OnSetText script triggers all the time

    Posted 27 days ago

    Hi,

    I've added a small script to the "OnSetText" event of a text object. I expect it to only trigger when I change the content of that specific text object, but it runs on every text change of every text object in the scene. Very similar to if it had been in the OnPrevierRender event. 

    Here's the script for reference:

    dim gpi as xpGPIBoard
    dim raceID, driverID as xpTextObject
    scene.GetObjectByName("Race ID", raceID)
    scene.GetObjectByName("Driver ID", driverID)
    engine.GetGPIBoard(2, gpi)
    
    dim newMessage as string
    newMessage = "loadRaceProfile:" + driverID.Text + ":" + raceID.Text
    
    gpi.SendMessage(newMessage)


    ------------------------------
    Chris Nicolay Wernersen
    ------------------------------


  • 2.  RE: OnSetText script triggers all the time

    Posted 26 days ago

    Hi Chris

    Add this to the start of your code

    If scene.isonline = false then exit sub

    The code will then only execute after that line when it is online.

    Simon



    ------------------------------
    Simon Latus
    Simon Latus Media Ltd
    United Kingdom
    ------------------------------



  • 3.  RE: OnSetText script triggers all the time

    Posted 26 days ago

    Thanks for the reply!

    I want it to run when building/previewing the template and not when it's online. 
    I could put the script onPreview, but then it will trigger for every small change the user makes when building the template. 



    ------------------------------
    Chris Nicolay Wernersen
    ------------------------------