Graphics

 View Only
  • 1.  Logo Selection Issue

    Posted 12-03-2019 21:54

    I'm using the following scripting to select which team logos and colors to use in a fullscreen graphic:

    dim Alogo, Acolor, Hlogo, Hcolor as xpBaseObject
    dim Ateam, Hteam as xpTextObject
    dim logopath as string

    scene.GetObjectByName("Logo 1", Alogo)
    scene.GetObjectByName("Color 1", Acolor)
    scene.GetObjectByName("Logo 2", Hlogo)
    scene.GetObjectByName("Color 2", Hcolor)
    scene.GetObjectByName("Select Logo 1", Ateam)
    scene.GetObjectByName("Select Logo 2", Hteam)
    logopath = "D:\LOGOS\" & text & "\"

    if scene.iscopy then
    Alogo.SetVolatileTextureFile(0, logopath & Ateam.text & "\Team_Logo.png")
    Acolor.SetVolatileTextureFile(0, logopath & Ateam.text & "\Team_Color1.png")
    Hlogo.SetVolatileTextureFile(0, logopath & Hteam.text & "\Team_Logo.png")
    Hcolor.SetVolatileTextureFile(0, logopath & Hteam.text & "\Team_Color1.png")
    end if

     

    I use this same basic scripting in multiple scenes and it works like it's supposed to everywhere else.  But in this scene, the logos aren't being populated by the text input in the published text fields.  Instead, they're populating based on the text input in the scene itself.  I've tried unpublishing and re-publishing every object in the scene, I've created new text fields and re-entered the scripting, and I've tried re-naming the text fields in both the scene and the scripting.  But for whatever reason, this scene is intent on completing the filepath using the default text values.  It's maddening.  Can anyone point out what I'm doing wrong?

    Thanks



  • 2.  RE: Logo Selection Issue

    Posted 12-04-2019 02:55

    Is this script in OnOnline, OnSetText, or somewhere else?

    I'm going to assume it's OnOnline, which means this line looks incorrect to me:

    logopath = "D:\LOGOS\" & text & "\"

    What is text, it looks like a variable, but you have not declared it anywhere in the script.


    #XPression


  • 3.  RE: Logo Selection Issue

    Posted 12-04-2019 03:13

    I have multiple leagues in the LOGOS folder. The script exists in a “League Select” text object that completes the filepath to the team folders. I have made that self.text as well but the same issue occurs.


    #XPression


  • 4.  RE: Logo Selection Issue

    Posted 12-04-2019 03:17

    Then the problem is almost certainly that this is in a published text objects onsettext script, but it is also trying to read the values of other published text objects.  You cannot control the order that the template data gets applied to the scene, so if the League Select data get applied before the "Select Logo 1" and "Select Logo 2" text objects, then this script runs before those other text objects have had their published data from the sequencer applied to them.  In that case it would use the value from the scene itself, not the value from the sequencer.  Since you cannot control the order of published data being applied; the only reliable way to build this is to do this in OnOnline scripts instead of OnSetText.  

     


    #XPression


  • 5.  RE: Logo Selection Issue

    Posted 12-04-2019 03:40

    Yep. It’s working now that I moved it to OnOnline.

    Does that mean that the rest of the scenes where it is working I just got lucky? I’m thinking I should probably move those scripts too.


    #XPression


  • 6.  RE: Logo Selection Issue

    Posted 12-04-2019 17:01

    Yes, you just got lucky.  It likely has to do with the order the objects were initially created; but their could be more variables than just that. 


    #XPression


  • 7.  RE: Logo Selection Issue

    Posted 12-04-2019 17:03

    Gotcha.  Thanks for your help, Brian!


    #XPression