[Bf-committers] game engine: newNaming added objects?

Toni Alatalo bf-committers@blender.org
Sun, 4 Jul 2004 13:51:30 +0300 (EEST)


(i'm subscribed in digest mode so the thread info might be broken)

On Sun, 4 Jul 2004 Kester Maddock wrote:

> On Friday 02 July 2004 23:02, Toni Alatalo wrote:
> > the renaming that's used elsewhere in Blender too (the .001, .002 -thing),
> I think that will probably break some games.

how? asking just out of curiosity, not necessary to go into that, 'cause
it is not the way i initially thought of either -- more about that:

> I suggest either:
> 1.  provide obj.getName() & obj.setName() methods (or obj.name attribute)

definitely enough for me (and probably for that friend too).

> 2.  Overload all the methods that take a game objects name.  They all just 
(..)
> trackto.setObject(newobj)

this is actually what i first suggested too in that previous discussion,
http://www.blender.org/pipermail/bf-committers/2003-September/004035.html
is "Using GameObject IDs when calling from Python, or changing names of
added objects?" and with the IDs i just tried to mean the reference to
the object -- digged the source a bit back then to see if i could've done 
that myself

> I think #2 is the most robust solution.  

.. so i agree.

Patrick, though, somewhat opposed that approach in his reply, mentioning a 
setName actuator and stating: "this problem is best solved by trying to
fix it at the root rather than trying to find a workaround." which would
speak for your #4 (setUnique), and of course #1 helps there too

but perhaps not being able to use the objects as parameters is at least as
important a root of the problem

> Do you need a method like act.getObject() (which returns the target 
> object's name) that returns a reference to the actual object?

no i don't, but it does sound useful.

> Also, with the new scene python methods you can get a list of all the objects 
> in the scene, which should make this sort of cross object scripting easier.

ah, thanks for info, as in my current system (from August 2003) there is
an own Scene class, with lists of all objects and the ones that have been
added to the visible layer (check it out from
http://studio.kyperjokki.fi/engine/KyperMover if interested) -- will
remember that in the next refactoring if it ever comes for that
implementation

> Kester

~Toni