[Bf-committers] undo fun :)

Johnny Matthews bf-committers@blender.org
Sat, 31 Jul 2004 09:15:13 -0500


A great step in the right direction here! One problem is the
independant undo chains of object and edit mode. Say you do this...

Create Cude
Rotate in Object Mode
Enter Editmode
Move a Vert
Leave Edit mode
Undo Object Mode Rotation

You end up with the original cube with it's original location,  not
the unrotated edited cube or the undo of the edit mode changes but
both. Perhaps if leaving editmode was an object level undo push it
would make more sense. Just thinking.

On Sat, 31 Jul 2004 14:42:02 +0200, Ton Roosendaal <ton@blender.org> wrote:
> Hi,
> 
> Couldn't resist trying a hackish idea for undo as almost exists for
> ages:
> Idea was to (ab)use the quick file read/write feature Blender has. For
> each undo step it saves a file in the Blender temp directory.
> 
> I've tried .blend files up to 5 MB, and that's still behaving OK. The
> most obvious negative side effects are of course recreating
> displaylists and drawing lists for particles, which all happens 'on
> load'. Also a bit 'weird' is that it completely restores everything,
> including UI changes.
> 
> To keep the test simple I've only added undo in the transform() for
> now. Also only works in Object Mode. Use UKEY and SHIFT+UKEY. In the
> console you can see test prints.
> 
> Didn't commit it, since we're in freeze, so I add the patch to this
> mail. :)
> You can see it's very little code with a nice cycling list usage. Apply
> the patch in source/blender/src, there are no include file changes.
> 
> -Ton-
> 
> 
> 
> 


-- 
Johnny Matthews
johnny.matthews@gmail.com