Announcement

Collapse
No announcement yet.

Python method for showing total render time...

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

  • Python method for showing total render time...

    So, I'm working on this project and I'm looking for make a post render script that displays the render time of the last completed frame on another device. I'm using python currently. I'm running into problems, because although it seems like it should be easy to implement a counter in a pre-render script and have it display that variable with a post render script I'm finding the python variables don't carry over from the pre-render script to the post-render script.

    So if I start out with in my pre-render script:

    import time
    start = time.time()

    And then in my post-render script have

    end = time.time()
    print end - start

    (this code works great if I just type it in the console window btw) It gives me the following error:
    # Error: line 0: NameError: file C:\Documents\maya\2014-x64\scripts\Finish.py line 6: name 'start' is not defined #

    Since the start variable was only defined in the pre-render script and not the post-render script.


    So, I guess my question is, is there any python scripting that can interface directly with vray? I know vray can display the time it took to render the last frame at the bottom of each frame, is there any python command that will display that in the console window or anything to that effect?
    Hope that makes sense.

    Thanks!

  • #2
    AFAIK, we have no script support to expose the render time hold in the VFB. However using the pre/post render callbacks should be pretty simple. I'm not quite sure how you enter these scripts, but it's trivial to declare 2 python functions somewhere and use a global variable to store the starting time.
    V-Ray/PhoenixFD for Maya developer

    Comment

    Working...
    X