View Only
  • 1.  SetKeyframeValue help

    Posted 3 days ago

    I'm working on a banner that I'd like to have dynamically scale via Transition Logic.  The banner changes width based on the length of a textbox, and the goal is to have it expand and shrink when going back-to-back with another quad revealing the text.  The ending Position.X of the revealing quad should match the width of the banner.  I'm currently stuck getting that quad's Position.X to update using SetKeyFrameValue (I have a scene director that I'd like to update a keyframe with that value).  The script is below.  Any help is appreciated!  Thank you.


    'script to set banner elements

    engine.DebugMessage("****START SET X POSITION SCRIPT****",0)


    dim objPlate, objMask as xpBaseObject

    dim animText as xpAnimController

    dim animKey as xpKeyFrame

    dim varFrame as integer

    'retrieve scene objects

    Scene.GetObjectByName("Plate Main", objPlate)

    Scene.GetObjectByName("Plate Mask", objMask)

    Scene.GetAnimControllerByName("Text WIPE", animText)

         animText.GetKeyFrame(objMask, "Position.X", 30, animKey)

    engine.DebugMessage("Objects Retrieved",0)


    'set x position based on banner plate scale

    engine.DebugMessage("Current Mask X Position = " & animKey.Value,0)

    engine.DebugMessage("Current Plate Width = " & Text,0)


    If Text = "0.850" Then

         varFrame = -849

         engine.DebugMessage("Condition A",0)

    Else If Text = 1 Then

         varFrame = -660

         engine.DebugMessage("Condition B",0)

    End If


    animText.SetKeyFrameValue(objMask, 30, "Position.X", CDbl(varFrame))

    engine.DebugMessage("New Mask X Position = " & animKey.Value,0)

    engine.DebugMessage("****END SET X POSITION SCRIPT****",0)


    John Robbins
    Graham Media Group INC