Announcement

Collapse
No announcement yet.

MaxScript - Check if DR host on postrender

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

  • MaxScript - Check if DR host on postrender

    Hello,

    we have a MaxScript tool that runs a process when the render finishes by adding a #postRender callback to the scene. The problem is that when using distributed render the callback is executed by all the machines that help on the render task. Is there a way to identify from MaxScript if the machine executing the code is the host or one of the slaves so we can run the process only once?

    We are mainly using VRay 3.6 on Max 2017 at the moment.

    Regards
    Last edited by Codi; 27-06-2018, 03:26 AM.

  • #2
    If the host is always the same, you could probably stick something like this in an if statement: sysInfo.computername
    Kind Regards,
    Morne

    Comment


    • #3
      Thanks Morne, unfortunately we use different hosts. Maybe if I find a way to store the sysInfo.computername of the machine that starts the job this would do the trick? Will test that.

      Comment


      • #4
        Hello,

        If you are using V-Ray spawner to start Max - it sets an environment variable "VRAYSPAWNER" with value "TRUE". Then in MAXScript you can use
        Code:
        systemTools.getEnvVariable "VRAYSPAWNER"
        to check for that variable - if present then this Max is running DR jobs.

        Best regards,
        Yavor
        Yavor Rubenov
        V-Ray for 3ds Max developer

        Comment


        • #5
          This worked perfectly, thanks Yavor!

          Comment

          Working...
          X