Graphics

 View Only
  • 1.  Scritping Scene Directors

    Posted 11-19-2023 18:55

    I'm looking for a little help if possible. I have a Scene that has a few different scene directors(RaceReveal, RaceCover, RaceReset) attached to each Race (total of 3 Race Cars). I'm looking to play the scene online and trigger via keyboard mapping different scene directors when needed for each race care. Below is the script I'm working with but 50% of the time it works. When I trigger one scene director it also clears the other animations that were already triggered. Other times it will not reset/clear any scene directors that was already triggered.

    This is the script I'm using in my Keybaord/GPI Mapping.

    Dim Scene as xpScene
    dim sd as xpSceneDirector


    Engine.GetSceneByName("Race", Scene,False)

    Scene.SetOnline(5,0,0)

    Scene.GetSceneDirectorByName("RaceReveal", sd)

    sd.Play()
    sd.AutoStop = true

    Any input would be appreciated. Thank you.

    Eric R

    UPDATE: I was able to figure it out. For some reason I had to change Scene.SetOnline(5,0,0) to Scene.SetOnline(5,1,1) and it started working.

    ------------------------------
    ERIC RODRIGUEZ
    Xpression designer, and operator
    Phoenix Suns & Phoenix Mercury
    Phoenix
    ------------------------------



  • 2.  RE: Scritping Scene Directors

    Posted 11-20-2023 10:38

    So you might be coming up against an odd bug in which Engine doesn't always work. I've had this problems with materials and fixed it with "Project".

    Since use are using the variable name "Scene", which I don't recommend since depending on the script location that is a reserved word, I'll assume the local xpScene is using "Self" for this example.

    I'd recommend trying this:

    Dim myScene as xpScene
    Dim sd as xpSceneDirector

    Self.Project.GetSceneByName("Race", myScene, False)

    myScene.SetOnline(5,0,0)

    myScene.GetSceneDirectorByName("RaceReveal", sd)

    sd.Play()
    sd.AutoStop = True

    I cannot guarantee this will fix the problem, but it is worth a shot.

    VB does seem to be forgiving on case sometimes, but try to be consistent on the case of reserved words like Dim and booleans.



    ------------------------------
    Azathoth
    Son of Cthulhu
    ------------------------------



  • 3.  RE: Scritping Scene Directors

    Posted 11-21-2023 18:13

    Thank you. It worked. Shocked this bug is still around.



    ------------------------------
    ERIC R
    ------------------------------



  • 4.  RE: Scritping Scene Directors

    Posted 11-22-2023 17:55

    So you might be coming up against an odd bug in which Engine doesn't always work. I've had this problems with materials and fixed it with "Project".

    This is not a bug, an explanation of the behavior you are seeing:

    You should only run into this on systems and workflows that load multiple Projects into the XPression Engine. 

    Engine.GetThingByName targets the Active project loaded in XPression - the Project that is in bold in the in the 'Project Manager' list inside XPression. 

    XPression can load multiple projects at once, but only one can be active. You can make a Project Active by double clicking it or by using Engine.SetActiveProject

    Self.Project.GetThingByName looks in the same project as the one that contacts the scene/script. 

    Every Project has unique scenes, materials, fonts and widgets. So XPression needs to know where to look for something when multiple projects are loaded. 

    XPression MOS and Tessera workflows will often load multiple projects at once, so using Self.Project ensures your script run on the correct references. 

    Manually driven workflows usually only load one project at a time, but it depends. Master control and channel automation workflows sometimes use multiple projects and sometimes don't. 




  • 5.  RE: Scritping Scene Directors

    Posted 11-22-2023 18:07

    Below is the script I'm working with but 50% of the time it works. When I trigger one scene director it also clears the other animations that were already triggered. Other times it will not reset/clear any scene directors that was already triggered.

    Two things. Both not bugs. 

    1. I would switch from using .Play to .PlayRange. This ensures you are always recalling the exact frames of your animation you want to. And not counting on the scene director play head being at the correct position when you tell it to play.
    2. You should change
      Engine.GetSceneByName("Race", Scene,False)
      to
      Engine.GetSceneByName("Race", Scene,True)  ''or remove the True/False entirely and it will default to true

    Right now you are recalling the original scene from the project and putting it online, as if you bringing it online from Layout. This means the position of the scene director playhead in the XPression Layout interface, is competing with your script calling it to frame 0 or 1. 

    Additional, if you put original scenes online, the scripting garbage collector in XPression will eventually activate and clear your scene from the output, or cause other issues. 

    This would explain why you see inconsistent behavior with this scene. 

    Putting a scene copy online means the state of the original scene will not affect playout, and the garbage collector will not interfere with playout. 




  • 6.  RE: Scritping Scene Directors

    Posted 11-22-2023 18:20

    My suggestion would be to do this differently/ 

    I would not use the keyboard map to put the scene online. In my opinion, you should use the Sequencer (and any automation of the Sequencer) to handle all online/offline tasks. This ensures your CG operator, or anyone who monitors the system, can clearly see what the system is doing. With your current setup, the scene only shows online in the Output Monitors, not in the Sequencer. This can be very confusing for some operators. 

    To trigger your scene director playback, I would not target the scene by name in the project. Instead, I would target the scene directors, of any scene that is online, in a particular framebuffer/layer.

    In your keyboard/GPI map script: 

    dim output as xpOutputFramebuffer
    dim Scene as xpScene
    dim HomeDirector as xpSceneDirector
    
    Engine.GetOutputFramebuffer(0,output)
    output.GetSceneonLayer(5, Scene)
    Scene.GetSceneDirectorByName("SqueezeHome", HomeDirector)
    HomeDirector.Playrange(0,40)
    

    With a script like this, and by modifying it,  you can make more generic triggers in your keyboard/GPI map. For example you could:

    • expand the script to target multiple framebuffers or layers
    • easily make triggers to pause/start/rewind of online scenes
    • if you standardize naming of your Scene Directors (ex always using a Scene Director called "Reveal") you can have generic triggers that pause/start/rewind ANY scene that goes online with compatible naming