Graphics

 View Only
  • 1.  script to set text object

    Posted 03-23-2018 15:03
    I want to learn how to write a script to set the text in a text object when the scene loads in the sequencer.
    Where is a good place to start?
    Is there a *complete* example that explains how to do this?

    This is what I have so far.
    Scene OnLine event...

    Dim text1 as xpTextObject
    Self.GetObjectByName("text1", text1)
    text1.Text = "blah blah blah"


  • 2.  RE: script to set text object

    Posted 03-23-2018 17:47
    Hi !

    Your example is complete...

    On your scene (left part of Xpression), right click and go into script editor.

    If you want to execute your code when the scene goes online, choose "OnOnline" (double click on it).
    In editor part, put your code.

    Now, when your scene goes online, your text object called "Text1" has its value updated to "blah blah blah".

    #XPression


  • 3.  RE: script to set text object

    Posted 03-23-2018 17:57
    Hi -
    That is what I did. I put this code into the scene's OnLine event editor. When I load the scene into the sequencer the text does not update in the preview window.
    #XPression


  • 4.  RE: script to set text object

    Posted 03-23-2018 19:36
    Thanks - it works. It updates the video out, not the preview window.
    #XPression


  • 5.  RE: script to set text object

    Posted 03-24-2018 01:30
    If you want to update preview, you can put the script in OnPreviewRender.

    If you put it in OnPrepare it will run on both Preview and when going online (it runs while the scene is preparing, i.e. loading all assets into memory).
    #XPression