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: 
DadOfTwo
Visitor

Setting roSGScene object on global

OK bear with me.

We're working on a legacy Roku box the Sky Now TV whitebox (based on the Roku LT) which is no longer supported, it's pinned at Roku Firmware 7.5.3. No more Roku OS updates due.

We're working thru the edge cases (runtimes) from our app that's targeting 8.1 OS. One is we're not able to access the m._main.getScene() Object from app/source Scope.

One way around this is to set the roSGScene object on global from main.brs:
globalAA = screen.getGlobalNode() 
globalAA.addFields({ sceneAA: screen.getScene() })


This is being passed around the app by reference. Can you see anything wrong with this approach?


Thanks
0 Kudos
5 REPLIES 5
DadOfTwo
Visitor

Re: Setting roSGScene object on global

Hi

Any devs with any views on adding getScene() to global scope?

Thanks
0 Kudos
squirreltown
Roku Guru

Re: Setting roSGScene object on global

I'm assuming that this works in your channel right now and you are asking about the future. SceneGraph is relatively new, so there's that, but Roku is pretty slow to remove things from the firmware. You're always at their mercy anyway, so if it was me I'd go with it and worry about it when it breaks. Who knows? There might be another solution when that day comes.
Kinetics Screensavers
0 Kudos
RokuNB
Roku Guru

Re: Setting roSGScene object on global

I don't see it wrong doing the above.

Albeit don't see it being necessary either - assuming you are using only one scene, you can always get that by calling m.top.getScene() from any thread (and in the main() thread can do that with screen.getScene())
0 Kudos
DadOfTwo
Visitor

Re: Setting roSGScene object on global

Ok, thanks.

I like your mañana approach, squirreltown 😄

This is a work around for 7.5.3 firmware, RokuNB. m.top doesn't exist when we need it in the main thread and in the render thread it's returning:

Brightscript Debugger> ?m.top.getScene()

Member function not found in BrightScript Component or interface. (runtime error &hf4) in $LIVECOMPILE(64)
0 Kudos
RokuNB
Roku Guru

Re: Setting roSGScene object on global

true that, getScene() says added in 7.6
https://sdkdocs.roku.com/display/sdkdoc ... -getScene()asroSGNode
if stuck at old FW version - by all means, do what you have to do to make it work!
0 Kudos