Get Vray Version programatically?

Is there a way to get the installed VRay version through a python script? I don’t see an ENV Variable or a Registry Key.

I found you could run vray.exe -version and then regex the stdout but is there a better approach?

With maxscript you could use:
vrayversion()

or you could use:
getFileVersion(“$max/plugins/vrender2016.dlr”)
(assuming you’re checking in 2016)

They format the output slightly different

For the newest V-Ray versions (3.6.x) you can parse the first line from vraylog.txt file, located in %TEMP% in Windows, the version is stated in that line.

Thanks Ivan. How long does that %TEMP%\vraylog.txt file last though? And is it created without any renders being done? I’m trying to keep tabs on rendernode version numbers (so maxscript is out too). I have a solution using the exe -version flag. But it’s a little slow.

The vrayVersion() MaxScript command is the best way to get the exact version. It is available in V-Ray 3.6 as well.

Best regards,
Vlado

The log is created when you start 3dsMax with V-Ray installed and is re-created on every 3dsMax start. It’ll stay in the folder unless it’s deleted on purpose.