Sunday, March 7, 2010

ImportError: No module named Rasterizer

Hello,
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\drag_drop.py')

However, this drag_drop.py 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.

2 comments:

Chirag said...

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

Goes something like :
import Blender
run 'drag_drop.py'

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.