Graphics

 View Only
  • 1.  Scripting scene directors for a beginner (or idiot)

    Posted 01-25-2021 23:56

    Hi all, 

    Feel like this is something stupid simple that I'm missing and please excuse my newb-ness. 

    As background: I'm a software guy by trade, no formal XPression systems but have some downtime and seeing as I have 6 XPression Prime systems (3 are brand new and running Xpression 10, the other 3 are old and running Xpression 7) deployed on the way to around double that -- where we're currently using maybe 1% of XPression's capabilities I figured I'd do some "playing" to both stretch my legs and get to know XPression better. I'm using an Xpression Designer 7 license for my experimentation. Please be gentile :) 

    All of the systems are controlled 100% via automation (via CII) which may complicate the question a bit.

    I have a scene with a simple animation I want to come in when the scene is taken online and then reverse as the scene is taken offline. I have everything figured out except triggering the "out" animation. 

    In scripting I'm currently trying

    Sub OnBeforeOffline(engine as xpEngine, Self as xpScene, ByRef Handled as Boolean) 
    dim director as xpSceneDirector
    Self.GetSceneDirectorByName("Animation Out", director) 
    director.Play(True, 5) 

    When I try taking the scene offline with this code in place the scene director runs but the scene never goes offline. I've tried changing the WaitFor and TimeOut values in director.Play with no apparent effect (though the documentation I can find doesn't really describe what these parameters effect) 

    If I try adding a Self.SetOffline to the end of that I crash Xpression designer with 100% repeatability...so I'm sure that's not what I should be doing. 

    Thanks for any pointers!



  • 2.  RE: Scripting scene directors for a beginner (or idiot)

    Posted 01-26-2021 14:04

    As an update I can't put a finger on exactly what I changed but it is now working in Designer. 

    But new problem: Went to deploy it to one of the systems to see how well it worked in real life and came to the realization that scripting doesn't seem to be supported in Prime.

    So anyone know how I can pull this off solely in Visual Scripting? Seems like I can't be the first person that wants something to trigger as a scene is going offline


    #XPression


  • 3.  RE: Scripting scene directors for a beginner (or idiot)

    Posted 01-26-2021 17:17

    Since you have CII maybe you could update a text object in the scene to say something like "off" or "0" 

    Then use a block inside visual logic like compare or equal to, when that is true play the scene director called "Offline" 

    In the scene director called Offline you can have your out animation and an offline event at the end. 

     

     


    #XPression


  • 4.  RE: Scripting scene directors for a beginner (or idiot)

    Posted 01-27-2021 18:05

    Thanks, Simon, I'll give that a try next time I have a few free minutes -- seems like a neat trick to do what I want and also like it would give me some finer control over the interplay/timing between the animation and the scene going offline which was going to be my next challenge in Designer :) 

    Part of this exercise is to teach myself how to harness more of Xpression's power directly rather than use the the 'crutch' of what I know reasonably well (CII) to beat Xpression into submission -- this seems fare more graceful than some of the other CII methods I was thinking of. 

    Thanks again for the suggestion. 


    #XPression


  • 5.  RE: Scripting scene directors for a beginner (or idiot)

    Posted 01-27-2021 19:37

    Off the top of my head it should look like this I believe. 

    You will want a different scene director set at default (default is highlights in bold in the scene directors).

    This method may be limited to a 1 time only deal but I can come up with something more detailed if you need it to be able to happen multiple times. 

     


    #XPression


  • 6.  RE: Scripting scene directors for a beginner (or idiot)

    Posted 01-27-2021 19:46

    Thanks, Simon. 

    I'm actually making a copy of the scene before taking it to air each time (partially because I'm treating the source scene as a template with details filled into the copied scene via CII...not sure if that's really a valid reason or if it's actually a good idea but it's been working) so it seems if I set the "unmatched" value in the template scene it will be primed for a shot when the copy is made, I can fire CII to update the value in the copied scene and it will fire... and since that scene never gets to air again it doesn't matter that it's one-shot. Worst case I could update the value back to the unmatched state immediately after firing it so it's rearmed, right? 

     

    Thanks again for the suggestion and example -- really looking forward to getting some of the "must-do"s off my list so I can try this in real life. 


    #XPression


  • 7.  RE: Scripting scene directors for a beginner (or idiot)

    Posted 02-01-2021 19:20

    Simon, 

    Just to close the loop -- I had (or rather made) some free time to play with this this weekend and this works well. Thank you for the suggestion. 

    I was seeing an odd artifact where just before the scene went offline some parts of the animation seemed to 'snap back' to their default state  but was able to work around that by setting the alpha to 0 in the animation controller.  

    For anyone else who needs it in addition to your example above for the visual logic here's the CII command I'm using (with the hidden text object named "AnimationTrigger": 

    X\TEMPLATEDATA\9901\AnimationTrigger.Text\OFFLINE\\

    followed 1/2 second later by 

    X\TEMPLATEDATA\9901\AnimationTrigger.Text\RESET\\

    Just to "re-prime" it if needed. 


    #XPression