code cleanup:
[blender-staging.git] / source / blender / editors / screen / screen_ops.c
index 039b1c2f866cc8ad114c47470d456152dd1e7788..8818bd66b2304d1e02b2dfce5815908654b754e0 100644 (file)
@@ -315,7 +315,7 @@ int ED_operator_editmesh(bContext *C)
 {
        Object *obedit= CTX_data_edit_object(C);
        if(obedit && obedit->type==OB_MESH)
-               return NULL != ((Mesh *)obedit->data)->edit_btmesh;
+               return NULL != BMEdit_FromObject(obedit);
        return 0;
 }
 
@@ -367,17 +367,18 @@ int ED_operator_uvedit(bContext *C)
 
 int ED_operator_uvmap(bContext *C)
 {
-       Object *obedit= CTX_data_edit_object(C);
-       BMEditMesh *em= NULL;
+       Object *obedit = CTX_data_edit_object(C);
+       BMEditMesh *em = NULL;
        
-       if(obedit && obedit->type==OB_MESH)
-               em= ((Mesh *)obedit->data)->edit_btmesh;
+       if(obedit && obedit->type == OB_MESH) {
+               em = BMEdit_FromObject(obedit);
+       }
        
        if(em && (em->bm->totface)) {
-               return 1;
+               return TRUE;
        }
        
-       return 0;
+       return FALSE;
 }
 
 int ED_operator_editsurfcurve(bContext *C)