[Bf-committers] undopushes and using tools inside of tools

Matt Ebb matt at mke3.net
Thu Apr 13 13:45:06 CEST 2006


Undo is a UI level feature, as in, when a user presses undo, it  
undoes the last thing the user did - the most recent discrete command  
which the user actually chose. The internals of how that singular UI  
level command is built up from other functions is unimportant, I  
think we can all agree on this.

Therefore, it makes the most sense to me to keep undo pushes  
completely out of all functions that perform editing functionality  
and have them occur within the function that handles the user's input  
on the a UI level, since that's when you can be sure it's been  
specifically chosen by the user. Right now, that can be in multiple  
places due to the current state of duplicated code for hotkeys/menus/ 
toolbox. Hopefully the unified tools API will solve this. For what  
it's worth, for now I'd say it's best to make a wrapper function that  
does the undo push, or put it in the (perhaps duplicated) UI level  
code that triggers the command. I really don't think that undo pushes  
have any business being in the internals of editing functions.

Matt


On 13/04/2006, at 18:35 PM, Tom M wrote:

> right now a lot of editmesh functions use te removedoublesflag
> function which does its own undopush, and EdgeLoopDelete, which uses
> both select_more and removedoubles flag both of which do their own
> undopush.
>
> This gives two problems, one is that for EdgeLoopDelete, you need to
> undo twice for it to undo correctly.
>
> The second is that undo pushes are being tagged wrongly since they are
> actually being carried out as part of a larger function.
>
> So, should we add a flag to these functions on whether to do an
> undopush?  So that the undopush can be handled at the correct spot and
> naming?  Or is there a different way that it would be prefered to do
> this?
>
> Briggs, GuitarGeek or others?
>
> LetterRip
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>



More information about the Bf-committers mailing list