diff options
author | Johnny Matthews <johnny.matthews@gmail.com> | 2005-12-23 18:20:27 +0300 |
---|---|---|
committer | Johnny Matthews <johnny.matthews@gmail.com> | 2005-12-23 18:20:27 +0300 |
commit | 1276dd73ef71ead8026a683d30e8e9a6e435f9a5 (patch) | |
tree | 092b62829c73cfd5bc2c16a79376d311a81f079a | |
parent | 04e24d868e997a882dba539f8a62a49674038cb4 (diff) |
Some bugreports from the orangers for Shape Vert Copy :)
1. Selection is now not lost on cancel
2. Subsurf now Updates
3. MMB copys at 100% immediately
4. Full copy removed from menu since due to #3
-rw-r--r-- | source/blender/include/BIF_editmesh.h | 2 | ||||
-rw-r--r-- | source/blender/src/editmesh_tools.c | 50 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 7 |
3 files changed, 24 insertions, 35 deletions
diff --git a/source/blender/include/BIF_editmesh.h b/source/blender/include/BIF_editmesh.h index a722554cfcb..632509953e0 100644 --- a/source/blender/include/BIF_editmesh.h +++ b/source/blender/include/BIF_editmesh.h @@ -197,7 +197,7 @@ int editedge_containsVert(struct EditEdge *eed, struct EditVert *eve); int editface_containsVert(struct EditFace *efa, struct EditVert *eve); int editface_containsEdge(struct EditFace *efa, struct EditEdge *eed); -void shape_copy_select_from(int i); +void shape_copy_select_from(void); void shape_propagate(void); #endif diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index eb53b8fe252..d0c10d08e22 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -5384,31 +5384,11 @@ void shape_propagate(){ return; } -void shape_copy_from(KeyBlock* fromKey) -{ - EditMesh *em = G.editMesh; - EditVert *ev = NULL; - - for(ev = em->verts.first; ev ; ev = ev->next){ - if(ev->f & SELECT){ - float *data; - //Check that index is valid in fromKey - - //Copy co from fromKey->data - data = fromKey->data; - - VECCOPY(ev->co, data+(ev->keyindex*3)); - } - } - BIF_undo_push("Copy Blendshape Verts"); - return; -} - void shape_copy_from_lerp(KeyBlock* thisBlock, KeyBlock* fromBlock) { EditMesh *em = G.editMesh; EditVert *ev = NULL; - short mval[2], curval[2], event = 0, finished = 0, canceled = 0 ; + short mval[2], curval[2], event = 0, finished = 0, canceled = 0, fullcopy=0 ; float perc = 0; char str[64]; float *data, *odata; @@ -5436,6 +5416,10 @@ void shape_copy_from_lerp(KeyBlock* thisBlock, KeyBlock* fromBlock) curval[0] = mval[0]; curval[1] = mval[1]; + if(fullcopy == 1){ + perc = 1; + } + for(ev = em->verts.first; ev ; ev = ev->next){ if(ev->f & SELECT){ VecLerpf(ev->co,odata+(ev->keyindex*3),data+(ev->keyindex*3),perc); @@ -5443,9 +5427,14 @@ void shape_copy_from_lerp(KeyBlock* thisBlock, KeyBlock* fromBlock) } sprintf(str,"Blending at %f%c",perc,'%'); headerprint(str); + DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); force_draw(0); screen_swapbuffers(); + if(fullcopy == 1){ + break; + } + } else { PIL_sleep_ms(10); } @@ -5457,6 +5446,9 @@ void shape_copy_from_lerp(KeyBlock* thisBlock, KeyBlock* fromBlock) if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)){ finished = 1; } + else if (event == MIDDLEMOUSE){ + fullcopy = 1; + } else if (ELEM3(event,ESCKEY,RIGHTMOUSE,RIGHTMOUSE)){ canceled = 1; finished = 1; @@ -5467,13 +5459,17 @@ void shape_copy_from_lerp(KeyBlock* thisBlock, KeyBlock* fromBlock) if(!canceled) BIF_undo_push("Copy Blendshape Verts"); else - BIF_undo(); + for(ev = em->verts.first; ev ; ev = ev->next){ + if(ev->f & SELECT){ + VECCOPY(ev->co, odata+(ev->keyindex*3)); + } + } return; } -void shape_copy_select_from(int mode) +void shape_copy_select_from() { Mesh* me = (Mesh*)G.obedit->data; EditMesh *em = G.editMesh; @@ -5530,12 +5526,8 @@ void shape_copy_select_from(int mode) error("Shape Has had Verts Added/Removed, please cycle editmode before copying"); return; } - if(mode == 0){ - shape_copy_from(kb); - } else if(mode == 1){ - shape_copy_from_lerp(thisBlock,kb); - } - + shape_copy_from_lerp(thisBlock,kb); + return; } a++; diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index d61eae94ab0..1b2f56071fa 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2069,7 +2069,7 @@ void special_editmenu(void) } else if(G.obedit->type==OB_MESH) { - nr= pupmenu("Specials%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x12|Merge%x4|Remove Doubles%x5|Hide%x6|Reveal%x7|Select Swap%x8|Flip Normals %x9|Smooth %x10|Bevel %x11|Set Smooth %x14|Set Solid %x15|Copy Shape Verts%x16|Copy Shape Verts Blend%x17|Propagate Shape Verts%x18"); + nr= pupmenu("Specials%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x12|Merge%x4|Remove Doubles%x5|Hide%x6|Reveal%x7|Select Swap%x8|Flip Normals %x9|Smooth %x10|Bevel %x11|Set Smooth %x14|Set Solid %x15|Copy Shape Verts Blend%x16|Propagate Shape Verts%x17"); switch(nr) { case 1: @@ -2138,12 +2138,9 @@ void special_editmenu(void) mesh_set_smooth_faces(0); break; case 16: - shape_copy_select_from(0); + shape_copy_select_from(); break; case 17: - shape_copy_select_from(1); - break; - case 18: shape_propagate(); break; } |