Graphics

 View Only
  • 1.  VBscript works in OnRender not in OnOnline

    Posted 04-23-2020 23:11

    I've built a bar graph with up to 20 bars that I want to animate on and have the text animate with the height of my bars. 

    To accomplish this I have six pages of Visual Logic and a long VBscript. With appreciable trial and error---emphasis on error---I made it work on Xpression Designer v9.0 build 4849 by including my VBscript in OnRender.

    I package the scene up and took it to my control room (running Xpression Studio v9.0 build 4849 64bit) and inserted it into my publish project and it failed to do a thing.

    I tried modifying my script...checked my Visual Logic for bugs...built a new version...nothing worked. I ran out of time in the control room and had to move back to Xpression Designer. I've tried to trim the script down, but it still only works in OnRender. By the way, it also didn't work in OnPreviewRender.

    Can anybody see a problem with the code? Is there possibly some difference between Designer and Studio versions that would be a problem? ...between Designer and the 64bit version in the control room?

    Thanks,

    James.

     

    dim BarGraphVertical as xpSceneDirector

    dim Stat1, Stat2, Stat3, Stat4, Stat5, Stat6, Stat7, Stat8, Stat9, Stat10, Stat11, Stat12, Stat13, Stat14, Stat15, Stat16, Stat17, Stat18, Stat19, Stat20 as xpTextObject
    dim StatReport1, StatReport2, StatReport3, StatReport4, StatReport5, StatReport6, StatReport7, StatReport8, StatReport9, StatReport10, StatReport11, StatReport12, StatReport13, StatReport14, StatReport15, StatReport16, StatReport17, StatReport18, StatReport19, StatReport20 as xpTextObject
    dim StatAdjust1, StatAdjust2, StatAdjust3, StatAdjust4, StatAdjust5, StatAdjust6, StatAdjust7, StatAdjust8, StatAdjust9, StatAdjust10, StatAdjust11, StatAdjust12, StatAdjust13, StatAdjust14, StatAdjust15, StatAdjust16, StatAdjust17, StatAdjust18, StatAdjust19, StatAdjust20 as xpTextObject
    dim Bar1, Bar2, Bar3, Bar4, Bar5, Bar6, Bar7, Bar8, Bar9, Bar10, Bar11, Bar12, Bar13, Bar14, Bar15, Bar16, Bar17, Bar18, Bar19, Bar20 as xpBaseObject
    dim BarAnim1, BarAnim2, BarAnim3, BarAnim4, BarAnim5, BarAnim6, BarAnim7, BarAnim8, BarAnim9, BarAnim10, BarAnim11, BarAnim12, BarAnim13, BarAnim14, BarAnim15, BarAnim16, BarAnim17, BarAnim18, BarAnim19, BarAnim20 as xpAnimController

    self.getscenedirectorbyname ("BarGraphVertical",BarGraphVertical)

    self.GetObjectByName ("Stat1", Stat1)
    self.GetObjectByName ("StatReport1", StatReport1)
    self.GetObjectByName ("StatAdjust1", StatAdjust1)
    self.GetObjectByName ("Bar1", Bar1)
    self.getAnimControllerbyname ("BarAnim1",BarAnim1)

    BarAnim1.SetKeyFrameValue(Bar1, 0, "Height", (1))
    BarAnim1.SetKeyFrameValue(Bar1, 24, "Height", CDbl(StatAdjust1.text))

    self.GetObjectByName ("Stat2", Stat2)
    self.GetObjectByName ("StatReport2", StatReport2)
    self.GetObjectByName ("StatAdjust2", StatAdjust2)
    self.GetObjectByName ("Bar2", Bar2)
    self.getAnimControllerbyname ("BarAnim2",BarAnim2)

    BarAnim2.SetKeyFrameValue(Bar2, 0, "Height", (1))
    BarAnim2.SetKeyFrameValue(Bar2, 24, "Height", CDbl(StatAdjust2.text))

    self.GetObjectByName ("Stat3", Stat3)
    self.GetObjectByName ("StatReport3", StatReport3)
    self.GetObjectByName ("StatAdjust3", StatAdjust3)
    self.GetObjectByName ("Bar3", Bar3)
    self.getAnimControllerbyname ("BarAnim3",BarAnim3)

    BarAnim3.SetKeyFrameValue(Bar3, 0, "Height", (1))
    BarAnim3.SetKeyFrameValue(Bar3, 24, "Height", CDbl(StatAdjust3.text))

    self.GetObjectByName ("Stat4", Stat4)
    self.GetObjectByName ("StatReport4", StatReport4)
    self.GetObjectByName ("StatAdjust4", StatAdjust4)
    self.GetObjectByName ("Bar4", Bar4)
    self.getAnimControllerbyname ("BarAnim4",BarAnim4)

    BarAnim4.SetKeyFrameValue(Bar4, 0, "Height", (1))
    BarAnim4.SetKeyFrameValue(Bar4, 24, "Height", CDbl(StatAdjust4.text))

    self.GetObjectByName ("Stat5", Stat5)
    self.GetObjectByName ("StatReport5", StatReport5)
    self.GetObjectByName ("StatAdjust5", StatAdjust5)
    self.GetObjectByName ("Bar5", Bar5)
    self.getAnimControllerbyname ("BarAnim5",BarAnim5)

    BarAnim5.SetKeyFrameValue(Bar5, 0, "Height", (1))
    BarAnim5.SetKeyFrameValue(Bar5, 24, "Height", CDbl(StatAdjust5.text))

    self.GetObjectByName ("Stat6", Stat6)
    self.GetObjectByName ("StatReport6", StatReport6)
    self.GetObjectByName ("StatAdjust6", StatAdjust6)
    self.GetObjectByName ("Bar6", Bar6)
    self.getAnimControllerbyname ("BarAnim6",BarAnim6)

    BarAnim6.SetKeyFrameValue(Bar6, 0, "Height", (1))
    BarAnim6.SetKeyFrameValue(Bar6, 24, "Height", CDbl(StatAdjust6.text))

    self.GetObjectByName ("Stat7", Stat7)
    self.GetObjectByName ("StatReport7", StatReport7)
    self.GetObjectByName ("StatAdjust7", StatAdjust7)
    self.GetObjectByName ("Bar7", Bar7)
    self.getAnimControllerbyname ("BarAnim7",BarAnim7)

    BarAnim7.SetKeyFrameValue(Bar7, 0, "Height", (1))
    BarAnim7.SetKeyFrameValue(Bar7, 24, "Height", CDbl(StatAdjust7.text))

    self.GetObjectByName ("Stat8", Stat8)
    self.GetObjectByName ("StatReport8", StatReport8)
    self.GetObjectByName ("StatAdjust8", StatAdjust8)
    self.GetObjectByName ("Bar8", Bar8)
    self.getAnimControllerbyname ("BarAnim8",BarAnim8)

    BarAnim8.SetKeyFrameValue(Bar8, 0, "Height", (1))
    BarAnim8.SetKeyFrameValue(Bar8, 24, "Height", CDbl(StatAdjust8.text))

    self.GetObjectByName ("Stat9", Stat9)
    self.GetObjectByName ("StatReport9", StatReport9)
    self.GetObjectByName ("StatAdjust9", StatAdjust9)
    self.GetObjectByName ("Bar9", Bar9)
    self.getAnimControllerbyname ("BarAnim9",BarAnim9)

    BarAnim9.SetKeyFrameValue(Bar9, 0, "Height", (1))
    BarAnim9.SetKeyFrameValue(Bar9, 24, "Height", CDbl(StatAdjust9.text))

    self.GetObjectByName ("Stat10", Stat10)
    self.GetObjectByName ("StatReport10", StatReport10)
    self.GetObjectByName ("StatAdjust10", StatAdjust10)
    self.GetObjectByName ("Bar10", Bar10)
    self.getAnimControllerbyname ("BarAnim10",BarAnim10)

    BarAnim10.SetKeyFrameValue(Bar10, 0, "Height", (1))
    BarAnim10.SetKeyFrameValue(Bar10, 24, "Height", CDbl(StatAdjust10.text))

    self.GetObjectByName ("Stat11", Stat11)
    self.GetObjectByName ("StatReport11", StatReport11)
    self.GetObjectByName ("StatAdjust11", StatAdjust11)
    self.GetObjectByName ("Bar11", Bar11)
    self.getAnimControllerbyname ("BarAnim11",BarAnim11)

    BarAnim11.SetKeyFrameValue(Bar11, 0, "Height", (1))
    BarAnim11.SetKeyFrameValue(Bar11, 24, "Height", CDbl(StatAdjust11.text))

    self.GetObjectByName ("Stat12", Stat12)
    self.GetObjectByName ("StatReport12", StatReport12)
    self.GetObjectByName ("StatAdjust12", StatAdjust12)
    self.GetObjectByName ("Bar12", Bar12)
    self.getAnimControllerbyname ("BarAnim12",BarAnim12)

    BarAnim12.SetKeyFrameValue(Bar12, 0, "Height", (1))
    BarAnim12.SetKeyFrameValue(Bar12, 24, "Height", CDbl(StatAdjust12.text))

    self.GetObjectByName ("Stat13", Stat13)
    self.GetObjectByName ("StatReport13", StatReport13)
    self.GetObjectByName ("StatAdjust13", StatAdjust13)
    self.GetObjectByName ("Bar13", Bar13)
    self.getAnimControllerbyname ("BarAnim13",BarAnim13)

    BarAnim13.SetKeyFrameValue(Bar13, 0, "Height", (1))
    BarAnim13.SetKeyFrameValue(Bar13, 24, "Height", CDbl(StatAdjust13.text))

    self.GetObjectByName ("Stat14", Stat14)
    self.GetObjectByName ("StatReport14", StatReport14)
    self.GetObjectByName ("StatAdjust14", StatAdjust14)
    self.GetObjectByName ("Bar14", Bar14)
    self.getAnimControllerbyname ("BarAnim14",BarAnim14)

    BarAnim14.SetKeyFrameValue(Bar14, 0, "Height", (1))
    BarAnim14.SetKeyFrameValue(Bar14, 24, "Height", CDbl(StatAdjust14.text))

    self.GetObjectByName ("Stat15", Stat15)
    self.GetObjectByName ("StatReport15", StatReport15)
    self.GetObjectByName ("StatAdjust15", StatAdjust15)
    self.GetObjectByName ("Bar15", Bar15)
    self.getAnimControllerbyname ("BarAnim15",BarAnim15)

    BarAnim15.SetKeyFrameValue(Bar15, 0, "Height", (1))
    BarAnim15.SetKeyFrameValue(Bar15, 24, "Height", CDbl(StatAdjust15.text))

    self.GetObjectByName ("Stat16", Stat16)
    self.GetObjectByName ("StatReport16", StatReport16)
    self.GetObjectByName ("StatAdjust16", StatAdjust16)
    self.GetObjectByName ("Bar16", Bar16)
    self.getAnimControllerbyname ("BarAnim16",BarAnim16)

    BarAnim16.SetKeyFrameValue(Bar16, 0, "Height", (1))
    BarAnim16.SetKeyFrameValue(Bar16, 24, "Height", CDbl(StatAdjust16.text))

    self.GetObjectByName ("Stat17", Stat17)
    self.GetObjectByName ("StatReport17", StatReport17)
    self.GetObjectByName ("StatAdjust17", StatAdjust17)
    self.GetObjectByName ("Bar17", Bar17)
    self.getAnimControllerbyname ("BarAnim17",BarAnim17)

    BarAnim17.SetKeyFrameValue(Bar17, 0, "Height", (1))
    BarAnim17.SetKeyFrameValue(Bar17, 24, "Height", CDbl(StatAdjust17.text))

    self.GetObjectByName ("Stat18", Stat18)
    self.GetObjectByName ("StatReport18", StatReport18)
    self.GetObjectByName ("StatAdjust18", StatAdjust18)
    self.GetObjectByName ("Bar18", Bar18)
    self.getAnimControllerbyname ("BarAnim18",BarAnim18)

    BarAnim18.SetKeyFrameValue(Bar18, 0, "Height", (1))
    BarAnim18.SetKeyFrameValue(Bar18, 24, "Height", CDbl(StatAdjust18.text))

    self.GetObjectByName ("Stat19", Stat19)
    self.GetObjectByName ("StatReport19", StatReport19)
    self.GetObjectByName ("StatAdjust19", StatAdjust19)
    self.GetObjectByName ("Bar19", Bar19)
    self.getAnimControllerbyname ("BarAnim19",BarAnim19)

    BarAnim19.SetKeyFrameValue(Bar19, 0, "Height", (1))
    BarAnim19.SetKeyFrameValue(Bar19, 24, "Height", CDbl(StatAdjust19.text))

    self.GetObjectByName ("Stat20", Stat20)
    self.GetObjectByName ("StatReport20", StatReport20)
    self.GetObjectByName ("StatAdjust20", StatAdjust20)
    self.GetObjectByName ("Bar20", Bar20)
    self.getAnimControllerbyname ("BarAnim20",BarAnim20)

    BarAnim20.SetKeyFrameValue(Bar20, 0, "Height", (1))
    BarAnim20.SetKeyFrameValue(Bar20, 24, "Height", CDbl(StatAdjust20.text))



  • 2.  RE: VBscript works in OnRender not in OnOnline

    Posted 04-24-2020 02:56

    So, I've kept trying to figure this out...and I realized that I had been declaring and self.getting Stat1, etc, and StatReport1, etc even though I wasn't doing anything with them. They were a hold-over from contemplating a VBscript solution to all the math in my Visual Logic pages...when there were bugs/broken blocks I eventually corrected.


    #XPression