[Bf-python] Proposal to getSelected and getAcitve
Willian Padovani Germano
wgermano at ig.com.br
Thu Mar 3 17:27:28 CET 2005
Hi,
Sorry, this is getting a little confusing to me. Let's see what we have
and what is really needed.
There's already:
- Object.Get() to get all objects in the current scene;
- 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). But isn't it better to only allow access to an active
object if it is selected? This gives a clear, well defined and
*reliable* way to access the active object.
- 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.
PS: pidhash, portuguese is ok with me, but not on the list, of course ; ).
--
Willian
More information about the Bf-python
mailing list