diff options
author | Ton Roosendaal <ton@blender.org> | 2004-11-07 02:22:06 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-11-07 02:22:06 +0300 |
commit | 82cae482e934888b9d99374201cdea0325c04f25 (patch) | |
tree | 46c4311325b3bf1f299a758f99eacc308f87fcdd /source | |
parent | 6423ccff411d34273143177f917ea014d1c341f8 (diff) |
Added undo in UV FaceSelect mode (3d window) and in UV Image window.
Brecht; can you give it a good test :)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/editface.c | 16 | ||||
-rw-r--r-- | source/blender/src/editsima.c | 17 | ||||
-rw-r--r-- | source/blender/src/header_image.c | 6 | ||||
-rw-r--r-- | source/blender/src/space.c | 14 |
4 files changed, 43 insertions, 10 deletions
diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index 4ed71a4408f..868257e3c83 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -608,6 +608,7 @@ void reveal_tface() tface++; } + BIF_undo_push("Reveil UV face"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); } @@ -644,6 +645,7 @@ void hide_tface() tface++; } + BIF_undo_push("Hide UV face"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); @@ -713,6 +715,7 @@ void select_linked_tfaces() } MEM_freeN(cpmain); + BIF_undo_push("Select linked UV face"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); } @@ -745,6 +748,8 @@ void deselectall_tface() } tface++; } + + BIF_undo_push("(De)select all UV face"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); } @@ -769,6 +774,7 @@ void selectswap_tface(void) tface++; } + BIF_undo_push("Select swap UV face"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); } @@ -834,6 +840,7 @@ void rotate_uv_tface() mface++; } + BIF_undo_push("Rotate UV face"); makeDispList(OBACT); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); @@ -935,6 +942,8 @@ void face_select() lasttface = tsel; /* image window redraw */ + + BIF_undo_push("Select UV face"); allqueue(REDRAWIMAGE, 0); allqueue(REDRAWBUTSEDIT, 0); allqueue(REDRAWVIEW3D, 0); @@ -1090,6 +1099,9 @@ void uv_autocalc_tface() case UV_LSCM_MAPPING: unwrap_lscm(); break; } + + if(mode>0) BIF_undo_push("UV calculation"); + } void set_faceselect() /* toggle */ @@ -1118,11 +1130,13 @@ void set_faceselect() /* toggle */ set_lasttface(); set_seamtface(); /* set TF_SEAM flags in tface */ } + BIF_undo_push("Set UV Faceselect"); } else if((G.f & (G_WEIGHTPAINT|G_VERTEXPAINT|G_TEXTUREPAINT))==0) { if(me) reveal_tface(); setcursor_space(SPACE_VIEW3D, CURSOR_STD); makeDispList(ob); + BIF_undo_push("End UV Faceselect"); } countall(); } @@ -1538,6 +1552,7 @@ void face_draw() persp(PERSP_WIN); + BIF_undo_push("UV face draw"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); allqueue(REDRAWHEADERS, 0); @@ -1604,6 +1619,7 @@ void get_same_uv(void) /* image window redraw */ + BIF_undo_push("Get same UV"); allqueue(REDRAWIMAGE, 0); allqueue(REDRAWVIEW3D, 0); } diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index 6c19fd4d2eb..c3624852201 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -780,6 +780,7 @@ void transform_tface_uv(int mode) tv->loc[1]= tv->oldloc[1]; } } + MEM_freeN(transmain); if(mode=='g') if(G.sima->flag & SI_BE_SQUARE) be_square_tface_uv(me); @@ -789,6 +790,10 @@ void transform_tface_uv(int mode) makeDispList(OBACT); allqueue(REDRAWVIEW3D, 0); + + if(event!=ESCKEY && event!=RIGHTMOUSE) + BIF_undo_push("Transform UV"); + scrarea_queue_headredraw(curarea); scrarea_queue_winredraw(curarea); } @@ -857,6 +862,8 @@ void mirrormenu_tface_uv(void) if(mode==1) mirror_tface_uv('x'); else if(mode==2) mirror_tface_uv('y'); + + BIF_undo_push("Mirror UV"); } @@ -893,6 +900,7 @@ void select_swap_tface_uv(void) } } + BIF_undo_push("Select swap UV"); allqueue(REDRAWIMAGE, 0); } @@ -1142,6 +1150,7 @@ void mouse_select_sima(void) force_draw(); + BIF_undo_push("Select UV"); std_rmouse_transform(transform_tface_uv); } @@ -1192,6 +1201,7 @@ void borderselect_sima(void) } } + BIF_undo_push("Border select UV"); scrarea_queue_winredraw(curarea); } } @@ -1367,6 +1377,7 @@ void hide_tface_uv(int swap) } } } + BIF_undo_push("Hide UV"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); } @@ -1387,6 +1398,7 @@ void reveal_tface_uv(void) if(!(tface->flag & TF_SELECT)) tface->flag |= (TF_SELECT|TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); + BIF_undo_push("Reveil UV"); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); } @@ -1526,6 +1538,7 @@ void stitch_uv_tface(int mode) if(G.sima->flag & SI_BE_SQUARE) be_square_tface_uv(me); if(G.sima->flag & SI_CLIP_UV) tface_do_clip(); + BIF_undo_push("Stitch UV"); allqueue(REDRAWVIEW3D, 0); scrarea_queue_winredraw(curarea); } @@ -1632,6 +1645,7 @@ void select_linked_tface_uv(void) } MEM_freeN(sortblock); + BIF_undo_push("Select linked UV"); scrarea_queue_winredraw(curarea); } @@ -1658,6 +1672,7 @@ void unlink_selection(void) } } + BIF_undo_push("Unlink UV selection"); scrarea_queue_winredraw(curarea); } @@ -1713,6 +1728,8 @@ void pin_tface_uv(int mode) } } } + + BIF_undo_push("Pin UV"); scrarea_queue_winredraw(curarea); } diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index aa4c2eef845..01d0a532c6d 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -112,7 +112,7 @@ void load_space_image(char *str) /* called from fileselect */ image_changed(G.sima, 0); } - + BIF_undo_push("Load image UV"); allqueue(REDRAWIMAGE, 0); } @@ -175,6 +175,7 @@ void replace_space_image(char *str) /* called from fileselect */ image_changed(G.sima, 0); } + BIF_undo_push("Replace image UV"); allqueue(REDRAWIMAGE, 0); } @@ -252,6 +253,7 @@ void do_image_buttons(unsigned short event) } /* also when image is the same: assign! 0==no tileflag: */ image_changed(G.sima, 0); + BIF_undo_push("Assign image UV"); break; case B_SIMAGELOAD: @@ -627,6 +629,7 @@ static void do_image_imagemenu(void *arg, int event) } } } + BIF_undo_push("Pack image"); allqueue(REDRAWBUTSSHADING, 0); allqueue(REDRAWHEADERS, 0); break; @@ -647,6 +650,7 @@ static void do_image_imagemenu(void *arg, int event) error("There are no packed images to unpack"); } } + BIF_undo_push("Unpack image"); allqueue(REDRAWBUTSSHADING, 0); allqueue(REDRAWHEADERS, 0); break; diff --git a/source/blender/src/space.c b/source/blender/src/space.c index f014942aca8..b673e3f545d 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -653,13 +653,12 @@ void BIF_undo(void) } else { - if (G.f & G_FACESELECT) - ; - else if(G.f & G_WEIGHTPAINT) + if(G.f & G_WEIGHTPAINT) wpaint_undo(); else if(G.f & G_VERTEXPAINT) vpaint_undo(); else { + /* now also in faceselect mode */ if(U.uiflag & USER_GLOBALUNDO) BKE_undo_step(1); } } @@ -677,13 +676,12 @@ void BIF_redo(void) } else { - if (G.f & G_FACESELECT) - ; - else if(G.f & G_WEIGHTPAINT) + if(G.f & G_WEIGHTPAINT) wpaint_undo(); else if(G.f & G_VERTEXPAINT) vpaint_undo(); else { + /* includes faceselect now */ if(U.uiflag & USER_GLOBALUNDO) BKE_undo_step(-1); } } @@ -702,9 +700,7 @@ void BIF_undo_menu(void) allqueue(REDRAWALL, 0); } else { - if (G.f & G_FACESELECT) - ; - else if(G.f & G_WEIGHTPAINT) + if(G.f & G_WEIGHTPAINT) ; else if(G.f & G_VERTEXPAINT) ; |