Discussion:
[Bf-python] Is it possible to read the Operator props while in its draw() function?
Dalai Felinto
2013-09-24 22:36:08 UTC
Permalink
Hi,

I have an operator that has a custom draw function (invoked by
wm.invoke_props_dialog()).

I was wondering if I can read the properties in the class as they are set
by the user before the 'OK' button is pressed.

For example, if the user picks 'A' in an enum, I would like to show
different options than if 'B' is selected.

The attached sample script should illustrate this properly. I wasn't sure
if I'm doing something wrong, if this is a bug, or if this is in someone's
todo list. This is something I think it would be really useful.

Thanks,
Dalai
--
blendernetwork.org/dalai-felinto
www.dalaifelinto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-python/attachments/20130924/393a700e/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.py
Type: application/octet-stream
Size: 1543 bytes
Desc: not available
Url : http://lists.blender.org/pipermail/bf-python/attachments/20130924/393a700e/attachment.obj
Campbell Barton
2013-09-25 04:30:08 UTC
Permalink
Post by Dalai Felinto
Hi,
I have an operator that has a custom draw function (invoked by
wm.invoke_props_dialog()).
I was wondering if I can read the properties in the class as they are set by
the user before the 'OK' button is pressed.
For example, if the user picks 'A' in an enum, I would like to show
different options than if 'B' is selected.
The attached sample script should illustrate this properly. I wasn't sure if
I'm doing something wrong, if this is a bug, or if this is in someone's todo
list. This is something I think it would be really useful.
Thanks,
Dalai
--
blendernetwork.org/dalai-felinto
www.dalaifelinto.com
Currently this isn't supported, it could be made to work (in 2.4x we
had this kind of pop-up),
But it had to re-create the popup for every draw so it wasn't so nice
implementation wise.
--
- Campbell
Loading...