Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
John_Carter
Level 7

How to change the interpolator(s) on a Roku Scenegraph animation node?

(also cross-posted to SO: https://stackoverflow.com/questions/46480537/how-to-change-the-interpolators-on-a-roku-scenegraph-animation-node)

Taking an example from the Roku SDK docs:


<Animation id="transAnimation"
      duration="1"
      repeat="true"
      easeFunction="linear" >
   <Vector2DFieldInterpolator id = "myInterp2"
       key="[0.0, 1.0]"
       keyValue="[ [640.0, 320.0], [100.0, 100.0] ]"
   fieldToInterp="myPoster.translation" />
</Animation>


After I've done a find on "transAnimation" is it possible to change the interpolator in brightscript code? There are interpolators present in the XML, but after the scenegraph is built they no longer appear as children of my animation node.
Specifically, my use case is that I'd like to add "reverse=True" (added in FW 7.7) to all my interpolators to play an animation in forward or reverse arbitrarily without having two separate animation nodes.
0 Kudos
1 Reply
joetesta
Level 10

Re: How to change the interpolator(s) on a Roku Scenegraph animation node?

Yes you can do that, find the interpolators with m.top.findNode("myInterp2") and modify the reverse value to your heart's content Smiley Very Happy
HOWEVER, I just went through this last week and for some reason we could not get it to work on Roku 4 despite it having 7.7 (worked fine on 1, 3, and ultra), so rather than goof around with it for hours I went back to adding a separate animation to handle the reverse.
(can I get SO points if i answer there too? Smiley Happy Smiley Happy 
aspiring
0 Kudos