- couldn't help myself, got distracted working on something else and

wondered what these silly data pointers in MDeformVert were for.
   Turns out they aren't even need! Just taking up extra memory and
   space and confusing the armature deform algorithm. Naturally I
   had to clean things up. Sorry Ton.

   Deform weights are still stored in a pretty expensive and unnecessary
   way, probably use about twice as much memory as needed, and do
   way too many memory allocs.
 - moved armature_deform_verts into armature.c
 - some python code accessed the MDeformWeight data pointers, but
   did so in a completely wrong way, I am positive this code could
   never have worked (or maybe things changed during tons refactor),
   regardless it wouldn't work now... will test later.
This commit is contained in:
Daniel Dunbar
2005-08-11 06:44:32 +00:00
parent 8eca413964
commit 76d2f0da9e
5 changed files with 99 additions and 88 deletions

View File

@@ -1405,23 +1405,27 @@ static PyObject *NMesh_getVertexInfluences( PyObject * self, PyObject * args )
sweight = me->dvert[index].dw;
for( i = 0; i < totinfluences; i++ ) {
/*Add the weight and the name of the bone, which is used to identify it */
if( sweight->data )
/* Disabled this code, it couldn't be correct!
* sweight->data was being set to a posechannel not a bone
* for one thing, and it is not always set for another.
* The only thing safe here is to return the defgroup number. -zr
*/
// if( sweight->data )
/* valid bone: return its name */
/* PyList_SetItem(influence_list, i,
Py_BuildValue("[sf]", sweight->data->name, sweight->weight));
else // NULL bone: return Py_None instead
PyList_SetItem(influence_list, i,
Py_BuildValue("[Of]", Py_None, sweight->weight)); */
PyList_Append( influence_list,
Py_BuildValue( "[sf]",
sweight->
data->
name,
sweight->
weight ) );
// PyList_Append( influence_list,
// Py_BuildValue( "[sf]",
// sweight->
// data->
// name,
// sweight->
// weight ) );
/* Next weight */
sweight++;