I’m in the process of developing a LOD system in python for Blender Game Engine. But I’m stuck on the alpha of the objects.
Here is the deal:
I need an object in the game, that fades in, and fades out, as the camera gets near and far away from the object. Using alpha of course.
I know this can be done easily with IPO. But I need to be in python code only, because it will get all the objects in the scene. And please, no GLSL. I really need to use Texture Faces or Multitexture.
Someone told me it could be done by using this:
import bpy, bge; cont = bge.logic.getCurrentController() obj = cont.owner mesh = obj.meshes obj.color = [.5, .5, .5, 0.1] print(obj.color)
But… it didn’t work in the game engine nor running the script alone.