[Bf-python] Mesh Module
Willian Padovani Germano
wgermano at superig.com.br
Sat Oct 8 18:38:10 CEST 2005
Hi,
Ken Hughes wrote:
> Willian Padovani Germano wrote:
>> Are you using a malloc (MEM_mallocN or the Python malloc or the libc
>> one) to get memory for data?
> Oops... no, in this instance I probably should use the PyMem_Malloc()
> and friends (always use MEM_callocN() and MEM_freeN ()otherwise). I'll
> fix that.
Actually we favor Blender's functions, MEM_mallocN, MEM_callocN,
MEM_freeN, as I mentioned, because they give good feedback. Ton once
stated that, too, asking us to use Blender's ones, so please keep that.
What I was mentioning is that you can avoid any malloc, by storing the
actual data in the PyVert struct, for example this way:
typedef struct BPy_MVert {
PyObject_VAR_HEAD
int index;
MVert v;
} PyVert;
But this was before you explained that you were reusing the same struct
for thin and fat verts. Just don't worry about it, then, your aproach
should work fine.
--
Willian
More information about the Bf-python
mailing list