Graphics

 View Only
Expand all | Collapse all

Triggering a different scene with Script

  • 1.  Triggering a different scene with Script

    Posted 05-31-2022 13:34
    I'm trying to have a different scene come online when a Object is triggered on. It's flame animation linked to the pitch speed, when it's above 90, the Flame animation triggers on and then clears it's self. Right now I can't get the scene to trigger on when it happens. This is the code I have currently:

    dim fire as xpBaseObject
    dim animates as xpAnimController
    dim scene as xpSceneDirector
    dim takeitem as xpTakeItem


    scene.GetSceneDirectorByName("Fire Animation", animates)
    self.GetObjectByName("Fire Home", fire)
    self.GetOnline(5, 21)

    if fire.visible then
    engine.sequencer.GetTakeitemByID(5, takeitem)
    takeitem.Execute

    end if

    I'm not sure where I'm going wrong, Thank you for all help!

    ------------------------------
    Alexa McGlade
    Live Event Producer
    UCF
    ------------------------------


  • 2.  RE: Triggering a different scene with Script

    Posted 06-01-2022 08:28
    Is this in a tessera situation? Are you firing an LED ribbon or something like that? A quick fix would be to already have that scene on line and just trigger the scene director to animate it.

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



  • 3.  RE: Triggering a different scene with Script

    Posted 06-01-2022 09:34
    This is on our Tessera. We're firing it on our main board where out pitching stats box is. We tried that at first and then had a problem with it looping since our pitch speed doesn't clear itself for 15 seconds. Would it be simpler to just have the coding to hide that object at the end of its animation instead?

    ------------------------------
    Alexa McGlade
    Live Event Producer
    UCF
    ------------------------------



  • 4.  RE: Triggering a different scene with Script

    Posted 06-01-2022 09:44
    If it's consistently up for 15 seconds then yeah that's a simple fix. I've always been a fan of "keep it simple".So, if it was an element in your Stats box, couldn't you trigger a scene director that makes it fire? Don't let me lead you in a direction you don't want to go.

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



  • 5.  RE: Triggering a different scene with Script

    Posted 06-01-2022 09:50
    This is my first time programing anything like this, I'm pretty unfamiliar with triggering scene directors. It is up for 15 seconds consistently, the simpler the better for me right now!

    ------------------------------
    Alexa McGlade
    Live Event Producer
    UCF
    ------------------------------



  • 6.  RE: Triggering a different scene with Script

    Posted 06-01-2022 09:53
    You could pull this off using visual logic too. But I support trying scripting first just to get comfortable with it. Plus visual logic fires every frame, using script fires once. I take it you have your script on "onSetText"


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



  • 7.  RE: Triggering a different scene with Script

    Posted 06-01-2022 10:04
    I have Visual Logic triggering the flames on since we only wanted it linked to our pitchers stats, and I was trying to script it on the scene "Object" in the manager if that makes sense, on "OnOnline".

    ------------------------------
    Alexa McGlade
    Live Event Producer
    UCF
    ------------------------------



  • 8.  RE: Triggering a different scene with Script

    Posted 06-01-2022 10:12
    If you worked it on the text object that displays the speed then it would PROBABLY only fire when that text field changed. And if that text field was over 90, then it would trigger your animation.

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



  • 9.  RE: Triggering a different scene with Script

    Posted 06-01-2022 10:16
    Are you trying to trigger a different scene or an animation in same scene?

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



  • 10.  RE: Triggering a different scene with Script

    Posted 06-01-2022 10:22
    Its a different scene, but I suggested just moving the flames animation to the scene that is already on line and triggering a scene director for it.

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



  • 11.  RE: Triggering a different scene with Script

    Posted 06-01-2022 10:24
    I was trying it both ways, I wasn't sure which way was better.

    ------------------------------
    Alexa McGlade
    Live Event Producer
    UCF
    ------------------------------



  • 12.  RE: Triggering a different scene with Script

    Posted 06-01-2022 10:26
    I would do it as a seperate scene if you plan on playing the fire over many different scenes but if its always over the same scene I'd put into one. It'll make the scripting much easier or means you can use VL instead if you're more comfortable with that.

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



  • 13.  RE: Triggering a different scene with Script

    Posted 06-01-2022 10:37
    It's only on the one scene, should I script it on the Speed text object or on the scene since I have the visual logic to trigger it on when the text is above 90 and when our pitcher is up?

    ------------------------------
    Alexa McGlade
    Live Event Producer
    UCF
    ------------------------------



  • 14.  RE: Triggering a different scene with Script

    Posted 06-01-2022 12:16
    You could probably just have something like this.



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



  • 15.  RE: Triggering a different scene with Script

    Posted 06-01-2022 23:36
    I sent her this script to play with.

    dim sd as xpSceneDirector

    if text > 89 then
    scene.GetSceneDirectorByName("fire", sd)
    sd.PlayRange(0,100)

    end if

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



  • 16.  RE: Triggering a different scene with Script

    Posted 06-02-2022 08:32
    It's also a good habit to add;

    sd.AutoStop = true

    after play or playrange. 

    The SDK says :
    Per default an Animation controller sets its PlayState to ps_Paused so it will retain ownership of the objects it is controlling. When AutoStop is set to True the animation controller will change its PlayState to ps_Stopped instead of ps_Paused when the end of the timeline has been reached."

    The reason I do it and why it can be useful is if you have scripts the rely on knowing if other scene directors states are. 



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



  • 17.  RE: Triggering a different scene with Script

    Posted 06-02-2022 12:30
    Thanks Red, I’ll add it to my tool kit.

    Sent from my iPhone