[Bf-python] Proposal for getting identifier names for datablocks that require links to objects

Campbell Barton ideasman42 at gmail.com
Thu Sep 11 15:53:22 CEST 2008


my preference would be to do

list = bpy.data.particles.names()

where particles are a wrapped linked list like bpy.data.meshes,
.scenes etc and have the names() function generic for all datablock
iterators.

getting a list of object, mesh names is something some scripts need to
do anyway.

the .new() functon for particles could just not be implemented, or
could later be implemented and take an object as its argument.

On Thu, Sep 11, 2008 at 7:27 PM, Theo de Ridder
<theo.de.ridder at planet.nl> wrote:
>
> On 11 sep 2008, at 00:57, Ken Hughes wrote:
>
>> The proposal:
>>
>> We implement a
>> datatype/attribute/function/constructor/whatever-you-want-to-call-it
>> for
>> particles which contains all the names of existing particle
>> datablocks.
>> This can then be used as an argument to link an existing datablock
>> to a
>> object:
>>
>>   names = bpy.data.particles  # returns a list of strings, not BPy
>> particles
>>   if len(names) > 0: ob.newParticleSystem(names[0])
>>
>> You could also add a system by name, assuming it exists (otherwise an
>> exception is thrown):
>>   ob.newParticleSystem("PSys")
>
>
> it would be cleaner and more general to replace this proposal by:
>    names = bpy.names.particles
>
> with the obvious semantics of 'names' that you get names and not data
>
>
> Theo
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



More information about the Bf-python mailing list