android: allow modelviewer to reset (#9813)

- Add reset functionality to ModelViewer
 - We use this reset in render-validation to not have to reload
   the scene in runs that use the same model.
 - Fix a bug where the camera manipulator is disabling setting
   the camera via view config.
This commit is contained in:
Powei Feng
2026-03-19 11:11:46 -07:00
committed by GitHub
parent 0d2ecb5436
commit 5007b4e428
3 changed files with 41 additions and 1 deletions

View File

@@ -175,7 +175,7 @@ class MainActivity : Activity(), ValidationRunner.Callback {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
choreographer = Choreographer.getInstance()
modelViewer = ModelViewer(surfaceView)
modelViewer = ModelViewer(surfaceView=surfaceView, manipulator=null)
inputManager = ValidationInputManager(this)
// Initialize IBL

View File

@@ -81,6 +81,17 @@ class ValidationRunner(
}
private fun startModel(modelName: String) {
if (currentModelName == modelName) {
Log.i("ValidationRunner", "Reusing model $modelName")
callback?.onStatusChanged("Reusing $modelName for ${currentTestConfig?.name}")
modelViewer.resetToDefaultState()
frameCounter = 0
currentState = State.WARMUP
return
}
currentModelName = modelName
val modelPath = config.models[modelName]
if (modelPath == null) {