diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-03-30 11:28:37 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-03-30 11:28:37 +0400 |
commit | 89b906db9f758fb9642e01d9b4433b97557369fb (patch) | |
tree | 89f0e670a581728e7102a9ca00c5261befb18a57 /source/blender/editors/mesh/editmesh.c | |
parent | 22fec544c8d07e6099580b0e799e309dcfeeed6b (diff) |
editmesh accessor functions. most editmesh access now goes through:
EditMesh *EM_GetEditMesh(Mesh *me);
void EM_EndEditMesh(Mesh *me, EditMesh *em);
as discussed on the mailling list, this is to facilitate migration to bmesh.
next step is to merge this this to the bmesh branch. this was done in the 2.5
branch to prevent too great a divergance.
also, made makesdna/makesrna work on cygwin/msvc2008/scons.
Diffstat (limited to 'source/blender/editors/mesh/editmesh.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 9e24e520b69..a266bd18a7a 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1455,9 +1455,10 @@ static int mesh_separate_selected(Scene *scene, Base *editbase) obedit= editbase->object; me= obedit->data; - em= me->edit_mesh; + em= EM_GetEditMesh(me); if(me->key) { error("Can't separate with vertex keys"); + EM_EndEditMesh(me, em); return 0; } @@ -1468,7 +1469,10 @@ static int mesh_separate_selected(Scene *scene, Base *editbase) EM_stats_update(em); - if(em->totvertsel==0) return 0; + if(em->totvertsel==0) { + EM_EndEditMesh(me, em); + return 0; + } /* we are going to work as follows: * 1. add a linked duplicate object: this will be the new one, we remember old pointer @@ -1536,6 +1540,8 @@ static int mesh_separate_selected(Scene *scene, Base *editbase) DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); DAG_object_flush_update(scene, basenew->object, OB_RECALC_DATA); + EM_EndEditMesh(me, em); + return 1; } @@ -1543,7 +1549,7 @@ static int mesh_separate_selected(Scene *scene, Base *editbase) static int mesh_separate_material(Scene *scene, Base *editbase) { Mesh *me= editbase->object->data; - EditMesh *em= me->edit_mesh; + EditMesh *em= EM_GetEditMesh(me); unsigned char curr_mat; for (curr_mat = 1; curr_mat < editbase->object->totcol; ++curr_mat) { @@ -1552,9 +1558,13 @@ static int mesh_separate_material(Scene *scene, Base *editbase) /* select the material */ editmesh_select_by_material(em, curr_mat); /* and now separate */ - if(0==mesh_separate_selected(scene, editbase)) + if(0==mesh_separate_selected(scene, editbase)) { + EM_EndEditMesh(me, em); return 0; + } } + + EM_EndEditMesh(me, em); return 1; } @@ -1566,10 +1576,11 @@ static int mesh_separate_loose(Scene *scene, Base *editbase) int doit= 1; me= editbase->object->data; - em= me->edit_mesh; + em= EM_GetEditMesh(me); if(me->key) { error("Can't separate with vertex keys"); + EM_EndEditMesh(me, em); return 0; } @@ -1585,6 +1596,8 @@ static int mesh_separate_loose(Scene *scene, Base *editbase) /* and now separate */ doit= mesh_separate_selected(scene, editbase); } + + EM_EndEditMesh(me, em); return 1; } @@ -2015,3 +2028,11 @@ void em_setup_viewcontext(bContext *C, ViewContext *vc) } } +EditMesh *EM_GetEditMesh(Mesh *me) +{ + return me->edit_mesh; +} + +void EM_EndEditMesh(Mesh *me, EditMesh *em) +{ +} |