Graphics

 View Only
  • 1.  Setting Scene Key Scripting

    Posted 02-23-2018 14:56
    I'm looking to set one of my global scene keys to the value of a datalinq variable. What would be he way i go about this.

    I have a global key %jersey% and would like it to source from a datelinq source.


  • 2.  RE: Setting Scene Key Scripting

    Posted 02-26-2018 18:22
    You can use a script to copy the content of a text object to a Datalinq key

    This is an example of the script running in OnOnline. It could be better to run on OnSetText or a Scene Director script depending on your application (it would require some modification).

    dim data as xpTextObject
    dim vari as xpTextObject
    dim varicopy as xpTextObject
    dim keys as xpDatalinqKeys
    dim key as xpDatalinqKey

    self.getObjectByName("Data", data)
    self.getObjectByName("vari", vari)
    self.GetDatalinqKeys(keys)
    keys.GetKeyByName("hey", key)
    key.AsString = vari.text
    Self.RefreshDatalinqs()
    #XPression


  • 3.  RE: Setting Scene Key Scripting

    Posted 02-27-2018 02:26
    Thanks Garner,

    I implemented that and it works perfectly in my OnOnline, however the key does not appear to update when I put the script in my Onsettext. Is there a command to refresh the scene without taking it offline?
    #XPression


  • 4.  RE: Setting Scene Key Scripting

    Posted 02-27-2018 15:22

    OnSetText scripts run every time the text in the text object changes. Is the text object getting updated? You could put the script in a scene director script event and loop the scene director at a reasonable rate.


    I had some extra stuff in that script you wouldn't need, sorry.

    OnOnline/SceneDirector Version:

    dim vari as xpTextObject
    dim keys as xpDatalinqKeys
    dim key as xpDatalinqKey

    self.getObjectByName("vari", vari)
    self.GetDatalinqKeys(keys)
    keys.GetKeyByName("hey", key)
    key.AsString = vari.text
    Self.RefreshDatalinqs()

    OnSetText Version:

    dim keys as xpDatalinqKeys
    dim key as xpDatalinqKey

    self.GetDatalinqKeys(keys)
    keys.GetKeyByName("hey", key)
    key.AsString = self.text
    Self.RefreshDatalinqs()

    #XPression


  • 5.  RE: Setting Scene Key Scripting

    Posted 02-28-2018 04:42
    Ok, I changed two of your OnSetText lines to

    scene.GetDatalinqKeys(keys)
    scene.RefreshDatalinqs

    This updates the datalinq key, however it seems I have to set the text twice before my key updates. Almost like the script needs to be run twice before the key will update. Any ideas?
    #XPression