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

Theo de Ridder theo.de.ridder at planet.nl
Thu Sep 11 11:27:59 CEST 2008


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




More information about the Bf-python mailing list