Sunday, March 7, 2010

ImportError: No module named Rasterizer

I was trying to make a GUI for a script that would enable a user to run an external script through clicking an OK button.
def button_event(evt) :
if evt==EV_BT_OK:
Blender.Run('C:\Documents and Settings\hiral mehta\Desktop\project stuff\')

However, this contains modules like Rasterizer etc. Hence, when I run the GUI script (with [ALT]+P) it gives an error saying ImportError: No module named Rasterizer.

Is it not possible to create a GUI for a script which will have a button which when clicked runs a script in the BGE (for e.g. a button when clicked displays the mouse pointer in the BGE)

Please help.


Chirag said...

Hey, had come across this earlier on BA. There's a relatively simple method somewhere.

Goes something like :
import Blender
run ''

So you can add a container that says on mouse click import Blender...etc.

Shobit said...

Yes, that would be for a button in the BGE (on mouse click etc) I wanted the solution for the button as part of the GUI for a script. The scripts that work with [ALT]+P.