9
$\begingroup$

I am trying to go trough a simple Blender tutorial in which I need to use module Rasterizer. Unfortunately my Blender has no such module. As far as I know Blender has its own Python so there should be no collision with other

EDIT: Yes, question concerns BGE. As fas as I saw I have none of the modules that should be in Blender: no bge for example. I dont think there is need to get the link to the tutorial, as Blender Python console simply states that script failed, and the script is:

import Rasterizer

or

import bge

both fail.

EDIT2: I have downloaded a new version of Blender 2.68a. When it starts writes: found bundled python. I have for example bpy module but no bge module. It seems I have absolutely no Game Engine module. What a pity! :(

$\endgroup$
8
$\begingroup$

You can't import these module from the Python Console, they're only available when the bge is running. Add your script to a python controller logic brick.

$\endgroup$
  • $\begingroup$ Also, I believe 'rasterizer' is an deprecated alias for the 'render' module. $\endgroup$ – Mike Pan Aug 6 '13 at 18:55
2
$\begingroup$

While @Aldrik's answer is correct, it took me a while to figure out how to make it actually happen.

Don't choose Text/Run script from the text editor, but choose Game/Start Game Engine from the main menu and invoke the controller logic to which you assigned the script.

If you want to run the script at Game Engine startup, use an AlwaysSensor and connect it to a Python controller. At the Python controller choose Script and select the Python file which you have opened in the text editor.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.