From ace1c998c42263712bccbce5e2942aecdc8c592e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 24 Apr 2010 10:08:07 +0000 Subject: warning cleanup, also made voxel.c and volumetric.c use BM_INLINE define rather then having their own ifdefs in each file. --- source/blender/editors/mesh/editmesh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index e3f0d96ccfc..5de869f09d3 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -87,8 +87,8 @@ editmesh.c: */ /* XXX */ -static void BIF_undo_push() {} -static void error() {} +static void BIF_undo_push(const char *dummy) {} +static void error(const char *dummy) {} /* ***************** HASH ********************* */ -- cgit v1.2.3 From 2ebb1c63f7b26478ed4c85d572312adf562b3148 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 5 Jun 2010 23:27:49 +0000 Subject: finish cleanup to cmake editors, also removed some stuff from scons thats not needed. --- source/blender/editors/mesh/editmesh.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 5de869f09d3..4545014c47f 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -60,9 +60,6 @@ #include "BKE_texture.h" #include "BKE_utildefines.h" -#include "LBM_fluidsim.h" - - #include "ED_mesh.h" #include "ED_object.h" #include "ED_retopo.h" -- cgit v1.2.3 From 8faa11a9e6bba929e3c8d4b69ae956c9602d446d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Jun 2010 16:58:31 +0000 Subject: separate loose parts was hanging on hidden verts --- source/blender/editors/mesh/editmesh.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 4545014c47f..cdcbb5cb461 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1480,10 +1480,18 @@ static int mesh_separate_loose(Scene *scene, Base *editbase) } EM_clear_flag_all(em, SELECT); - - while(doit && em->verts.first) { + + while(doit) { /* Select a random vert to start with */ - EditVert *eve= em->verts.first; + EditVert *eve; + int tot; + + /* check if all verts that are visible have been done */ + for(eve=em->verts.first; eve; eve= eve->next) + if(!eve->h) break; + if(eve==NULL) break; /* only hidden verts left, quit early */ + + /* first non hidden vert */ eve->f |= SELECT; selectconnected_mesh_all(em); @@ -1493,8 +1501,14 @@ static int mesh_separate_loose(Scene *scene, Base *editbase) if((eve->f & SELECT)==0) break; if(eve==NULL) break; + tot= BLI_countlist(&em->verts); + /* and now separate */ doit= mesh_separate_selected(scene, editbase); + + /* with hidden verts this can happen */ + if(tot == BLI_countlist(&em->verts)) + break; } BKE_mesh_end_editmesh(me, em); -- cgit v1.2.3 From 5fa7d1c1b4e7bde1d173caa60af0e273c86b6f0b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 1 Aug 2010 12:47:49 +0000 Subject: 2.5: code changes to reduce the usage of G.main and pass it along or get it from the context instead. --- source/blender/editors/mesh/editmesh.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index cdcbb5cb461..a63f4995acc 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1330,7 +1330,7 @@ static EnumPropertyItem prop_separate_types[] = { }; /* return 1: success */ -static int mesh_separate_selected(Scene *scene, Base *editbase) +static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase) { EditMesh *em, *emnew; EditVert *eve, *v1; @@ -1372,7 +1372,7 @@ static int mesh_separate_selected(Scene *scene, Base *editbase) */ /* 1 */ - basenew= ED_object_add_duplicate(scene, editbase, 0); /* 0 = fully linked */ + basenew= ED_object_add_duplicate(bmain, scene, editbase, 0); /* 0 = fully linked */ ED_base_object_select(basenew, BA_DESELECT); /* 2 */ @@ -1441,7 +1441,7 @@ static int mesh_separate_selected(Scene *scene, Base *editbase) } /* return 1: success */ -static int mesh_separate_material(Scene *scene, Base *editbase) +static int mesh_separate_material(Main *bmain, Scene *scene, Base *editbase) { Mesh *me= editbase->object->data; EditMesh *em= BKE_mesh_get_editmesh(me); @@ -1453,7 +1453,7 @@ static int mesh_separate_material(Scene *scene, Base *editbase) /* select the material */ EM_select_by_material(em, curr_mat); /* and now separate */ - if(0==mesh_separate_selected(scene, editbase)) { + if(0==mesh_separate_selected(bmain, scene, editbase)) { BKE_mesh_end_editmesh(me, em); return 0; } @@ -1464,7 +1464,7 @@ static int mesh_separate_material(Scene *scene, Base *editbase) } /* return 1: success */ -static int mesh_separate_loose(Scene *scene, Base *editbase) +static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase) { Mesh *me; EditMesh *em; @@ -1504,7 +1504,7 @@ static int mesh_separate_loose(Scene *scene, Base *editbase) tot= BLI_countlist(&em->verts); /* and now separate */ - doit= mesh_separate_selected(scene, editbase); + doit= mesh_separate_selected(bmain, scene, editbase); /* with hidden verts this can happen */ if(tot == BLI_countlist(&em->verts)) @@ -1518,16 +1518,17 @@ static int mesh_separate_loose(Scene *scene, Base *editbase) static int mesh_separate_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Base *base= CTX_data_active_base(C); int retval= 0, type= RNA_enum_get(op->ptr, "type"); if(type == 0) - retval= mesh_separate_selected(scene, base); + retval= mesh_separate_selected(bmain, scene, base); else if(type == 1) - retval= mesh_separate_material (scene, base); + retval= mesh_separate_material(bmain, scene, base); else if(type == 2) - retval= mesh_separate_loose(scene, base); + retval= mesh_separate_loose(bmain, scene, base); if(retval) { WM_event_add_notifier(C, NC_GEOM|ND_DATA, base->object->data); -- cgit v1.2.3 From 8c455e1da807265f5eb684cdb3e85d7dcca1f2a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 8 Aug 2010 08:33:47 +0000 Subject: remove unused includes --- source/blender/editors/mesh/editmesh.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index a63f4995acc..2ba6800b62e 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -43,22 +43,13 @@ #include "BKE_cloth.h" #include "BKE_context.h" -#include "BKE_customdata.h" #include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" #include "BKE_global.h" #include "BKE_key.h" -#include "BKE_library.h" #include "BKE_main.h" #include "BKE_material.h" #include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_object.h" #include "BKE_paint.h" -#include "BKE_pointcache.h" -#include "BKE_softbody.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" #include "ED_mesh.h" #include "ED_object.h" -- cgit v1.2.3 From 15669532a231b25ef4cddd36720376ec4b8f3dc2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 10 Aug 2010 05:41:51 +0000 Subject: header re-shuffle, some headers contained unneeded refereces to other headers, better include inline with the C files that need them --- source/blender/editors/mesh/editmesh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 2ba6800b62e..e6ba228c260 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -32,8 +32,11 @@ #include "MEM_guardedalloc.h" - +#include "DNA_scene_types.h" +#include "DNA_object_types.h" #include "DNA_key_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_modifier_types.h" #include "BLI_blenlib.h" #include "BLI_math.h" @@ -41,7 +44,7 @@ #include "BLI_dynstr.h" #include "BLI_rand.h" -#include "BKE_cloth.h" +#include "BKE_DerivedMesh.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" -- cgit v1.2.3