[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57910] trunk/blender/source/blender: move api functions from r57909 into BKE.

Campbell Barton ideasman42 at gmail.com
Mon Jul 1 22:27:04 CEST 2013


Revision: 57910
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57910
Author:   campbellbarton
Date:     2013-07-01 20:27:03 +0000 (Mon, 01 Jul 2013)
Log Message:
-----------
move api functions from r57909 into BKE.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57909

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_object.h
    trunk/blender/source/blender/blenkernel/intern/object.c
    trunk/blender/source/blender/editors/include/ED_object.h
    trunk/blender/source/blender/editors/object/object_vgroup.c
    trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c

Modified: trunk/blender/source/blender/blenkernel/BKE_object.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_object.h	2013-07-01 19:30:41 UTC (rev 57909)
+++ trunk/blender/source/blender/blenkernel/BKE_object.h	2013-07-01 20:27:03 UTC (rev 57910)
@@ -79,6 +79,8 @@
 void BKE_object_unlink(struct Object *ob);
 bool BKE_object_exists_check(struct Object *obtest);
 bool BKE_object_is_in_editmode(struct Object *ob);
+bool BKE_object_is_in_editmode_vgroup(struct Object *ob);
+bool BKE_object_is_in_wpaint_select_vert(struct Object *ob);
 
 struct Object *BKE_object_add_only_object(struct Main *bmain, int type, const char *name);
 struct Object *BKE_object_add(struct Main *bmain, struct Scene *scene, int type);

Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/object.c	2013-07-01 19:30:41 UTC (rev 57909)
+++ trunk/blender/source/blender/blenkernel/intern/object.c	2013-07-01 20:27:03 UTC (rev 57910)
@@ -764,6 +764,24 @@
 	return false;
 }
 
+bool BKE_object_is_in_editmode_vgroup(Object *ob)
+{
+	return (OB_TYPE_SUPPORT_VGROUP(ob->type) &&
+	        BKE_object_is_in_editmode(ob));
+}
+
+bool BKE_object_is_in_wpaint_select_vert(Object *ob)
+{
+	if (ob->type == OB_MESH) {
+		Mesh *me = ob->data;
+		return ( (ob->mode & OB_MODE_WEIGHT_PAINT) &&
+		         (me->edit_btmesh == NULL) &&
+		         (ME_EDIT_PAINT_SEL_MODE(me) == SCE_SELECT_VERTEX) );
+	}
+
+	return false;
+}
+
 bool BKE_object_exists_check(Object *obtest)
 {
 	Object *ob;

Modified: trunk/blender/source/blender/editors/include/ED_object.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_object.h	2013-07-01 19:30:41 UTC (rev 57909)
+++ trunk/blender/source/blender/editors/include/ED_object.h	2013-07-01 20:27:03 UTC (rev 57910)
@@ -214,9 +214,6 @@
         int *free,
         const unsigned int selection_mask);
 
-bool ED_vgroup_object_in_edit_mode(struct Object *ob);
-bool ED_vgroup_object_in_wpaint_vert_select(struct Object *ob);
-
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/blender/source/blender/editors/object/object_vgroup.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_vgroup.c	2013-07-01 19:30:41 UTC (rev 57909)
+++ trunk/blender/source/blender/editors/object/object_vgroup.c	2013-07-01 20:27:03 UTC (rev 57910)
@@ -2775,35 +2775,13 @@
 	}
 }
 
-bool ED_vgroup_object_in_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;
-}
-
-bool ED_vgroup_object_in_wpaint_vert_select(Object *ob)
-{
-	if (ob->type == OB_MESH) {
-		Mesh *me = ob->data;
-		return ( (ob->mode & OB_MODE_WEIGHT_PAINT) &&
-		         (me->edit_btmesh == NULL) &&
-		         (ME_EDIT_PAINT_SEL_MODE(me) == SCE_SELECT_VERTEX) );
-	}
-
-	return false;
-}
-
 static void vgroup_delete(Object *ob)
 {
 	bDeformGroup *dg = BLI_findlink(&ob->defbase, ob->actdef - 1);
 	if (!dg)
 		return;
 
-	if (ED_vgroup_object_in_edit_mode(ob))
+	if (BKE_object_is_in_editmode_vgroup(ob))
 		vgroup_delete_edit_mode(ob, dg);
 	else
 		vgroup_delete_object_mode(ob, dg);
@@ -2956,7 +2934,7 @@
 	if (!(ob && !ob->id.lib && data && !data->lib))
 		return 0;
 
-	return ED_vgroup_object_in_edit_mode(ob);
+	return BKE_object_is_in_editmode_vgroup(ob);
 }
 
 /* editmode _or_ weight paint vertex sel */
@@ -2968,8 +2946,8 @@
 	if (!(ob && !ob->id.lib && data && !data->lib))
 		return 0;
 
-	return (ED_vgroup_object_in_edit_mode(ob) ||
-	        ED_vgroup_object_in_wpaint_vert_select(ob));
+	return (BKE_object_is_in_editmode_vgroup(ob) ||
+	        BKE_object_is_in_wpaint_select_vert(ob));
 }
 
 /* editmode _or_ weight paint vertex sel and active group unlocked */
@@ -2981,8 +2959,8 @@
 	if (!(ob && !ob->id.lib && data && !data->lib))
 		return 0;
 
-	if (!(ED_vgroup_object_in_edit_mode(ob) ||
-	    ED_vgroup_object_in_wpaint_vert_select(ob)))
+	if (!(BKE_object_is_in_editmode_vgroup(ob) ||
+	    BKE_object_is_in_wpaint_select_vert(ob)))
 	{
 		return 0;
 	}
@@ -3008,8 +2986,8 @@
 	if (ob->type != OB_MESH)
 		return 0;
 
-	return (ED_vgroup_object_in_edit_mode(ob) ||
-	        ED_vgroup_object_in_wpaint_vert_select(ob));
+	return (BKE_object_is_in_editmode_vgroup(ob) ||
+	        BKE_object_is_in_wpaint_select_vert(ob));
 }
 
 static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op))
@@ -3076,7 +3054,7 @@
 	RNA_def_boolean(ot->srna, "all", 0, "All", "Remove all vertex groups");
 }
 
-static int vertex_group_assign_exec(bContext *C, wmOperator *op)
+static int vertex_group_assign_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	ToolSettings *ts = CTX_data_tool_settings(C);
 	Object *ob = ED_object_context(C);
@@ -3513,7 +3491,7 @@
 	if (!(ob && !ob->id.lib && data && !data->lib))
 		return false;
 
-	if (ED_vgroup_object_in_edit_mode(ob)) {
+	if (BKE_object_is_in_editmode_vgroup(ob)) {
 		return true;
 	}
 	else if ((ob->type == OB_MESH) && (ob->mode & OB_MODE_WEIGHT_PAINT)) {

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c	2013-07-01 19:30:41 UTC (rev 57909)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c	2013-07-01 20:27:03 UTC (rev 57910)
@@ -798,8 +798,9 @@
 {
 	Scene *scene = CTX_data_scene(C);
 	Object *ob = OBACT;
-	if (ob && (ED_vgroup_object_in_edit_mode(ob) ||
-	    ED_vgroup_object_in_wpaint_vert_select(ob))) {
+	if (ob && (BKE_object_is_in_editmode_vgroup(ob) ||
+	           BKE_object_is_in_wpaint_select_vert(ob)))
+	{
 		MDeformVert *dvert_act = ED_mesh_active_dvert_get_only(ob);
 		if (dvert_act) {
 			return (dvert_act->totweight != 0);




More information about the Bf-blender-cvs mailing list