Cleanup: Shapekey: get rid of `ED_vgroup_object_is_edit_mode()`
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 17 Nov 2014 19:33:25 +0000 (20:33 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 17 Nov 2014 19:33:25 +0000 (20:33 +0100)
It was doing exactly the same thing as `BKE_object_is_in_editmode_vgroup()`, tsst...

source/blender/editors/include/ED_mesh.h
source/blender/editors/object/object_vgroup.c
source/blender/makesrna/intern/rna_object.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index 2b4fa1b9196dcf4585f2cde11acef5c1f306f5de..63362b0638b538facca6672242d4499869bb1d59 100644 (file)
@@ -244,8 +244,6 @@ void                 ED_vgroup_mirror(struct Object *ob,
                                       const bool all_vgroups, const bool use_topology,
                                       int *r_totmirr, int *r_totfail);
 
-bool                 ED_vgroup_object_is_edit_mode(struct Object *ob);
-
 void                 ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum,  float weight, int assignmode);
 void                 ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum);
 float                ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum);
index b7f121d52dd73210328d55501e2e11b96e06decf..672dcb47d920dea68d5f45ef03fe9874aeb3765b 100644 (file)
@@ -126,16 +126,6 @@ bool ED_vgroup_sync_from_pose(Object *ob)
        return false;
 }
 
-bool ED_vgroup_object_is_edit_mode(Object *ob)
-{
-       if (ob->type == OB_MESH)
-               return (BKE_editmesh_from_object(ob) != NULL);
-       else if (ob->type == OB_LATTICE)
-               return (((Lattice *)ob->data)->editlatt != NULL);
-
-       return false;
-}
-
 bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name)
 {
        bDeformGroup *defgroup;
@@ -159,7 +149,7 @@ void ED_vgroup_delete(Object *ob, bDeformGroup *defgroup)
 {
        BLI_assert(BLI_findindex(&ob->defbase, defgroup) != -1);
 
-       if (ED_vgroup_object_is_edit_mode(ob))
+       if (BKE_object_is_in_editmode_vgroup(ob))
                vgroup_delete_edit_mode(ob, defgroup);
        else
                vgroup_delete_object_mode(ob, defgroup);
@@ -168,7 +158,7 @@ void ED_vgroup_delete(Object *ob, bDeformGroup *defgroup)
 void ED_vgroup_clear(Object *ob)
 {
        bDeformGroup *dg = (bDeformGroup *)ob->defbase.first;
-       int edit_mode = ED_vgroup_object_is_edit_mode(ob);
+       int edit_mode = BKE_object_is_in_editmode_vgroup(ob);
 
        while (dg) {
                bDeformGroup *next_dg = dg->next;
index 8ebeeafbc580444046821cb855add997e1f04c5f..e6714bbe433cdcea734662a4a9023d1c4de6f9f5 100644 (file)
@@ -1422,7 +1422,7 @@ static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *re
 {
        Object *ob = (Object *)id;
 
-       if (ED_vgroup_object_is_edit_mode(ob)) {
+       if (BKE_object_is_in_editmode_vgroup(ob)) {
                BKE_report(reports, RPT_ERROR, "VertexGroup.add(): cannot be called while object is in edit mode");
                return;
        }
@@ -1437,7 +1437,7 @@ static void rna_VertexGroup_vertex_remove(ID *id, bDeformGroup *dg, ReportList *
 {
        Object *ob = (Object *)id;
 
-       if (ED_vgroup_object_is_edit_mode(ob)) {
+       if (BKE_object_is_in_editmode_vgroup(ob)) {
                BKE_report(reports, RPT_ERROR, "VertexGroup.remove(): cannot be called while object is in edit mode");
                return;
        }
index 56abdfd27b18277c1d05c0ec27c0797a762793de..a5a8d9b17da5ba9a2c233af6562a7ce4bad68c5d 100644 (file)
@@ -467,7 +467,6 @@ void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertn
 float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum) RET_ZERO
 void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup) RET_NONE
 void ED_vgroup_clear(struct Object *ob) RET_NONE
-bool ED_vgroup_object_is_edit_mode(struct Object *ob) RET_ZERO
 int ED_mesh_mirror_topo_table(struct Object *ob, char mode) RET_ZERO
 int ED_mesh_mirror_spatial_table(struct Object *ob, struct BMEditMesh *em, const float co[3], char mode) RET_ZERO