Graphics

 View Only
  • 1.  Where to put scripts (which event).

    Posted 06-24-2016 20:33
    I have set up a series of widgets and drop downs that work in conjunction to set up a series of scenes. It's one scene that can be configured in many ways. For example, it takes team1 and team2 names and chooses a number of textures applied to a number of quads in the scene.

    The question is, I have the sequencer open, and when I choose something from a text list widget, it gets applied to the team name in all of sequencer items using that team (that's correct), but on which event do I put my script so that I can be sure it's executed? Keep in mind, I know I can apply it to text changed on a text field, but I have six widgets. I want an update (the script executed) no matter which one I change.

    Should it be a scene script event? If so, which one? If it gets taken directly (via Ross Talk, for example) it should work, but it should also work if I focus it so that I can see a preview.

    Is there a description of what all the events are? Sorry - I'm a programmer, not a graphics operator, so it might be obvious to some, but I don't know what "OnOnline" is as opposed to "OnSceneOnline" or if "OnRender" is a superset of "OnPreviewRender".

    So, just again, in a nutshell - I should be able to change something on any of a half dozen widgets, and when a scene that utilizes that widget is focused or taken, the script should run first so that it works both when taken or previewed (focused).

    Should I apply the script multiple places? Like on every text object that can be changed by any widget?


  • 2.  RE: Where to put scripts (which event).

    Posted 06-25-2016 07:50
    Hi,

    For what you need, prefer OnOnline and OnPreviewRender.

    OnOnline is fired when your current scene goes online. -> [I]here you will update all your scene object depending your widget.[/I]
    OnSceneOnline is fired when a scene of your project goes online.
    OnRender is fired each frame when scene is online.
    OnPreviewRender is fired when Xpression needs to preview your scene (when you select a takeitem in sequencer ie). -> [I]here you will update all your scene object depending your widget, in order to be shown to your operator in his preview window.[/I]
    #XPression


  • 3.  RE: Where to put scripts (which event).

    Posted 06-30-2016 21:38
    Thanks; I ended up figuring out OnOnline and OnPreviewRender (and made the big mistake of trying OnRender, at one point). Just was thinking there could be just one event that would work for both focusing and taking directly (without focus). But it's fine... I just cut and paste.

    #XPression