1

This is for a final project in college. I'm working on making a stand alone GUI based application that lets you queue render jobs and launch the background render for Blender by launching in the command line. I would like to add a progress bar on my application to track the status of a render. Once done rendering, it marks complete, and moves on to the next render in the queue but I'm not sure if there's a way to receive a signal on its progress from Blender.This is not an add-on. This is a separate application in C++ and QT Quick.

If I could at least get a clue as to how to keep pinging the process until it ends, that would be a great start. I could just have the application mark it as rendering or finished. A solution on C++ alone would be just as helpful as I can then implement the concept through QT.

But the most complex solution would be to get a status on the progress of the render so I can track the percentage to completion.

  • https://en.wikipedia.org/wiki/Inter-process_communication, I think this is too broad, You need to pick one IPC and focus on it. – Rama Apr 10 '17 at 15:52
  • I'm sorry, I'm still learning. When you say IPC, you mean an operating system and framework? – LetTheWritersWrite Apr 10 '17 at 16:04
  • Inter Process Communication mechanism, see wikipedia link – Rama Apr 10 '17 at 16:05
  • Ideally you'd have blender output running progress in text, and read the child process output (this is reading a pipe, which is a form of IPC). I have no idea if blender offers this, though. Second best would be to monitor the size of the output file, which only works if you know how big it should end up, and it isn't too aggressively buffered. – Useless Apr 10 '17 at 16:07
  • It's not clear to me I you want to start the background renderer from C++/Qt or not. – m7913d Apr 10 '17 at 16:17
  • I added more details to my question. Yes, I want to start blender from my own application. What I have very little knowledge of is how to communicate with the external process. – LetTheWritersWrite Apr 10 '17 at 17:29

1 Answers1

1

When you start the blender process to do the rendering you want to capture STDOUT, probably by using a pipe, to get blenders progress output during the render. Then parse the output to see where it is up to.

The output from blender internal and cycles differs a little but is constant enough to parse easily.

BI progress line -

Fra:1 Mem:14.83M (0.00M, Peak 14.93M) | Time:00:00.01 | Scene, Part 3-240

Cycles progress line -

Fra:1 Mem:22.75M (0.00M, Peak 46.20M) | Time:00:00.51 | Remaining:00:02.63 | Mem:8.81M, Peak:32.25M | Scene, RenderLayer | Path Tracing Tile 7/240

Both start with some extra lines during initialization. The first number is the frame being rendered while the last two numbers are the tile just finished and the total tiles to be rendered, these are rarely finished in numeric order so you will want a list or count of finished tiles to know the progress.

The final line will be Blender quit

Also note that you can use blenders CLI arguments to adjust the rendering being done. This means you can render all frames in an animation with -a, you can render a range of frames with -s 5 -e 10 -a or you can render a list of frames by adding them individually -f 5 -f 7 -f 12

sambler
  • 6,917
  • 1
  • 16
  • 23
  • Ah, this is a great clue. No one has introduced us to named pipes and all that in school yet. So, by capturing the STDOUT, is that going to be a string? Or is there a way I can actually access the time remaining value. – LetTheWritersWrite Apr 11 '17 at 02:32
  • Thinking on a high level, I'm thinking to have a progress bar I would initialize the bar's max value to the initial time remaining. Then run a loop to check every 2 seconds init time-remaining time and have the bar fill up until 0 remaining. Am I on the right track? – LetTheWritersWrite Apr 11 '17 at 02:38
  • On *nix systems a [pipe](https://en.wikipedia.org/wiki/Pipeline_(Unix)) is used to send output of one app to the input of another, usually as a text stream. I don't use qt to get specific but a quick search shows [this](http://stackoverflow.com/q/3861948/2684771) and [this](http://stackoverflow.com/questions/9685615/qt-and-linux-pipes#9686343) should help explain what you are looking for. – sambler Apr 11 '17 at 03:10