Hi folks,
i had to do a hacky workaround to change the backgroundcolor in realtime, because i didnt know, that now it really works… nice! (bge.render.setBackgroundColor([R,G,B,?)], since18.2.11)
this thread:
http://blenderartists.org/forum/showthread.php?t=209239
Now i want to use newest Verions to use this new feature, because i will stuck with this ‘old’ Version…
In my actual build(34959), or better, in all versions i tried after 2.56.0 (34074), the data structure doesnt work anymore; all imports from other script dont work…
I made a simple Test-Environment, and tried it on Windows 7, Ubuntu 9.x and 10.10.
Here are the Codes:
-This sets all Pathes:
################################################################################
#
# Copyright (C) 2010, Martin Sell <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
################################################################################
'''
Descr... Module
==============================
Detailed descr...
'''
__version__ = "0.0"
__author__ = "Moerdn"
__package__ = "Src"
import os
from os import path
import bge
GL = bge.logic
sep = path.sep
#from .SrcInterfaces.IFunctions import *
def findSourceDir(folder):
for pathentry in os.walk(folder, True):
if 'Src' in pathentry[0]:
return True
return False
def getLibraryPath():
fd = '//'
folder = GL.expandPath(fd)
while not findSourceDir(folder):
fd += '..' + os.path.sep
folder = GL.expandPath(fd)
LIBRARY_PATH = [folder + 'Src' + sep,
folder + 'Src' + sep + 'ModFunc',
folder + 'Src' + sep + 'config',
folder + 'Src' + sep + 'Testfunc'
]
print(folder)
return LIBRARY_PATH
def printLibraryPath():
pass
-This Initialises the Pathes in GameEngine, gets all Source Locations:
################################################################################
#
# Copyright (C) 2010, Martin Sell <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
################################################################################
'''
Descr... Module
==============================
Detailed descr...
'''
__version__ = "0.0"
__author__ = "Moerdn"
__package__ = "Src"
#from .SrcInterfaces.IFunctions import *
#from .SrcInterfaces.IGameLogic import *
from . import __config__
import bge
GL = bge.logic
def init(con):
""" Init all Source Locations """
if con.sensors[0].positive:
##
# @descr: Append all Source Pathes to the System LibPath
#
from sys import path
for PATH in __config__.getLibraryPath():
path.append(GL.expandPath(PATH))
##
# @descr: Run whatever actuator meant to be runned
#
for sen in con.sensors:
if sen.positive:
for act in con.actuators:
con.activate(act)
def cleanup(con):
""" Cleanup all pyc Files """
import os
for pathentry in os.walk('Src', False):
for py_file in pathentry[2]:
split_file = py_file.split('.')
if len(split_file) is 2:
if split_file[1] == 'pyc':
path = os.path.join(pathentry[0], py_file)
os.unlink(path)
I dont know where to start debug, because it worked perfect, i have no idea…
Maybe someone has the same or similar problem and know a solution…
here are the Test files:
http://npshare.de/files/bfc79ca5/expandPath.zip
Thanks for your interest.