[Bf-python] Proposal to getSelected and getAcitve

Joilnen Batista Leite vma_bad_list at yahoo.com
Fri Mar 4 14:57:39 CET 2005


Hi,

--- Willian Padovani Germano <wgermano at ig.com.br>
wrote:
> There's already:
> 
> - Object.Get() to get all objects in the current
> scene;

It getting any object in any scene too, that is good.
 
> - Object.GetSelected() to get all selected objects
> in the current scene 
> (this function uses G.vd and we probably don't need
> to -- and most 
> probably shouldn't in fact -- so we can consider
> removing mentions to 
> G.vd there).  It's possibly not needed to check if
> the active object is 
> in an active layer, too and so we don't have to
> check for G.vd->lay 
> either).  .GetSelected() also serves to get the
> active (selected) object.
> 
> Campbell is right, the active object may not be
> selected (if no object 
> is selected).  

I agree with this ideas, but I don't like much of
GetSelected to get Active in first, because it's two
distinct things when we have in the mind one only
scene it could be interesting, but working with many
scenes and layers I think better have other more sure
func like isActive maybe.

> - We can also already change scenes and set visible
> layers, so there's 
> no need to add new functions to mess with this, it
> can be done via 
> Python cleanly.  Maybe expanding Object.Get and
> Object.GetSelected with 
> an optional 'layers' list parameter to restrict the
> returned obj lists 
> to only the given layers can be useful, but again,
> this is already 
> possible via bpython in more verbose ways.
> 
> Setting the active object is already done with
> method object.select(): 
> select an object and it becomes the active one.
> 
> Still, we can add Object module functions
> Object.SetActive(obj) and also 
> Object.GetActive() like Campbell suggested, for
> completeness and 
> simetry, since other modules have these.
> 
> What do you guys think?  As always, I'm just
> discussing things openly, 
> feel free to disagree, point mistakes and so on.

Well I tryed to add things to Scene submodule because
hierarchy in blender Structs.

Thanks, Joilnen 


	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/



More information about the Bf-python mailing list