[Bf-python] object.getDataName() - Implimented

Stephen Swaney sswaney at centurytel.net
Sun Jan 30 17:15:34 CET 2005


On Sun, Jan 30, 2005 at 10:32:00AM +0000, Campbell Barton wrote:
>
> I thaught of that but my coging is no where near good enougbh to 
> impliment it,
> by the way, its
> o.getDataName()
> not - o.getData().getName()
> ...Otherwise it would be calling getData anyway, this skips the detdata 
> call and only gets the name.

I wrote it the way I meant it!  My point is that

a) the call to getData() should be cheap.  No point in creating data
structures that will not be used.

b) we already have a getName() method in our bpy types (or should!!).
We should be reluctant to create extra methods to duplicate existing
functionality.  The more code you write, the more code you must debug,
document, and maintain.

> 
> Weather lazy initialization is added or not I still think this could be 
> usefull-
[..snippage..]
> 
> And would not load a whole mesh with 100,000s verts into memory.

At the risk of repeating myself, I agree.  There is no point in
creating data that will not be used.

-- 
Stephen Swaney			
sswaney at centurytel.net




More information about the Bf-python mailing list