Replies: 3 comments
-
You should take a look at the ModelNode class, in it you have functions like playAnimation and setCulling that I think can help you with what you are looking for. I don't know how you have your scene configured but you can preload the models and render them whenever you want by adding them as children of the scene with the sceneView.addChildNode(myModelNode) function. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I'll take a look. To be cleared I'm hoping for my model to be visible just static and not pay for per frame rendering. Thanks |
Beta Was this translation helpful? Give feedback.
-
The animation won't play if you stopped it: |
Beta Was this translation helpful? Give feedback.
-
I'd like to be able to control the render cycle for the SceneView model.
Actually my requirement is to selectively enable/disable animation, and avoid render work for power savings when it's disabled.
Currently the render cycle is driven directly by Lifecycle, coming from LocalLifecycleOwner.current.lifecycle. This works for navigation or backgrounding.
But I'd like to use a Scene Composable mixed with other content. My test is currently using the damaged_helment mode with a rotation for testing. But it seems like it still spends as much power if I disable the rotation. Render is called on every frame, which the lifecycle is resumed.
I'd like to be selectively control when the model should be animated to save power. This might be only when the item is focused, and paused other wise.
Alternatively, is there something wrong with my code? Should the model avoid the cost of render per frame, if nothing is animated?
I have a POC that passes in a dummy lifecycle, and then drives the render myself.
This appears to work, but obviously isn't an API and maybe not the best way to solve the problem.
Beta Was this translation helpful? Give feedback.
All reactions