Graphics

 View Only
  • 1.  How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-05-2014 09:17
    For example, I have backplate panels that I am overlaying text into. The text panels were designed to hold two lines of text. But instead of publishing position and manually adjusting in each take item when I only have one line of text, I would like single lines of text to automatically "drop" a few pixes downward, effectively centering them within the text panels. Make sense?

    Thanks for any help.


  • 2.  RE: How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-05-2014 13:09
    I haven't experimented with this yet but my first thought is that you could add a [I]Value Block[/I] and apply the value of the height of your [I]Text Boundry Box[/I] with just two lines of text. And then use a Less Than Or Equal To to see if your current Boundry Box Height is smaller than the Value you entered.

    Add a second [I]Value Block[/I] with the number of pixels you'd like to move your text. Use [I] Selector/Object.PosY/Add Blocks[/I] to adjust your text.

    #XPression


  • 3.  RE: How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-06-2014 00:42
    I'm sure there are much more sophisticated scripts that could be used, but here is just a very simple example of one way to do it..

    Put this in OnOnline and OnPreviewRender for the scene, and adjust the number as necessary to achieve the look you want..



    dim textobject as xpTextObject

    self.GetObjectByName("Text1", textobject)

    if textobject.LineCount < 2 then

    textobject.PosY = textobject.PosY - 60

    end if



    #XPression


  • 4.  RE: How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-06-2014 00:48
    Ok, thanks, that looks like what I am after. I still am having issues figuring out how/where to start/make a script. Where would I enter this text? And how do I get to the script editor box? You showed me once in KC, but I seem to have trouble finding the scripting mode when I look for it.

    Thanks, Brian.

    #XPression


  • 5.  RE: How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-06-2014 00:52
    From layout mode, you can right-click on the Scene thumbnail in the "Scene manager" and click on "Edit Script Events...".

    Copy/paste the script into the appropriate script (in the case both OnOnline, and OnPreviewRender). You need to then click the lightning bolt or press F7 to compile BOTH scripts. You'll either get errors at the bottom, or it will compile and the red X becomes a green checkmark. You need to recompile anytime the script is edited.

    To see the effect of the scripts, you should flip to sequence mode and you can edit the template data to see the preview with the script applied.

    #XPression


  • 6.  RE: How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-06-2014 04:12
    Ok, I may have just realized a problem. I may have a version of the software that is not capable of running scripts. When I mentioned earlier that i was having trouble finding the scripting box, it's because the option wasn't there when I right-clicked on a scene. But...if I hit the keyboard shortcut SHFT+CTRL+E, the script box will pop up. But either I did something wrong with the script, or it is not actually being run. I tested at home on my laptop with Designer version, and the script ran fine. But here at the office on the CG machines, we have Prime 5.15. So does that mean I am out of luck for scripting on these boxes?

    sf

    #XPression


  • 7.  RE: How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-06-2014 12:03
    As a follow-up, I realized that I could see the results of the script on my text in the preview window, but the Y Position change was not made to the text being output. Does this mean I do not have scripting capability on the Prime 5.15 box?

    sf

    #XPression


  • 8.  RE: How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-06-2014 12:20
    Correct, Prime does not support scripting nor 3D models and a few other limitations as well.

    http://www.rossvideo.com/pdf/cutsheets/xpression/xpression_series_product_comparison.pdf

    #XPression


  • 9.  RE: How can I script logic to 'lower my text' a few pixels, if there is only one line of text

    Posted 06-06-2014 14:14
    It is possible to run Studio edition software on the Prime hardware chassis; so there is a cheaper upgrade path to Studio edition without requiring the purchase of new hardware.

    #XPression