Graphics

 View Only
Expand all | Collapse all

Script running scene directors

  • 1.  Script running scene directors

    Posted 02-21-2023 19:52

    I have an Xpression scene with a batting order. I have an Object that highlights each batter as we move through the lineup. There is an individual scene director for each change from batter 1 to 2, 2 to 3, etc. The below script works from batters 1 to 9. What I can't figure out is why I can't get the scene director to run when I move from batter 9 to 1.  If I take the scene offline and then back online with the batter 1 selected, then the scene director runs as it comes online. I assume it has something to do with the order of the script. I am not a seasoned scripter, so I'm hoping it's a simple fix that this community of experts can easily see.

    Thanks in advance for your help.

    dim ab1 as xpTextObject
    dim ab2 as xpTextObject
    dim ab3 as xpTextObject
    dim ab4 as xpTextObject
    dim ab5 as xpTextObject
    dim ab6 as xpTextObject
    dim ab7 as xpTextObject
    dim ab8 as xpTextObject
    dim ab9 as xpTextObject

    Dim move1 as xpSceneDirector
    Dim move2 as xpSceneDirector
    Dim move3 as xpSceneDirector
    Dim move4 as xpSceneDirector
    Dim move5 as xpSceneDirector
    Dim move6 as xpSceneDirector
    Dim move7 as xpSceneDirector
    Dim move8 as xpSceneDirector
    Dim move9 as xpSceneDirector

    Self.GetObjectByName("at bat data 1", ab1)
    Self.GetObjectByName("at bat data 2", ab2)
    Self.GetObjectByName("at bat data 3", ab3)
    Self.GetObjectByName("at bat data 4", ab4)
    Self.GetObjectByName("at bat data 5", ab5)
    Self.GetObjectByName("at bat data 6", ab6)
    Self.GetObjectByName("at bat data 7", ab7)
    Self.GetObjectByName("at bat data 8", ab8)
    Self.GetObjectByName("at bat data 9", ab9)

    Self.GetSceneDirectorByName("anim1", move1)
    Self.GetSceneDirectorByName("anim2", move2)
    Self.GetSceneDirectorByName("anim3", move3)
    Self.GetSceneDirectorByName("anim4", move4)
    Self.GetSceneDirectorByName("anim5", move5)
    Self.GetSceneDirectorByName("anim6", move6)
    Self.GetSceneDirectorByName("anim7", move7)
    Self.GetSceneDirectorByName("anim8", move8)
    Self.GetSceneDirectorByName("anim9", move9)

    If ab1.Text=1 then
    move1.Play()
    Else If ab2.Text=1 then
    move2.Play()
    Else If ab3.Text=1 then
    move3.Play()
    Else If ab4.Text=1 then
    move4.Play()
    Else If ab5.Text=1 then
    move5.Play()
    Else If ab6.Text=1 then
    move6.Play()
    Else If ab7.Text=1 then
    move7.Play()
    Else If ab8.Text=1 then
    move8.Play()
    Else If ab9.Text=1 then
    move9.Play()
    End If



    ------------------------------
    Matt Finlayson
    Brigham Young University
    ------------------------------


  • 2.  RE: Script running scene directors

    Posted 02-21-2023 21:11

    for starters, if you use move9.Play(0,30) however long it is, then each time it plays it will basically "reset" when it plays again. From the looks of it, your scene director plays and then just sits there at the end, but if you set a start and end, it will play exactly that much of the scene director. Also, you can say dim ab1, ab2, ab3, ab4, ab5 as xpTextObject just to simplify it a bit. I hope this helps.



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 3.  RE: Script running scene directors

    Posted 02-21-2023 22:12

    Thanks for the quick reply, Mal. Great suggestion. Still doesn't seem to be working for me. The scene directors play fine when I play sequentially. I can go from batter 3 to 4 or from 4 to 7, but not if I want to go from batter 3 to batter 2 or 1.  Or batter 9 to 1. I adjusted the script to include the move9.Play(0,60) where ("delay","end of scene director"). I'm including the scene here, if anyone wants to take a look at it or test some theories.

    https://byu.box.com/s/yoxsa1i6s2erhx7374xum1oxsbb1wl1h

    Thanks.



    ------------------------------
    Matt Finlayson
    Brigham Young University
    ------------------------------



  • 4.  RE: Script running scene directors

    Posted 02-21-2023 22:18

    I made a mistake it should be Playrange(0, 30). Give that a try



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 5.  RE: Script running scene directors

    Posted 02-21-2023 22:27
    Same results, unfortunately.

    Matt Finlayson
    Manager, Live Event Content Creation
    BYU AV
    301.332.6626 Cell
    801.422.0180 Office
    1030B ITB





  • 6.  RE: Script running scene directors

    Posted 02-21-2023 22:30

    Grrr.....maybe it's because I'm a Ute fan, up in SLC. I will snag your scene and play around with it.



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 7.  RE: Script running scene directors

    Posted 02-21-2023 22:35
    Leave it to a Ute to sabotage BYU. �� Just kidding. Thank you for your help.

    Matt Finlayson
    Manager, Live Event Content Creation
    BYU AV
    301.332.6626 Cell
    801.422.0180 Office
    1030B ITB





  • 8.  RE: Script running scene directors

    Posted 02-21-2023 22:53

    Can you share the dashboard grid file too? Also, I see you have it on the OnRender tab. Why there? Trying to wrap my head around this. BTW, Red from Ross Video will have it solved before you and I wake up tomorrow. He is in Great Britain.



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 9.  RE: Script running scene directors

    Posted 02-21-2023 23:13
    Here's the dashboard and a screenshot of the dashboard. The yellow box highlights the checkboxes that I use to indicate current player at bat. This is datalinqed with the "at bat data" in the Xpression scene.
    If I put the script in OnOnline, it will only run an animation when the scene goes from offline to online. I don't know if OnRender is the correct place for my script. It seemed to make sense for a script that should run when the scene is already online. I could be wrong though. I'm still learning scripting.
    Matt Finlayson
    Manager, Live Event Content Creation
    BYU AV
    301.332.6626 Cell
    801.422.0180 Office
    1030B ITB






  • 10.  RE: Script running scene directors

    Posted 02-21-2023 23:22

    Looks great. Could you have a single text object (hidden) with a script on it that would change every time there is a change in that text value? aka OnSetText, rather than on the entire scene. You could put the if else script there, and it would look at the value and run a scene director based on the value of that text.



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 11.  RE: Script running scene directors

    Posted 02-21-2023 23:44
    I'm not sure how I would change the text value on a single hidden text object. However, I have 9 hidden text objects which receive a 0 or 1 based on whether or not the checkbox in Dashboard is active or not. Your suggestion got me thinking that maybe I could have each of those have an OnSetText script. This is what I tried, but it didn't work. Do I need an "Else if" statement too? If so, what would that look like? Any thoughts?

    dim ab1 as xpTextObject

    Dim m1 as xpSceneDirector

    Self.GetObjectByName("at bat data 1", ab1)

    Self.GetSceneDirectorByName("anim1", m1)

    If ab1.Text=1 then
    m1.Playrange(0,110)
    End If

    Matt Finlayson
    Manager, Live Event Content Creation
    BYU AV
    301.332.6626 Cell
    801.422.0180 Office
    1030B ITB





  • 12.  RE: Script running scene directors

    Posted 02-21-2023 23:58

    I see what you mean. And I really like the layout of your dashboard. Very easy to get comfortable with it. I guess what I'm saying is to build a series of 10 buttons to take the place of your checkboxes. If you made them toggle buttons then you could click on 1, and 9 would turn off, click on 2 and 1 turns off...and so on. These would send a value of 1-9 to your datalinq and you could use another blind text object to receive that data. Then you would just deal with one text object that can receive 1-9 or 10. and your if loops would be something like

    if text = "1" then m1.PlayRange (0,30)

    else if text = "2" then m2.PlayRange (0,30)

    If you build it on a text object it will just look at the text value of that object so you don't have to use AB.text. But you would change "self" to "engine" since self refers to the text object.

    and so on. 

    I'm just shooting from the hip. I don't want you to redesign if you don't want to. This is just more inside my comfort zone.



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 13.  RE: Script running scene directors

    Posted 02-22-2023 04:12

    Hey guys, you were headed in the right direction, this is what I do for the same thing. 

    I have one scene director that moves all the highlights and then my script looks simply like this. 

    This goes on text object linked to an integer coming from my dashboard onSetText

    dim Hlite as xpSceneDirector


    scene.GetSceneDirectorByName("Lineup_Highlight", Hlite)

    'Move SD Highlight


        if text = "1"
            Hlite.Play
            Hlite.Position = 241
        else if text = "2"
            Hlite.PlayRange(0,30)
            Hlite.AutoStop = true
        else if text = "3"
            Hlite.PlayRange(31,60)
            Hlite.AutoStop = true
        else if text = "4"
            Hlite.PlayRange(61,90)
            Hlite.AutoStop = true
        else if text = "5"
            Hlite.PlayRange(91,120)
            Hlite.AutoStop = true
        else if text = "6"
            Hlite.PlayRange(121,150)
            Hlite.AutoStop = true
        else if text = "7"
            Hlite.PlayRange(151,180)
            Hlite.AutoStop = true
        else if text = "8"
            Hlite.PlayRange(181,210)
            Hlite.AutoStop = true
        else if text = "9"
            Hlite.PlayRange(211,240)
            Hlite.AutoStop = true
        end if
        


        
    My scene director looks like this

    Ignore the pauses they are just for testing that track is turned off now.  

    The last event is for playing 1 to 9.

    That's why you'll see that if = 1 is slightly different. 



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 14.  RE: Script running scene directors

    Posted 02-22-2023 12:08

    I really like the single scene director idea. See Matt, I told you. :)



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 15.  RE: Script running scene directors

    Posted 02-22-2023 13:03

    Thanks, Red. I appreciate the suggestion. I created a hilite control text object and applied the script to OnSetText. I was able to get the scene to work if I were to type in number 1-9 in the template data and hit Take. My challenge now is how to populate that text object with a number and to run while the scene is still online. The scene remains online throughout an inning. My Dashboard gives a 0 or 1 value when a certain batter is up. I have hidden text objects that receive that data. For example,  "at bat data 1", "at bat data 2", and so on. I tried adding the below script to the same hilite control text object, just above the script you shared. It was unsuccessful though. I'll keep trying some things. Let me know if you have any thoughts.

    dim ab1, ab2, ab3, ab4, ab5, ab6, ab7, ab8, ab9 as xpTextObject

    Self.GetObjectByName("at bat data 1", ab1)
    Self.GetObjectByName("at bat data 2", ab2)
    Self.GetObjectByName("at bat data 3", ab3)
    Self.GetObjectByName("at bat data 4", ab4)
    Self.GetObjectByName("at bat data 5", ab5)
    Self.GetObjectByName("at bat data 6", ab6)
    Self.GetObjectByName("at bat data 7", ab7)
    Self.GetObjectByName("at bat data 8", ab8)
    Self.GetObjectByName("at bat data 9", ab9)

    If ab1.Text= "1" then
    Text= "1"
    else if ab2.Text= "1" then
    Text= "2"
    Else If ab3.Text= "1" then
    Text= "3"
    Else If ab4.Text= "1" then
    Text= "4"
    Else If ab5.Text= "1" then
    Text= "5"
    Else If ab6.Text= "1" then
    Text= "6"
    Else If ab7.Text= "1" then
    Text= "7"
    Else If ab8.Text= "1" then
    Text= "8"
    Else If ab9.Text= "1" then
    Text= "9"
    End If



    ------------------------------
    Matt Finlayson
    Brigham Young University
    ------------------------------



  • 16.  RE: Script running scene directors

    Posted 02-22-2023 13:12

    In my dashboard it makes an integer value 1 through 9 

    Visually it looks like this;

    In the XPression scene the value of that integer is in a textbox with liveupdate checked.

    This text object has the onsettext script I shared earlier. 
    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 17.  RE: Script running scene directors

    Posted 02-22-2023 13:45

    Do you mind sharing your Dashboard grid with me? I'm curious how you've set it up. My Dashboard has some intricacies that I don't want to break if I make changes.

    Thanks.



    ------------------------------
    Matt Finlayson
    Brigham Young University
    ------------------------------



  • 18.  RE: Script running scene directors

    Posted 02-22-2023 14:13

    I can't share this one as I am building it for a client.

    All it is is an integer Array parameter that I have chosen to display as radio buttons. 

    I then drew a simple grid and forced it to 1 column width.

    Chose my parameter and placed it in the grid. 

    I have moved just the parameter and display object to a separate panel for you to look at though. 

    I couldn't put a .grid file here so here's a link;

    example grid file

     

     



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 19.  RE: Script running scene directors

    Posted 02-22-2023 14:31

    Matt, 

    Here is your dashboard that I have revised putting Red's array choice in place of your checkboxes. Parameter is Z_order



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 20.  RE: Script running scene directors

    Posted 02-22-2023 14:32

    That was nice of you Mal, good work. 

    I think the Forum removed the .grid file from your post. 



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 21.  RE: Script running scene directors

    Posted 02-22-2023 14:35

    can't upload. Says it must be a supported file. Matt, send me a private message here with a good email.



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 22.  RE: Script running scene directors

    Posted 02-22-2023 19:12

    Mal and Red,

    I can't thank you enough for your expertise and suggestions. I was able to get it working the way I intended thanks to your help. Here's what it looks like:

    https://byu.box.com/s/cfiwxuugg8e4h6wjhtalp128qtuz7ie1



    ------------------------------
    Matt Finlayson
    Brigham Young University
    ------------------------------



  • 23.  RE: Script running scene directors

    Posted 02-22-2023 19:26

    Excellent work Matt. Which way did you go, several scene directors or just the one? If this is for the field board I have to take in a Cougar ballgame. Thank you for letting me tinker around a little.



    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 24.  RE: Script running scene directors

    Posted 02-23-2023 04:12

    No problem, pleased you got the result you wanted. 



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------