Graphics

 View Only
  • 1.  Live Updating Tug-of-war Bar Scripting

    Posted 10-05-2018 18:42
    Hey all,

    So I'm having a little trouble due to the lack of documentation about scripting. Admittedly, I don't know much about scripting of any kind.

    I'm basically trying to have a tug-of-war bar animate in with Datalinked values, and animate as the values are live-updated.
    I've created two scene directors, and three text objects for each field: an old, a new, and a display value. I've cobbled together a pretty barebones script to attempt to accomplish my goal, and it seems to compile fine, but doesn't work when I go live with the graphic. Any help would be greatly appreciated!

    Dim ctrl as xpAnimController

    scene.getAnimControllerByName("AnimController2", ctrl)

    Dim aold as xpTextObject
    Dim bold as xpTextObject
    Dim cold as xpTextObject
    Dim dold as xpTextObject
    Dim eold as xpTextObject

    Dim anew as xpTextObject
    Dim bnew as xpTextObject
    Dim cnew as xpTextObject
    Dim dnew as xpTextObject
    Dim enew as xpTextObject

    Dim ValueQuad1 as xpBaseObject
    Dim ValueQuad2 as xpBaseObject
    Dim ValueQuad3 as xpBaseObject
    Dim ValueQuad4 as xpBaseObject
    Dim ValueQuad5 as xpBaseObject

    ctrl.setKeyFramePosition(ValueQuad1, 0, aold.text, 100, 100)
    ctrl.setKeyFramePosition(ValueQuad2, 0, bold.text, 100, 100)
    ctrl.setKeyFramePosition(ValueQuad3, 0, cold.text, 100, 100)
    ctrl.setKeyFramePosition(ValueQuad4, 0, dold.text, 100, 100)
    ctrl.setKeyFramePosition(ValueQuad5, 0, eold.text, 100, 100)

    ctrl.setKeyFramePosition(ValueQuad1, 20, anew.text, 100, 100)
    ctrl.setKeyFramePosition(ValueQuad2, 20, bnew.text, 100, 100)
    ctrl.setKeyFramePosition(ValueQuad3, 20, cnew.text, 100, 100)
    ctrl.setKeyFramePosition(ValueQuad4, 20, dnew.text, 100, 100)
    ctrl.setKeyFramePosition(ValueQuad5, 20, enew.text, 100, 100)


  • 2.  RE: Live Updating Tug-of-war Bar Scripting

    Posted 10-08-2018 19:34
    I can't help you much with the scripting issue itself, but I can address the documentation issue. In the install folder of XPression there is a pdf SDK document which is basically a complete guide to XPression scripting, provided you understand the underlying concepts of scripting itself, which it appears you do.
    #XPression


  • 3.  RE: Live Updating Tug-of-war Bar Scripting

    Posted 10-08-2018 20:52
    This example has an example of a script that dynamically adds keyframes to an animation controller and plays it.

    https://transfer.rossvideo.com/f/273627d8ad30cf89

    #XPression