[Bf-committers] Redrawing Operator Dialog Boxes

Campbell Barton ideasman42 at gmail.com
Sat May 31 04:15:39 CEST 2014

On Sat, May 31, 2014 at 5:00 AM, Andrew Peel <dev.andrewpeel at gmail.com> wrote:
> For the Fluid Designer Project we utilize Operator Dialog Boxes a lot. They
> provide a quick and intuitive way of accessing properties. I am curious to
> know how I would go about allowing the interface to redraw. Unlike Panels
> the draw function only gets called once. So if I wanted to have a checkbox
> that changes the way the dialog box is displayed I need to cancel the
> operator then reopen the dialog box. In the API there is a check(context)
> function that checks the operators settings and returns True to signal a
> change to redraw. I believe this only redraws the editor space. Would it be
> possible to have this redraw the dialog box interface as well, or would it
> be possible to allow the operator dialog to redraw the same way panels do.
> I am still learning how to navigate and modify Blenders Source, but I can
> typically find what I need if I am pointed in the right direction. Any
> information on this would be greatly appreciated.
> Also I have never used the Bf-committers mailing list, so if I should be
> asking these types of questions somewhere else then please let me know.
> Thanks.

This has come up a few times before, IIRC Ton wasn't keen on supporting this.
The current popups are designed around menus which are meant to be static.

In fact in 2.4x it was possible to do this.
Though the method used wasn't so great, the popup was removed and
re-created each time - but from user point-of-view it was OK.

If you want to look into it,search for uiBlockCreateFunc,
uiBlockHandleCreateFunc - and see how they're used.

Id suggest to do this by keeping the popup region (ARegionType -
RGN_TYPE_TEMPORARY). and re-run the creation function
(uiBlockCreateFunc), but this will need a bit of refactoring.

More information about the Bf-committers mailing list