[Bf-python] mesh.update() without undo push
Stephen Swaney
sswaney at centurytel.net
Sat Mar 19 14:03:52 CET 2005
On Sat, Mar 19, 2005 at 03:35:27AM -0800, Gert De Roost wrote:
>
> This is why I would propose an optional "No Undo"
> argument to mesh.update(). One could then call
> mesh.update("No Undo") at every intermediate step of
> the realtime mesh update process, and only do a
> regular mesh.update() at the end, when the user
> validates the changes.
>
> This way, one press of Ctrl-Z will undo the entire
> operation of the script and previous operations will
> still be available for undo.
>
> There might be other methods for which this applies,
> for the moment I am only aware of the one
> (mesh.update). Maybe a global Blender.Undo(0/1)
> switch would be more appropiate ?
Without looking at the code involved ( or thinking too hard! ), I
wonder if a better solution is to provide access to the push and pop
functions of the undo stack. This would give the scripter control
over the stack in a way similar to the BeginTransaction and Rollback
commands in database programming. Most Bpy scripting *is*
manipulating Blender's database, after all.
Pushing and popping the undo stack would also apply to other datatypes
and be generally useful in scripts.
--
Stephen Swaney
sswaney at centurytel.net
More information about the Bf-python
mailing list