[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57909] trunk/blender/source/blender/ editors: Restrict Weight Edit Panel to mesh/ lattice Edit and Weight Paint vertex selection mode
Gaia Clary
gaia.clary at machinimatrix.org
Mon Jul 1 21:30:42 CEST 2013
Revision: 57909
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57909
Author: gaiaclary
Date: 2013-07-01 19:30:41 +0000 (Mon, 01 Jul 2013)
Log Message:
-----------
Restrict Weight Edit Panel to mesh/lattice Edit and Weight Paint vertex selection mode
Modified Paths:
--------------
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/editors/include/ED_object.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_object.h 2013-07-01 15:23:48 UTC (rev 57908)
+++ trunk/blender/source/blender/editors/include/ED_object.h 2013-07-01 19:30:41 UTC (rev 57909)
@@ -214,6 +214,9 @@
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 15:23:48 UTC (rev 57908)
+++ trunk/blender/source/blender/editors/object/object_vgroup.c 2013-07-01 19:30:41 UTC (rev 57909)
@@ -2775,7 +2775,7 @@
}
}
-static bool vgroup_object_in_edit_mode(Object *ob)
+bool ED_vgroup_object_in_edit_mode(Object *ob)
{
if (ob->type == OB_MESH)
return (BKE_editmesh_from_object(ob) != NULL);
@@ -2785,7 +2785,7 @@
return false;
}
-static bool vgroup_object_in_wpaint_vert_select(Object *ob)
+bool ED_vgroup_object_in_wpaint_vert_select(Object *ob)
{
if (ob->type == OB_MESH) {
Mesh *me = ob->data;
@@ -2803,7 +2803,7 @@
if (!dg)
return;
- if (vgroup_object_in_edit_mode(ob))
+ if (ED_vgroup_object_in_edit_mode(ob))
vgroup_delete_edit_mode(ob, dg);
else
vgroup_delete_object_mode(ob, dg);
@@ -2956,7 +2956,7 @@
if (!(ob && !ob->id.lib && data && !data->lib))
return 0;
- return vgroup_object_in_edit_mode(ob);
+ return ED_vgroup_object_in_edit_mode(ob);
}
/* editmode _or_ weight paint vertex sel */
@@ -2968,8 +2968,8 @@
if (!(ob && !ob->id.lib && data && !data->lib))
return 0;
- return (vgroup_object_in_edit_mode(ob) ||
- vgroup_object_in_wpaint_vert_select(ob));
+ return (ED_vgroup_object_in_edit_mode(ob) ||
+ ED_vgroup_object_in_wpaint_vert_select(ob));
}
/* editmode _or_ weight paint vertex sel and active group unlocked */
@@ -2981,8 +2981,8 @@
if (!(ob && !ob->id.lib && data && !data->lib))
return 0;
- if (!(vgroup_object_in_edit_mode(ob) ||
- vgroup_object_in_wpaint_vert_select(ob)))
+ if (!(ED_vgroup_object_in_edit_mode(ob) ||
+ ED_vgroup_object_in_wpaint_vert_select(ob)))
{
return 0;
}
@@ -3008,8 +3008,8 @@
if (ob->type != OB_MESH)
return 0;
- return (vgroup_object_in_edit_mode(ob) ||
- vgroup_object_in_wpaint_vert_select(ob));
+ return (ED_vgroup_object_in_edit_mode(ob) ||
+ ED_vgroup_object_in_wpaint_vert_select(ob));
}
static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op))
@@ -3513,7 +3513,7 @@
if (!(ob && !ob->id.lib && data && !data->lib))
return false;
- if (vgroup_object_in_edit_mode(ob)) {
+ if (ED_vgroup_object_in_edit_mode(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 15:23:48 UTC (rev 57908)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c 2013-07-01 19:30:41 UTC (rev 57909)
@@ -798,7 +798,8 @@
{
Scene *scene = CTX_data_scene(C);
Object *ob = OBACT;
- if (ob && ((ob->mode & OB_MODE_EDIT) || (ob->mode & OB_MODE_WEIGHT_PAINT))) {
+ if (ob && (ED_vgroup_object_in_edit_mode(ob) ||
+ ED_vgroup_object_in_wpaint_vert_select(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