From 4ebcae7158f2bdbb9bfdbac8c53801ba70d6fc90 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Apr 2012 09:34:43 +0000 Subject: [PATCH] bmesh todos: - dont do name based object lookup to find the object for a mesh undo state (possibly object is renamed inbetween undos which would crash) - remove some todo comments for things that are working as they should. --- source/blender/editors/mesh/editmesh_select.c | 2 +- source/blender/editors/mesh/editmesh_tools.c | 3 +-- source/blender/editors/mesh/editmesh_utils.c | 6 +----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 4c889357673..29aab453822 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -2066,7 +2066,7 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h /* Walk over selected elements starting at active */ BMW_init(&walker, bm, walktype, mask_vert, mask_edge, mask_face, - BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */ + BMW_FLAG_NOP, /* don't use BMW_FLAG_TEST_HIDDEN here since we want to desel all */ BMW_NIL_LAY); BLI_assert(walker.order == BMW_BREADTH_FIRST); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 0ae9518b8b6..5b6811fcc5c 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -143,8 +143,7 @@ void MESH_OT_subdivide(wmOperatorType *ot) /* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */ RNA_def_property_flag(prop, PROP_SKIP_SAVE); - /* BMESH_TODO, this currently does nothing, just add to stop UI from erroring out! */ - RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor (BMESH TODO)", 0.0f, 1.0f); + RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor", 0.0f, 1.0f); RNA_def_boolean(ot->srna, "quadtri", 0, "Quad/Tri Mode", "Tries to prevent ngons"); RNA_def_enum(ot->srna, "quadcorner", prop_mesh_cornervert_types, SUBD_STRAIGHT_CUT, diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 56c7fae0029..12601d51b01 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -517,7 +517,6 @@ static void *getEditMesh(bContext *C) typedef struct UndoMesh { Mesh me; int selectmode; - char obname[MAX_ID_NAME - 2]; } UndoMesh; /* undo simply makes copies of a bmesh */ @@ -527,7 +526,6 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata) Mesh *obme = obdata; UndoMesh *um = MEM_callocN(sizeof(UndoMesh), "undo Mesh"); - BLI_strncpy(um->obname, em->ob->id.name + 2, sizeof(um->obname)); /* make sure shape keys work */ um->me.key = obme->key ? copy_key_nolib(obme->key) : NULL; @@ -544,12 +542,10 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata) static void undoMesh_to_editbtMesh(void *umv, void *em_v, void *UNUSED(obdata)) { BMEditMesh *em = em_v, *em_tmp; - Object *ob; + Object *ob = em->ob; UndoMesh *um = umv; BMesh *bm; - /* BMESH_TODO - its possible the name wont be found right?, should fallback */ - ob = (Object *)find_id("OB", um->obname); ob->shapenr = em->bm->shapenr; BMEdit_Free(em);