diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2006-12-03 02:37:52 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2006-12-03 02:37:52 +0300 |
commit | 472c3677fb40750dd944d64bc99c2f3d2c989b05 (patch) | |
tree | 086aa9fd5c3a5d2bed1f579c08453f70be495594 /source/blender/src/editmesh.c | |
parent | 76616f2a3bc483e369c7349d2b3e072bde7c7325 (diff) |
Better integration of multires with editmode. Setting/adding levels no longer exits editmode, and undo should now work as expected. Still to come is loading customdata from the editmesh.
Diffstat (limited to 'source/blender/src/editmesh.c')
-rw-r--r-- | source/blender/src/editmesh.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index e66c42d902a..c962bc0f889 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -104,6 +104,7 @@ #include "BDR_editface.h" #include "BDR_vpaint.h" +#include "multires.h" #include "mydevice.h" #include "blendef.h" @@ -1815,6 +1816,7 @@ typedef struct UndoMesh { RetopoPaintData *retopo_paint_data; char retopo_mode; CustomData vdata, fdata; + Multires *mr; } UndoMesh; /* for callbacks */ @@ -1830,6 +1832,7 @@ static void free_undoMesh(void *umv) if(um->retopo_paint_data) retopo_free_paint_data(um->retopo_paint_data); CustomData_free(&um->vdata, um->totvert); CustomData_free(&um->fdata, um->totface); + if(um->mr) multires_free(um->mr); MEM_freeN(um); } @@ -1924,6 +1927,8 @@ static void *editMesh_to_undoMesh(void) um->retopo_paint_data= retopo_paint_data_copy(em->retopo_paint_data); um->retopo_mode= em->retopo_mode; + um->mr = get_mesh(G.obedit)->mr ? multires_copy(get_mesh(G.obedit)->mr) : NULL; + return um; } @@ -2034,6 +2039,13 @@ static void undoMesh_to_editMesh(void *umv) retopo_free_paint(); em->retopo_paint_data= retopo_paint_data_copy(um->retopo_paint_data); em->retopo_mode= um->retopo_mode; + + { + Mesh *me= get_mesh(G.obedit); + multires_free(me->mr); + me->mr= NULL; + if(um->mr) me->mr= multires_copy(um->mr); + } } |