8

  I want to put a list with progression bars into a panel or somewhere else. Is it possible to place a custom image next to text? Or draw progress bars like the one in the header somewhere else?

I found this line in space_info.py: layout.template_running_jobs() but I'm not clear about how to find the corresponding code.

  My workarounds would be to use a crude text version of a progress bar or a slider. But my ideal thing would be a bar with colors of my own choosing.

Haunt_House
  • 16,049
  • 5
  • 48
  • 78

2 Answers2

1

No you can't (not without fairly bad hacks at least).

As of 2.69 this is a limitation in the Python API, layout.template_running_jobs() shows progress for blenders job system which Python has no access to.

You can however control the mouse cursor to display progress.

ideasman42
  • 47,387
  • 10
  • 141
  • 223
  • 'No, you can't at all' or just 'no, the thin progress bar is sacred as of now'? My goal is to visualize progress of something, not to explicitly use template_running_jobs(). I'd like a nice version in a panel, but if it's completely impossible, I'm prepared to use text files, even images in the image editor to work around. Progress report in a 3D panel comes to mind. or using grease pencil (: Scarcity makes inventive. So the main question remains: how can I visualize progress in a panel? – Haunt_House Sep 21 '13 at 19:55
  • The main answer remains - you can't, Well, I wouldn't know of any good ways to do this. You can of course draw ASCII art into a panel which represents a progress bar, or abuse a slider (and make it readonly), then use a timer+modalOperator to force regular redraws. But such code is really hackish and I wouldn't accept into Blender or consider it a supported function. – ideasman42 Sep 22 '13 at 01:20
  • 1
    I do not plan anything that requires to be accepted by you or others. But I am surprised by the limited means of blender's UI when it comes to visual communication. – Haunt_House Sep 28 '13 at 17:46
  • 1
    @Haunt_House, yep, Blender is limited in this respect. However I dont think its always such a bad thing, we only draw progress in the header info currently, so Python tools should follow this also. Then users get predictable experience and know what to expect. – ideasman42 Sep 29 '13 at 01:57
1

I haven't ever done this so it's just a thought, but could you use layout.split with increasing percentages as a slightly less crude progress bar? Perhaps with a blank operator button on the left and an empty label (or button with emboss=False) on the right. This should automatically stretch to fill the available space in the panel.

Search for 'split' in the Cookbook Code Snippets for some example usage.

Greg Zaal
  • 10,856
  • 3
  • 47
  • 86