[Bf-python] custom types properties on GameEngine...

Campbell Barton ideasman42 at gmail.com
Wed Dec 24 13:54:04 CET 2008


On Wed, Dec 24, 2008 at 4:43 AM, Natanael Olaiz <nolaiz at gmail.com> wrote:
> Hi all!, me again...
>
> I have another question about the GameEngine: when I start it and open the
> serial port (serial.Serial()), I would like to keep the returned handler
> class to use it later.... I though to use a property for that, but I can
> store only Timer, Int, String, Float, Bool types. Any idea about it? Could I
> define another type to use? Could I store a global variable in some other
> way?
>
>
> Thanks in advance, and merry christmas :)
> Natanael.
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python

Custom vars arnt happening any time soon, but you can store variables
it GameLogic

# you can run this is your not able to run some initializing script,
this will assign a var to GameLogic if its not there,
if hasattr(GameLogic, 'serialVar'): serial = GameLogic.serialVar
else: serial = GameLogic.serialVar = serial.Serial()

-- 
- Campbell



More information about the Bf-python mailing list