Announcement

Collapse
No announcement yet.

Programmatically check if the VRay license is valid

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Programmatically check if the VRay license is valid

    We have had some instances where someone from our team didn't set up their VRay license correctly, or there was some issue with the installation, or they didn't log, or something like that. Digging through the logs or even opening the menu is enough to figure out what happened (that there's no license active in the machine) and thus caused the script or rendering to fail, but is there any way at all to find out programmatically if there's a valid license in the system?

    Worst case scenario, I could parse the logs, but if there's a way through code or even some CLI way to do that (like a return code from an executable), that would be ideal for me.

  • #2
    you could check the existence and connectability of the license server from maxscript like so:
    Code:
    internet.CheckConnection url:@"https://localhost:30304" force:true​
    but beyond that, that i could tell, you're left with querying the licensing server log.
    https://docs.chaos.com/display/LIC5/Troubleshooting

    ​​​​​​​I'll try and find out if there's anything more specific i have missed and come back to you.
    Lele
    Trouble Stirrer in RnD @ Chaos
    ----------------------
    emanuele.lecchi@chaos.com

    Disclaimer:
    The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

    Comment


    • #3
      I have asked, and there is one method: you can run vray.exe with an empty vrscene (literally an empty textfile named empty.vrscene will do).
      Should a license not be found, it will return an error.

      Click image for larger version

Name:	image.png
Views:	97
Size:	24.6 KB
ID:	1194242

      Two things are worth noting:
      *) the process, from command start to failure, took about 3 seconds on my machine (where i had turned off the -reachable- license server), but it could be more for a hung connection.
      *) It took 135 megabytes of RAM to load the exe and libraries.

      If i had to choose in liberty, i'd be parsing license server logs.​
      Lele
      Trouble Stirrer in RnD @ Chaos
      ----------------------
      emanuele.lecchi@chaos.com

      Disclaimer:
      The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

      Comment

      Working...
      X