[Bf-python] Proposed BPyAPI Additions.

Martin Poirier theeth at yahoo.com
Thu Aug 31 21:01:01 CEST 2006


--- Campbell Barton <cbarton at metavr.com> wrote:

> 1)
> scn.objects.new - My intention was to make a new
> object directly from 
> obdata.

In that case, yes, a straight "new" method is ok.

> Id like to avoid adding data spesific adding
> functions if possible.
> what options might you have that are specific to a
> datatype?

Primitives.

cube = scn.objects.newMesh(Primitive.Cube)

> 2) scn.objects.selected - In general I like (little
> long but no way 
> around that)
>   * Could this use the same type as scn.objects but
> initialized with 
> some different options? - making 2 pytypes for what
> is mostly the same 
> thing is a bit annoying.

Inheritance to the rescue!

scn.objects would be a generic set implementation,
scn.objects.selected would use the same methods mostly
but override add, remove and the like to change the
selection instead.

>   *  In most cases people think of the selection as
> the VISIBLE selected 
> objects, must document that it is from all layers.

Indeed.

>   *  If scn.objects.selected is added in and works
> well, it may be good  
> to have scn.objects.context  - Which only gets the 
> visible selected 
> objects - (What would be moved when the user hits
> Gkey.)

Agreed

Martin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Bf-python mailing list