Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
John_Carter
Visitor

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 1
joetesta
Roku Guru

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 😄
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? 🙂 🙂 
aspiring
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.