[Bf-committers] Question regarding RNA_property_update().
p_boelens at msn.com
Fri Apr 26 01:30:05 CEST 2013
D'ow, I'm such a noob when it comes to the Blender source; this makes far more sense and looks 1000x better, thanks Brecht!
I originally just wanted the changes working for my case and leave it it at that, but I moved the code and added a few extra keys (enter to confirm, escape/RMB to cancel) in case anyone wants this as well or if there's any interest in adding it to the trunk.
The full patch is at www.pasteall.org/41734/diff.
Thanks for all the help guys!
> From: brechtvanlommel at pandora.be
> Date: Thu, 25 Apr 2013 23:59:23 +0200
> To: bf-committers at blender.org
> Subject: Re: [Bf-committers] Question regarding RNA_property_update().
> This code should be in the function ui_do_but_COLORBAND() unless there
> is a good reason not to? Key shortcuts for specific button types are
> handled in these ui_do_but_*() functions per type.
> For the delete case you should not call RNA_property_update or
> ED_undo_push. Probably the easiest is to just use these two lines:
> button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
> button_activate_state(C, but, BUTTON_STATE_EXIT);
> It's not quite number editing that happens but the updates are the same.
> On Thu, Apr 25, 2013 at 10:48 PM, patrick boelens <p_boelens at msn.com> wrote:
> > Hey Campbell,
> > Thanks for your quick response. I'm not sure where I should get the region from, but I uploaded a patch. The line of interest is 53 in the diff, 5473 in the applied C file.
> > Thanks!
> > : http://www.pasteall.org/41731/diff
> >> Date: Fri, 26 Apr 2013 06:37:11 +1000
> >> From: ideasman42 at gmail.com
> >> To: bf-committers at blender.org
> >> Subject: Re: [Bf-committers] Question regarding RNA_property_update().
> >> On Fri, Apr 26, 2013 at 6:07 AM, patrick boelens <p_boelens at msn.com> wrote:
> >> > Hey everyone,
> >> >
> >> > I figured I'd add in some quick hotkeys for the Colorband in Blender such as Shift+D to duplicate an element, X to remove one, etc. I got this mostly working, except for a weird offset at start when dragging and, my main issue I want to ask about, updating the RNA to immediately show the changes without having to mouse-out of the area.
> >> >
> >> > I have added the actions in interface_handlers.c ->
> >> > ui_do_button() like so. The problem lies with the RNA_property_update() call, though I'm not sure why. If anyone can point me in the right direction here it'd be much appreciated!
> >> >
> >> > Thanks in advance,
> >> > Patrick
> >> Does tagging the region for redraw help?
> >> ED_region_tag_redraw(ar);
> >> Even if it does it shouldn't be required, the update function should
> >> send notifiers so views on this data are refreshed.
> >> Its hard to guess though so suggest to post a patch.
> >> _______________________________________________
> >> Bf-committers mailing list
> >> Bf-committers at blender.org
> >> http://lists.blender.org/mailman/listinfo/bf-committers
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
> Bf-committers mailing list
> Bf-committers at blender.org
More information about the Bf-committers