[Bf-committers] Auto-registration in Python

Martin Poirier theeth at yahoo.com
Wed Nov 3 03:12:46 CET 2010



--- On Mon, 11/1/10, Matt Ebb <matt at mke3.net> wrote:

> On Tue, Nov 2, 2010 at 2:31 PM,
> Martin Poirier <theeth at yahoo.com>
> wrote:
> 
> > def fun():
> >  class NewPropertyGroup(bpy.types.IDPropertyGroup):
> >    pass
> >
> >  bpy.types.Scene.new_property =
> PointerProperty(type=NewPropertyGroup, name="Stuff",
> description="Fun New Stuff")
> >
> >  NewPropertyGroup.name = StringProperty(
> >                  name="Name",
> >                  description="Name of
> something",
> >                  maxlen = 128,
> >                  default = "")
> >
> >  # and so on
> 
> That's no good for when the properties are being
> determined
> dynamically though, right? I'm talking about from an
> external data
> source (in this case, querying a shader file for the
> relevant
> parameters that are exposed by it).

It doesn't change anything.

There's no difference whether you're adding properties based on fixed values or a list of variables or whatever you want.

Martin




More information about the Bf-committers mailing list