Outputting progress

   1379   2   1
User Avatar
Member
207 posts
Joined: Nov. 2015
Offline
Hi there;

I have a TOP graph that uses a ROP Fetch to render a sequence of images. I'd like to cobble together a Python script that periodically outputs progress as the images are rendered. Currently the render runs in-process on my local machine; after the ROP fetch, I have a Python script node that just does something like:


import hou
current_frame = hou.frame()
print(" Frame", current_frame, "complete.")

This sort of works; I get an output message once each frame renders, except the output is always:

"Frame 1.0 complete."

I'm curious what I could use other than hou.frame() to correctly output the frame that is/was rendered?
User Avatar
Staff
600 posts
Joined: May 2014
Offline
If this is a Python Script TOP, you an use work_item.frame to access the frame value associated with the work item, which will be set to the same frame as the parent work item that's doing the render.
User Avatar
Member
207 posts
Joined: Nov. 2015
Offline
Thank you so much! This works splendidly.

A slightly-related question: I notice when my render TOP (which is a ROP Fetch of a USD render LOP) executes, it seems to cook the resulting work items in a wonky 'diagonal' pattern, rather than sequentially. I can't recall this always being the case for me, so I'm not sure if this is default behavior or if I've inadvertently twiddled a setting somewhere to cause this.

Is the execution order for ROP fetches controllable? This isn't a huge deal, but it does make playback of in-progress animation sequences a bit weird, so I'm curious if I can state that I'd like the tasks to run sequentially (which is to say: in ascending-by-frame-number order).

[BEAUTIFUL SHELVES] Rendering animation...
[BEAUTIFUL SHELVES] Frame range: 1 - 52
[BEAUTIFUL SHELVES] Frame 1 of 52 complete.
[BEAUTIFUL SHELVES] Frame 2 of 52 complete.
[BEAUTIFUL SHELVES] Frame 6 of 52 complete.
[BEAUTIFUL SHELVES] Frame 7 of 52 complete.
[BEAUTIFUL SHELVES] Frame 13 of 52 complete.
[BEAUTIFUL SHELVES] Frame 14 of 52 complete.
[BEAUTIFUL SHELVES] Frame 19 of 52 complete.
[BEAUTIFUL SHELVES] Frame 20 of 52 complete.
[BEAUTIFUL SHELVES] Frame 21 of 52 complete.
[BEAUTIFUL SHELVES] Frame 26 of 52 complete.
[BEAUTIFUL SHELVES] Frame 27 of 52 complete.
[BEAUTIFUL SHELVES] Frame 32 of 52 complete.
[BEAUTIFUL SHELVES] Frame 33 of 52 complete.
[BEAUTIFUL SHELVES] Frame 39 of 52 complete.
[BEAUTIFUL SHELVES] Frame 40 of 52 complete.
[BEAUTIFUL SHELVES] Frame 3 of 52 complete.
[BEAUTIFUL SHELVES] Frame 4 of 52 complete.
[BEAUTIFUL SHELVES] Frame 5 of 52 complete.
[BEAUTIFUL SHELVES] Frame 8 of 52 complete.
[BEAUTIFUL SHELVES] Frame 9 of 52 complete.
  • Quick Links