[Bf-python] Python API refactoring wiki

Joe Eagar joeedh at gmail.com
Fri Jan 27 14:09:32 CET 2006


Campbell Barton wrote:
> Joe Eagar wrote:
>> jmsoler at free.fr wrote:
>>> Selon Campbell Barton <cbarton at metavr.com>:
>>>
>>>  
>>>> Hey Guys, started a wiki page for python api refactoring.. check it 
>>>> out.
>>>> http://mediawiki.blender.org/index.php/BlenderDev/BpyApiDiscussion
>>>>
>>>>     
>>>
>>> About this :
>>> " Will we maintain NMesh? (seems like a good time to get rid of it)",
>>> just a word, create a simple vertex with Mesh is 60/70 times slower
>>> than with NMesh .
>>>   
>>
>> If NMesh was deprecated, would it be possible to write a python 
>> wrapper around it?  That way existing scripts could use the wrapper 
>> instead of having to do a full rewrite.
>>
>> And I noticed that in the verts.extend C function the vert list is 
>> reallocated every time.  I would think that allocating extra space at 
>> each call (so that the list is reallocated every 10 .extends, the 
>> other 9 calls using this extra allocated space) would be faster, 
>> although admittedly I've only done this for pointer arrays so I have 
>> no experience with this sort of thing.
>>
>> joeedh
> Hey JoeHeed,
> Have discussed an NMesh wrapper and its not such a bad idea, May try 
> this sometime, though would probably never get 100% backwards compat 
> with old scripts.
>
> as for extend() allocating each time- hope people who have used python 
> list extend get a hint that its not ment to be used like append()
> This isnt quite as simple as it seems (Ken Correct me im wrong)- Since 
> Mesh edits the mesh in place - having a mesh with memory allocated mut 
> not used could cause a memory leak..
> Its not like NMesh that has a PutRaw command or ob.update() - after 
> every commant blender needs to have a usable mesh otherwise crashes 
> happen fairly easerly...
Ok that makes sense I was a little confused. 

joeedh



More information about the Bf-python mailing list