Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#26667] Can't import scripts when using blenderplayer *NEED MORE INFO*

Date:
2011-03-29 14:47
Priority:
3
State:
Closed
Submitted by:
Daniel Dionne (mrzeon)
Assigned to:
Campbell Barton (campbellbarton)
Category:
None
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Can't import scripts when using blenderplayer *NEED MORE INFO*
Detailed description
Internal script imports aren't working properly when executing with blenderplayer.
For example, I have a script called util.py. When doing "import util" from another script, I get the following error:

ImportError: No module named util
Python script error from controller "init.py#CONTR#3":
Traceback (most recent call last):
File "init.py", line 3, in <module>

Exporting the script to the path where the .blend is located works.

Followup

Message
  • Date: 2011-03-29 15:42
  • Sender: Campbell Barton
  • please upload an example blend (or zip of multiple files which show this bug).
    if your files are complicated it helps to make a more simple testcase.
  • Date: 2011-03-29 16:36
  • Sender: Daniel Dionne
  • I uploaded a simple example.
    Opening it in Blender works fine, it should print "hey, I'm a function!" to the console.
    Opening it with blenderplayer results in the previously mentioned import error.
 

Attached Files:

Name Date Download
scripts_bug.blend 2011-03-29 16:36 Download

Changes:

Field Old Value Date By
status_idOpen2011-03-29 18:12campbellbarton
close_dateNone2011-03-29 18:12campbellbarton
StatusInvestigate2011-03-29 18:12campbellbarton
File Added15600: scripts_bug.blend2011-03-29 16:36mrzeon
assigned_tonone2011-03-29 15:42campbellbarton
summaryCan\'t import scripts when using blenderplayer2011-03-29 15:42campbellbarton
StatusNew2011-03-29 15:42campbellbarton