Despite my many attempts, I still haven’t figured out how to use the r_screenshot() function within a .cfg file when running Enscape standalone executable.
The Enscape config manual (produced using “g_writeManual 0”) simply mentions this:
r_screenshot(string): Take a screenshot and save it to the data directory
For the expected string param, I’ve tried specifying a file name, format extension (e.g. png), fully qualified path, scene name, etc. to no avail. :/. I must be missing smthing??
Could anyone share a simple .cfg script to take a single screenshot of a loaded scene + save it into a file?
For anyone interested, I finally managed to get it to work.
Turns out there were other commands following the r_screenshot one which apparently were simply overriding it. Adding a ‘waitfor_capture’ command right after r_screenshot solved that problem :)!
Here is a simple excerpt of a userPost.cfg script example that worked for me:
load some scene of interest + pre-recorded camera path
addDataDir MyScene/Data
map MySceneName
rec_loadPath MyScene/myCameraAnimPath.xml
setup camera to render scene looking at region of interest + take a screenshot
r_camera -0.5_10.5_2.0_0_1_0_0_0_1
r_screenshot myScreenshot.png
waitfor_capture
start benchmarking scene using camera path above
bm_start testing123
After this script gets executed, a screenshot png file will be saved under the Enscape standalone app ‘Data’ folder.
The need for a ‘waitfor_capture’ command wasn’t obvious to me so I hope this helps someone else who might get stuck as I did :}…