[Bf-python] Blender.Group
Toni Alatalo
antont at kyperjokki.fi
Mon Mar 13 17:14:23 CET 2006
On Monday 13 March 2006 09:21, cpbarton at iinet.net.au wrote:
> Hello Self,
greetings
> Example::
> gp= Group.Get("Group")
ok.
in the new API, i would like to have:
gp = Blender.groups['group']
> gp.objects.append(ob)
dp.add()?
i suggest to use the Set interface for groups.
then we can use the existing set code in py,
all = gp_a + gp_b + gp_c
not_a = all - gp_a
etc..
i use groups .. oops i mean sets already in many things here at orange.
> gp.objects.remove( gp.objects[0] )
> print len(gp.objects)
> gp.name= "MyGroup"
i think this all is perfect - let's just do the Set integration too!
> - Cam
~Toni
>
> Quoting Campbell J Barton <cbarton at metavr.com>:
> > Hello Pythoners..
> > Ever since groups were added I wanted to use them - dupligroups esp!
> > But no python support means I cant use them for exporting to out
> > engine...
> >
> > To get to the point, I got stuck at LA airport and had a go at
> > Blender.Group
> >
> > Its small, but groups arnt that complex.
> >
> > The module uses getsetattrs, and an iterator for objects, wich fits realy
> > nice
> > with listbase's and general speedyness.
> >
> > Syntax is as follows.
> >
> > g= Group.Get('SomeGroup')
> > g.name= 'NewName'
> > for ob in g.objects: print ob.name
> >
> > newob= Object.Get('myob')
> > g.objects.append(newob)
> >
> > # Empty the group
> > for ob in g.objects:
> > g.objects.remove(ob)
> >
> >
> > Setfaulting at the moment us Group.Unlink() and directly assigning lists
> > to g.objects.
> >
> > ken/will- once its stabalized Ill submit a patch.
> > - Cam
> >
> >
> > --
> > Campbell J Barton
> >
> > 133 Hope Street
> > Geelong West, Victoria 3218 Australia
> >
> > URL: http://www.metavr.com
> > e-mail: cbarton at metavr.com
> > phone: AU (03) 5229 0241
> > _______________________________________________
> > Bf-python mailing list
> > Bf-python at projects.blender.org
> > http://projects.blender.org/mailman/listinfo/bf-python
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
More information about the Bf-python
mailing list