"No scene camera is selected" in batch mode despite valid .sg structure
Environment:
OSPRay Studio version: 1.1.0
Platform: Windows 11
Mode: Batch mode (--batch)
I'm trying to render a scene in batch mode using a custom .sg file. The file includes a properly defined camera node with cameraToWorld, and it's connected via a frame node that includes camera, renderer, and world as children.
Despite this, OSPRay Studio fails with:
No scene camera is selected. using default camera...
and scene has still default camera.
As a result, the scene still uses the default camera.
OSPRay Studio OpenImageDenoise is available Batch mode !!! When loading a scene file (.sg), fewer command-line arguments are permitted. !!! If the application exits unexpectedly, please check below for errors, !!! remove any 'not expected' arguments and try again. ...importing files! Importing a scene Importing: C:\OBJ\export.obj ... found 170185 triangles and 0 quads. ...finished import! No scene camera is selected. using default camera... frame 1 variance inf frame 1 variance inf frame 2 variance 0.275454 Warning: saving a 32-bit float buffer as PNG; color space will be limited. Saved to C:\obj\render_output.png.00000.png ...finished!
The attached file contains my .sg scene for batch mode.
Question: How should I define the camera node in the .sg file so that it is correctly recognized in --batch mode?
I apologize for the delay in replying to this issue, I have since retired from Intel and do not check issues very often.
I was able to root cause this failure to a change in .../app/Batch.cpp between release v0.12.0 and v0.12.1. Commit bf4d8bc line 95.
There is a one-line change that should fix it on main branch if you can compile from source. Simply re-add the if (!sgScene) directly above updateCamera()
https://github.com/RenderKit/ospray-studio/blob/34fa3958243ac75185cb8d8cce8565841a4677cc/app/Batch.cpp#L109
else {
// Only update camera if not using a scene file, for scene file camera
// has already been set during import
if (!sgScene)
updateCamera();
render();
I do hope this is still useful to you.