Hi all! I’m working on a way to get render stats from a blender process running in the background. I’ve been looking at the render_stats() callback but it doesn’t seem to get the stats, it gets a None instead.
I searched around the git log but can’t find exactly when/why this changed. Is this a bug or is there another way to get the stats? I’d like to avoid parsing stdout if I can
There were never render stats passed to Python I’m afraid. The code in that patch can’t work since the render stats would have to RNA wrapped and exposed, just casting it to an ID* makes no sense.
As far as I know the only solution is to capture stdout.
Simplest would be to just pass the string that is printed to stdout, or the values in that string as separated by |. More complicated would be to pass some structured data, but the render API doesn’t have a mechanism for renderers to provide that, so that’s probably more work that you’d want to tackle.
Think I’ll try to pass the string that gets printed, and then when/if the API gets extended try to add support for passing a dict. Embedding the values in a string with | would remove the need for a regex but feels kind of fragile.