[Bf-committers] Question regarding RNA_property_update().

Campbell Barton ideasman42 at gmail.com
Thu Apr 25 23:41:05 CEST 2013


On Fri, Apr 26, 2013 at 7:33 AM, patrick boelens <p_boelens at msn.com> wrote:
> Quick update: I found the region while fixing the offset issue (forgot to call
> ui_window_to_block()). Calling ED_region_tag_redraw(data->region) does indeed fix the issue. I'd still be curious to know as to why RNA_property_update() isn't working as expected for future reference, but no worries if you have other things to do, at least I got my little wishlist working. =P
>

Calling ED_region_tag_redraw is no good, checked the patch.
The reason RNA_property_update doesn't work is the button doesnt
reference any RNA where though its rna from &but->rnapoin,
but->rnaprop - they are NULL and crash for me.

Instead it relies on but->funcN callback, see use of 'RNAUpdateCb'

So probably best to do what 'paste' does and fake user button editing:

button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
... edit colorband ...
button_activate_state(C, but, BUTTON_STATE_EXIT);

This works for colorband delete.


More information about the Bf-committers mailing list