Three functionalities in one commit, but there's overlap so I can't
separate it... 1) Curve/Surface editmode undo Uses same syntax as mesh undo, so simple to integrate. Edit-curve data is also quite simpler, so no need for any hack at all. It re-uses the undo system from next point, which is nice short & clean local code 2) Framework for global undo The undo calls themselves are commented out. In a next commit I want to enable it for a couple of main features, for further feedback. The speed goes surprisingly well, especially with this new version that 'pushes' undo after a command, ensuring interactivity isnt frustrated 3) framework for texture based icons in Blender Not activated code, but tested here. Part of 2.3 UI project. btw: Johnny Matthews will assist in (and complete) the undo project
This commit is contained in:
@@ -4576,8 +4576,11 @@ void transform(int mode)
|
||||
}
|
||||
if(mode=='w' && G.obedit==0) return;
|
||||
|
||||
if (G.obedit && G.obedit->type == OB_MESH) {
|
||||
undo_push_mesh(transform_mode_to_string(mode));
|
||||
if (G.obedit) {
|
||||
if(G.obedit->type == OB_MESH)
|
||||
undo_push_mesh(transform_mode_to_string(mode));
|
||||
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
|
||||
undo_push_curve(transform_mode_to_string(mode));
|
||||
}
|
||||
|
||||
/* what data will be involved? */
|
||||
@@ -7424,6 +7427,8 @@ void mirror_edit(short mode) {
|
||||
TransVert *tv;
|
||||
|
||||
if(G.obedit->type==OB_MESH) undo_push_mesh("Mirror"); /* If it's a mesh, push it down the undo pipe */
|
||||
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
|
||||
undo_push_curve("Mirror");
|
||||
|
||||
make_trans_verts(min, max, 0);
|
||||
Mat3CpyMat4(mat, G.obedit->obmat);
|
||||
|
||||
Reference in New Issue
Block a user