==Python API==
authorCampbell Barton <ideasman42@gmail.com>
Mon, 19 Nov 2007 19:00:28 +0000 (19:00 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 19 Nov 2007 19:00:28 +0000 (19:00 +0000)
removing vertex groups was broken, the function being called was for editmode, this would remove the vertex group but apply the weights from the removed group to the next vertex group.

source/blender/python/api2_2x/Mesh.c

index 7430c2a6e9161402959aa573bd66c63057caabae..5dffb488b3d5f0beb2e7f875f5f24a099c16ffd0 100644 (file)
@@ -6409,6 +6409,10 @@ static PyObject *Mesh_removeVertGroup( PyObject * self, PyObject * value )
        int nIndex;
        bDeformGroup *pGroup;
 
+       if( G.obedit )
+               return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+                       "can't use removeVertGroup() while in edit mode" );
+       
        if( !groupStr )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected string argument" );
@@ -6431,8 +6435,8 @@ static PyObject *Mesh_removeVertGroup( PyObject * self, PyObject * value )
        nIndex++;
        object->actdef = (unsigned short)nIndex;
 
-       del_defgroup( object );
-
+       del_defgroup_in_object_mode( object );
+       
        EXPP_allqueue( REDRAWBUTSALL, 1 );
 
        Py_RETURN_NONE;